From: xbgmsharp <xbg...@gm...> - 2007-08-03 17:10:44
|
In hobbit etc/hobbitlaunch.cfg # "rrdstatus" updates RRD files with information that arrives as "status" messages. # If you want RRD graphs of your monitoring data, then you want to run this. [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,if_err,if_col This defines the script which is use to generated rrd file. extra-rrd.pl is a script of mine and it generated rrd data in a file. And here is the body: #!/usr/bin/perl # Input parameters: Hostname, testname (column), and messagefile #$HOSTNAME=3D$ARGV[0]; ; $TESTNAME=3D$ARGV[1]; ; $FNAME=3D$ARGV[2]; ; # Read the entire files open (FILEHANDLE,$FNAME) || die ("cant read file\n"); @input =3D <FILEHANDLE>; close (FILEHANDLE); if ( $TESTNAME eq "if_load" || $TESTNAME eq "if_err" || $TESTNAME eq "if_col") { # Analyze the message we got foreach $line (@input) { # Debug system qq# echo "$line" >> /tmp/if_log # 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 "$TESTNAME_$1.rrd\n"; # The data print "$2:$3\n"; } } } exit 0 Hope this help. --=20 Thanks for using xbgm# http://xbgm.sourceforge.net/ Please feedback. |