--------------- #!/bin/sh # Input parameters: Hostname, testname (column), and messagefile HOSTNAME="$1" TESTNAME="$2" FNAME="$3" if [ "$TESTNAME" = "license" ] then # Analyze the message we got InUse=`grep "In Use" $FNAME | cut -d : -f 2 | sed "s/ //"` # The RRD dataset definitions echo "DS:license:GAUGE:600:0:U" # The filename echo "license.rrd" # The data echo "$InUse" # Added for debugging purposes if [ "$HOSTNAME" = "license" ] then echo $HOSTNAME, $TESTNAME, $FNAME >>license_test.txt echo "$InUse" >>license_test.txt cat $FNAME >>license_test.txt fi fi The output from the debugging part (license_test.txt) looks like this: -------------- license, license, /usr/local/hobbit/server/tmp/rrd_msg_27159 8 status license.license green Tue 05/10/2005- 7:37:41.18 Pro/Engineer Wildfire 2 Licenses -------------------------------- Total licenses available: 31 In Use: 8 And here's the RRD definition: -------------- [license] TITLE License Utilization YAXIS Used Licenses DEF:avg=license.rrd:license:AVERAGE LINE2:avg#@COLOR@:Used Licenses GPRINT:avg:LAST: \: %5.0lf (cur) GPRINT:avg:MAX: \: %5.0lf (max) GPRINT:avg:MIN: \: %5.0lf (min) GPRINT:avg:AVERAGE: \: %5.0lf (avg)\n