[hobbit] RRD data yes, graph no.
Rob Munsch
rmunsch at solutionsforprogress.com
Mon Oct 23 21:55:10 CEST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
A last-ditch plea for help. For those not already skipping any thread
starting RRD, if anyone has the time i will buy you a 6-pack of the beer
of your choice. Here's everything i got.
The issue: cputemp.rrd is created. It shows values in the XML. The
custom test shows green, the page shows the MSG i crafted.
But,
There is no graph. Not even a blank one with "nan," there's nothing but
a text link!
The Script: server-side only; since we are capturing the desired number,
no need to bother with the client now.
- -----
#!/bin/sh
# Input parameters: Hostname, testname (column), and messagefile
#
echo `date` >/tmp/cputemp.runs
TMPLOG="/tmp/$1.$2.out"
echo "$1, $2, $3" > $TMPLOG
cat $3 >> $TMPLOG
HOSTNAME="$1"
TESTNAME="$2"
FNAME="$3"
# set up the Data Set, testname, and what kind:time:min:max
# U means Unknown.
echo "DS:cputemp:GAUGE:600:0:U"
# name the RRD for the host and test
echo "cputemp.rrd"
# Analyze the message we got. If it's only one line, grab it.
# The interesting number is the fourth element in this case.
# We're getting a leading space: kill it.
CPU=`grep CPU $FNAME | awk '{ print $4 }' | sed '/^ / s///'`
echo "I found ${CPU} value for cputemp" >> $TMPLOG
echo "${CPU}"
exit 0
- -----
TMPLOG shows:
- -----
currant.tbb, cputemp, /home/hobbit/server/tmp/rrd_msg_27289
status currant,tbb.cputemp green Mon Oct 23 15:37:50 EDT 2006
Current CPU Temperature: 109 degrees Fahrenheit.
I found 109 value for cputemp
- -----
So we're getting the number. A dump of the rrd file seems to back this up
- -----
<!-- 2006-10-23 14:35:00 EDT / 1161628500 --> <row><v> 1.0037272727e+02
</v></row>
<!-- 2006-10-23 14:40:00 EDT / 1161628800 -->
<row><v> 1.0093333333e+02 </v></row>
<!-- 2006-10-23 14:45:00 EDT / 1161629100 -->
<row><v> 1.0085666667e+02 </v></row>
- -----
Ok, great. So data is fine. On to the graph commands! The fault must
be in something i did, or didn't, in the server configs.
In hobbitgraph.cfg:
- -----
[cputemp]
TITLE CPU Temperature
YAXIS DegreesF
DEF:cputemp.rrd:cputemp:AVERAGE
LINE2:cputemp#0000FF:CPU Temperature
GPRINT:cputemp:LAST: \: %5.1lf (cur)
GPRINT:cputemp:MAX: \: %5.1lf (max)
GPRINT:cputemp:MIN: \: %5.1lf (min)
GPRINT:cputemp:AVERAGE: \: %5.1lf (avg)\n
- -----
very boring and plain, yes? nothing fancy.
hobbitlaunch.cfg:
- -----
[rrdstatus]
ENVFILE /home/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/cputemp.sh --extra-tests=cputemp
# "rrddata" updates RRD files with information that arrives as "data"
messages.
# If you want RRD graphs of your monitoring BB data, then you want to
run this.
[rrddata]
ENVFILE /home/hobbit/server/etc/hobbitserver.cfg
NEEDS hobbitd
CMD hobbitd_channel --channel=data
- --log=$BBSERVERLOGS/rrd-data.log hobbitd_rrd --rrddir=$BBVAR/rrd
- --extra-script=$BBHOME/ext/cputemp.sh --extra-tests=cputemp
- -----
And lastly, hobbitserver.cfg:
- -----
TEST2RRD="cputemp,cpu=la,..."
GRAPHS="cputemp,la,..."
- -----
note that i have tried every combo there i could think of. just
test2rrd, just graphs, cputemp=cputemp on one, on the other, on both...
nothing causes a graph to appear. ever. i'm going nuts.
I have definitely covered everything documented; many many thanks to
Greg and others for pointing out that i was also following the NCV
instructions simultaneously for a while there. :)
But... i don't see what could possibly be left that isn't happening.
If anyone's gotten non-ncv graphs to appear on custom scripts, the
aforementioned 6-pack (bottles not cans) is awaiting you if you could
check your server .cfgs and see what you have in there that i don't.
The script itself is simple enough: text link instead of picture tells
me that RRD isn't even trying to draw anything.
- --
Rob Munsch
Solutions For Progress IT
www.solutionsforprogress.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFPR4eBvBcJFK6xYURAgjzAJ0fT6bISR3Av5C1oLK23w3rENimqACfZ4NR
QNSSU9RE/j+BTTFK+8aodsE=
=3f7H
-----END PGP SIGNATURE-----
More information about the Xymon
mailing list