From: <buc...@us...> - 2011-05-13 11:38:30
|
Revision: 232 http://devmon.svn.sourceforge.net/devmon/?rev=232&view=rev Author: buchanmilne Date: 2011-05-13 11:38:24 +0000 (Fri, 13 May 2011) Log Message: ----------- Update to version that supports using Xymon::Client that returns arrays rather than requiring the caller to process the raw string Modified Paths: -------------- trunk/extras/devmongraphtitle.pl Modified: trunk/extras/devmongraphtitle.pl =================================================================== --- trunk/extras/devmongraphtitle.pl 2011-05-13 11:24:27 UTC (rev 231) +++ trunk/extras/devmongraphtitle.pl 2011-05-13 11:38:24 UTC (rev 232) @@ -21,16 +21,35 @@ } my ($testname,$intname) = split(/\./,$files[0],3); $intname =~ s/_/\//g if ($intname); +print "Looking for $intname\n" if $ENV{'DEBUG'}; -my $bb=Xymon::Client->new; +my $bb; +if ($ENV{'DEBUG'}) { + $bb=Xymon::Client->new(undef,debug=>1); +} else { + $bb=Xymon::Client->new; +} my $result = $bb->hobbitdlog("$hostname.$testname"); + +#For api returning string +if (0) { while (<$result>) { chomp; + print if $ENV{'DEBUG'}; if (m(^<tr><td>$intname ([^<]+)?<\/td><td>)) { $intdesc = $1; print "Network Traffic on $intname ($intdesc) $period\n"; exit 0; } } +} +foreach (@{$result}) { + print if $ENV{'DEBUG'}; + 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"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |