From: <buc...@us...> - 2011-05-13 11:24:33
|
Revision: 231 http://devmon.svn.sourceforge.net/devmon/?rev=231&view=rev Author: buchanmilne Date: 2011-05-13 11:24:27 +0000 (Fri, 13 May 2011) Log Message: ----------- Add initial devmongraphtitle script (using older Xymon::Client interface), and commented usage example in devmon-graph.cfg Modified Paths: -------------- trunk/extras/devmon-graph.cfg Added Paths: ----------- trunk/extras/devmongraphtitle.pl Modified: trunk/extras/devmon-graph.cfg =================================================================== --- trunk/extras/devmon-graph.cfg 2011-04-04 12:17:05 UTC (rev 230) +++ trunk/extras/devmon-graph.cfg 2011-05-13 11:24:27 UTC (rev 231) @@ -1,6 +1,7 @@ [if_load] FNPATTERN if_load.(.*).rrd TITLE Network Traffic + #TITLE exec:$BBHOME/ext/devmongraphtitle.pl YAXIS Bits/second DEF:in@RRDIDX@=@RRDFN@:ds0:AVERAGE CDEF:inbytes@RRDIDX@=in@RRDIDX@,8,* Added: trunk/extras/devmongraphtitle.pl =================================================================== --- trunk/extras/devmongraphtitle.pl (rev 0) +++ trunk/extras/devmongraphtitle.pl 2011-05-13 11:24:27 UTC (rev 231) @@ -0,0 +1,36 @@ +#!/usr/bin/perl +# Script to get the interface name from the current devmon if_load test +# to use as dynamic graph title command (see hobbitgraph.cfg(5)) +# Copyright (c) Buchan Milne <bg...@st...> 2009 +# License GPLv2 + +use strict; +use warnings; +use Xymon::Client; + +my $hostname = shift || ""; +my $graphinstance = shift || ""; +my $period = shift||""; +my @files = @ARGV; + +my $intdesc; + +if (@files gt 1 or @files eq 0) { + print "Network Traffic $period\n"; + exit 0 +} +my ($testname,$intname) = split(/\./,$files[0],3); +$intname =~ s/_/\//g if ($intname); + +my $bb=Xymon::Client->new; +my $result = $bb->hobbitdlog("$hostname.$testname"); + +while (<$result>) { + chomp; + if (m(^<tr><td>$intname ([^<]+)?<\/td><td>)) { + $intdesc = $1; + print "Network Traffic on $intname ($intdesc) $period\n"; + exit 0; + } +} +print "Network Traffic on $intname $period\n"; Property changes on: trunk/extras/devmongraphtitle.pl ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |