Hobbit Devmon question / help needed
Stewart, Tom L.
Tom.Stewart at landsend.com
Sun Oct 7 16:40:55 CEST 2007
I downloaded Devmon and have it running just fine.
However, I am having a problem with getting the stats from a Devmon
if_load status into rrd. The rrd's never get created. I did do the other
parts and since I am creating a tmp file from the extra-rrd.pl, that
would indicate that the code is executing !
Here is where I believe the problem is.
>From the extra-rrd.pl the code is as follows:
Code start ------------
#!/usr/bin/perl
# Input parameters: Hostname, testname (column), and messagefile
#$HOSTNAME=$ARGV[0]; ;
$TESTNAME=$ARGV[1]; ;
$FNAME=$ARGV[2]; ;
$filename="/tmp/if_log";
# Read the entire files
open (FILEHANDLE,$FNAME) || die ("cant read file\n");
@input = <FILEHANDLE>;
close (FILEHANDLE);
if ( $TESTNAME eq "if_load") {
# Analyze the message we got
open(OUT, ">", $filename);
print OUT "This is the stuff\n at input";
foreach $line (@input) {
if ($line =~ /(^[A-Z].*) (\d+):(\d+)$/ ) {
# The RRD dataset definitions
print "DS:in:DERIVE:600:0:U\n";
print "DS:out:DERIVE:600:0:U\n";
# The filename
print "if_load_$1.rrd\n";
# The data
print "$2:$3\n";
}
}
close (OUT);
}
Code stop -----------------------
I added some code to create and show what is in the if_load stat in the
/tmp/if_log file for debugging.
The /tmp/if_log file I see is:
bash-3.00$ cat /tmp/if_log
This is the stuff
status INET-7204.if_load green Sun Oct 7 09:29:05 2007
<b>Interface error rates:</b>
Input load: yellow=50%, red=75%
Output load: yellow=50%, red=75%
Not alarming on any values
<table border=1 cellpadding=5>
<tr><td>Ifc name</td><td>Ifc Speed</td><td>Rate in (load
%)</td><td>Rate out (load %)</td></tr>
<tr><td>Se1/0 [Berbee DS3]</td><td>44210000</td><td>&green 697.48 Kbps
(1.58%)</td><td>&green 1.62 Mbps (3.67%)</td></tr>
<tr><td>Fa0/0 [Vlan100 inet-6509-1]</td><td>100000000</td><td>&green
1.62 Mbps (1.62%)</td><td>&green 713.65 Kbps (0.71%)</td></tr>
<tr><td>Fa2/0 [Vlan101 inet-6509-2]</td><td>100000000</td><td>&green
180.00 bps (0.00%)</td><td>&green 11.29 Kbps (0.01%)</td></tr>
<tr><td>Fa2/1</td><td>100000000</td><td>&green 0.00 bps
(0.00%)</td><td>&green 0.00 bps (0.00%)</td></tr>
</table>
<!--DEVMON RRD: if_load 0 0
DS:ds0:COUNTER:600:0:U DS:ds1:COUNTER:600:0:U
-->
Devmon version 0.3.0-beta2 running on
Here is a copy of the message file from
devmon/templates/cisco-7206/if_load
The message file for the device (7206) shows:
<b>Interface error rates:</b>
Input load: yellow={ifInLoad.thresh:yellow}%,
red={ifInLoad.thresh:red}%
Output load: yellow={ifOutLoad.thresh:yellow}%,
red={ifOutLoad.thresh:red}%
TABLE:rrd(DS:ds0:ifInOctets:COUNTER; DS:ds1:ifOutOctets:COUNTER)
Ifc name|Ifc Speed|Rate in (load %)|Rate out (load %)
{ifName}{ifAliasBox}|{ifSpeed}|{ifInLoad.color}{ifInSpeed}
({ifInLoad}%){ifInLoa
d.errors}|{ifOutLoad.color}{ifOutSpeed} ({ifOutLoad}%){ifOutLoad.errors}
I suspect the message file is wrong? But I have only started this on
Friday, so I figured the experts could point me to the right direction.
More information about the Xymon
mailing list