From: xbgmsharp <xbg...@gm...> - 2007-07-13 10:10:31
|
Hello, 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 pag= e. In order to check, you should see RRD data information in the status =20 page of the service corresponding to your devmon modele when showing =20 source html. 3) Now make parse the data to create a rrd file (one par interfaces), =20 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=3Dstatus \ --log=3D$BBSERVERLOGS/rrd-status.log hobbitd_rrd \ --rrddir=3D$BBVAR/rrd \ --extra-script=3D$BBHOME/ext/extra-rrd.pl \ --extra-tests=3Dif_load In ext/extra-rrd.pl if ( $TESTNAME eq "if_load" ) { # Analyze the message we got foreach $line (@input) { if ($line =3D~ /(^[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@RRDIDX@=3D@RRDFN@:in:AVERAGE CDEF:inbytes@RRDIDX@=3Din@RRDIDX@,8,* DEF:out@RRDIDX@=3D@RRDFN@:out:AVERAGE CDEF:outbytes@RRDIDX@=3Dout@RRDIDX@,8,* LINE1:inbytes@RRDIDX@#@COLOR@:@RRDPARAM@ In GPRINT:inbytes@RRDIDX@:LAST: %8.2lf %s (cur) GPRINT:inbytes@RRDIDX@:MAX: %8.2lf %s (max) GPRINT:inbytes@RRDIDX@:MIN: %8.2lf %s (min) GPRINT:inbytes@RRDIDX@:AVERAGE: %8.2lf %s (avg)\n LINE1:outbytes@RRDIDX@#@COLOR@:@RRDPARAM@ Out GPRINT:outbytes@RRDIDX@:LAST: %8.2lf %s (cur) GPRINT:outbytes@RRDIDX@:MAX: %8.2lf %s (max) GPRINT:outbytes@RRDIDX@:MIN: %8.2lf %s (avg) GPRINT:outbytes@RRDIDX@:AVERAGE: %8.2lf %s (avg)\n 4) In etc/hobbitserver.cfg Modify the following. See help/howtograph.html TEST2RRD=3D"cpu=3Dla,disk,...,if_load" GRAPHS=3D"la,disk,if_load::1" The ::1 set the maxcount in order to make one graph form each rrd file creat= e. 5) In etc/hobbitcgi.cfg Modify the following. See hobbitsvc.cgi man CGI_SVC_OPTS=3D"--env=3D/data/hobbit/server/etc/hobbitserver.cfg =20 --no-svcid --history=3Dtop --multi-grahs=3Dif_load,if_err..." 6) The hardest part. The hobbit parsing doesn't remove html table table so you will see =20 many graph link. In order to fix than, you need to modify the hobbit source: lib/htmllog.c 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 =20 checking all rrd file in the directory. Henrik, do you have any tips to get the nice counter without editing =20 the source code of htmllog.c file ? That's all folks. --=20 Thanks for using xbgm# http://xbgm.sourceforge.net/ Please feedback. |