How to if_* graph from Devmon to Hobbit
xbgmsharp
xbgmsharp at gmail.com
Fri Jul 13 11:58:48 CEST 2007
How to if_* graph from Devmon to Hobbit
This mail describe how to graph all if_* data from Devmon to Hobbit.
I am currently running hobbit 4.2.0/all-in-one patch and devmon 0.3-beta2
1)
First you need a curently working hobbit and devmon.
2)
Then make sure, than the file devmon/templates/modele/if_load/message
TABLE:rrd()
This will show data in a htmltable and add rrd information in the status page.
In order to check, you should see RRD data information in the status
page of the service corresponding to your devmon modele when showing
source html.
3)
Now make parse the data to create a rrd file (one par interfaces),
this is done via extra-rrd.pl.
In etc/hobbitlaunch.cfg
[rrdstatus]
ENVFILE /data/hobbit/server/etc/hobbitserver.cfg
NEEDS hobbitd
CMD hobbitd_channel --channel=status \
--log=$BBSERVERLOGS/rrd-status.log hobbitd_rrd \
--rrddir=$BBVAR/rrd \
--extra-script=$BBHOME/ext/extra-rrd.pl \
--extra-tests=if_load
In ext/extra-rrd.pl
if ( $TESTNAME eq "if_load" ) {
# Analyze the message we got
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";
}
}
}
4)
Modify etc/hobbitgraph.cfg
[if_load]
FNPATTERN if_load(.*).rrd
TITLE Network Traffic
YAXIS Bits/second
DEF:in at RRDIDX@=@RRDFN@:in:AVERAGE
CDEF:inbytes at RRDIDX@=in at RRDIDX@,8,*
DEF:out at RRDIDX@=@RRDFN@:out:AVERAGE
CDEF:outbytes at RRDIDX@=out at RRDIDX@,8,*
LINE1:inbytes at RRDIDX@#@COLOR@:@RRDPARAM@ In
GPRINT:inbytes at RRDIDX@:LAST: %8.2lf %s (cur)
GPRINT:inbytes at RRDIDX@:MAX: %8.2lf %s (max)
GPRINT:inbytes at RRDIDX@:MIN: %8.2lf %s (min)
GPRINT:inbytes at RRDIDX@:AVERAGE: %8.2lf %s (avg)\n
LINE1:outbytes at RRDIDX@#@COLOR@:@RRDPARAM@ Out
GPRINT:outbytes at RRDIDX@:LAST: %8.2lf %s (cur)
GPRINT:outbytes at RRDIDX@:MAX: %8.2lf %s (max)
GPRINT:outbytes at RRDIDX@:MIN: %8.2lf %s (avg)
GPRINT:outbytes at RRDIDX@:AVERAGE: %8.2lf %s (avg)\n
4)
In etc/hobbitserver.cfg
Modify the following.
See help/howtograph.html
TEST2RRD="cpu=la,disk,...,if_load"
GRAPHS="la,disk,if_load::1"
The ::1 set the maxcount in order to make one graph form each rrd file create.
5)
In etc/hobbitcgi.cfg
Modify the following.
See hobbitsvc.cgi man
CGI_SVC_OPTS="--env=/data/hobbit/server/etc/hobbitserver.cfg
--no-svcid --history=top --multi-grahs=if_load,if_err..."
6)
The hardest part.
The hobbit parsing doesn't remove html table table so you will see
many graph link.
In order to fix than, you need to modify the hobbit source with the patch:
lib/htmllog.c
$cd lib/
$patch -p0 < htmllog.path
Here is the path, this only set a new counter for all if_* services.
This is allready working for the trends colunms because, it is
checking all rrd file in the directory.
Henrik, do you have any tips to get the nice counter without editing
the source code of htmllog.c file ?
That's all folks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: htmllog.patch
Type: text/x-patch
Size: 2080 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20070713/ea4c5faf/attachment.bin>
More information about the Xymon
mailing list