[hobbit] RRD data not being created.
Rob Munsch
rmunsch at solutionsforprogress.com
Fri Oct 20 21:31:53 CEST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hubbard, Greg L wrote:
> I am not exactly sure what you are doing, Rob.
That makes two of us!
> It looks like your log file is getting what should be going to STDOUT
> when the script runs. That won't help.
>
> Can you post the content of cputemp.sh?
The serverside or client? heck, here's both.
On the server in server/ext:
- -----
hobbit at randomaccess ~/server/ext $ cat cputemp.sh
#!/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"
# Check the test name so that this script can service multiple
# data collection needs
# if [ "$TESTNAME" = "cputemp" ]
# then
# set up the Data Set, testname, and what kind:size:min:max
# U means Unknown max.
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.
CPU=`grep CPU $FNAME | awk '{ print $4 }'`
echo $CPU
exit 0
- -----
On the client in client/ext:
- -----
hobbit at currant:~/client/ext$ cat cputemp.sh
#!/bin/sh
COLUMN=cputemp
COLOR=green
MSG="Current CPU Temperature: "
host=`hostname`
cpu_temp=$( ipmitool sensor | awk -F\| 'NR==2{print $2}' | sed '/\..*$/
s///g' | sed '/^ */ s///g' )
# Converting to Fahrenheit.
temp=$((${cpu_temp}*9/5+32))
# Ok, we have the temp in degrees as an integer.
# Now to see if it's Very Bad.
if ((${temp} > 130))
then
COLOR=red
MSG="${MSG} ${temp} degrees Fahrenheit!
Hothothot!
"
elif ((${temp} > 120))
then
COLOR=yellow
MSG="${MSG} ${temp} degrees Fahrenheit.
Getting Warmer...
"
else
MSG="${MSG} ${temp} degrees Fahrenheit.
Chillin' like a Villain.
"
fi
# Get this to the hobbit server
$BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`
${MSG}
"
exit 0
- ----
> Or are you doing this simply to get
> it working...
That was my Cunning Plan, yah.
- -rm
> GLH
>
>
> -----Original Message-----
> From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com]
> Sent: Friday, October 20, 2006 1:22 PM
> To: hobbit at hswn.dk
> Subject: Re: [hobbit] RRD data not being created.
>
> Hubbard, Greg L wrote:
>> Is this when you are running the script by hand? $2 is the second
>> parameter. So to run the script by hand, you have to:
>
>> $ ./script node test some.test.file.name
>
>> And then you *should* see "test.rrd" written out.
>
> Weird. running the test by hand gets me this hobbit at randomaccess
> ~/server/ext $ ./cputemp.sh currant.tbb cputemp currant.tbb.cputemp.out
> DS:cputemp:GAUGE:600:0:U cputemp.rrd 100
>
> but cputemp.log in /var/log/hobbit shows only
>
> DS:cputemp:GAUGE:600:0:U
> cputemp.rrd
>
> DS:cputemp:GAUGE:600:0:U
> cputemp.rrd
>
> DS:cputemp:GAUGE:600:0:U
> cputemp.rrd
>
>
> No temp!
> rrdtool dump on cputemp.rrd shows me a buncha
> <!-- 2006-10-20 00:00:00 EDT / 1161316800 --> <row><v> NaN </v></row>
> <!-- 2006-10-20 02:00:00 EDT / 1161324000 -->
> <row><v> NaN </v></row>
> <!-- 2006-10-20 04:00:00 EDT / 1161331200 -->
> <row><v> NaN </v></row>
> <!-- 2006-10-20 06:00:00 EDT / 1161338400 -->
> <row><v> NaN </v></row>
> <!-- 2006-10-20 08:00:00 EDT / 1161345600 -->
> <row><v> NaN </v></row>
> <!-- 2006-10-20 10:00:00 EDT / 1161352800 -->
> <row><v> NaN </v></row>
> <!-- 2006-10-20 12:00:00 EDT / 1161360000 -->
> <row><v> NaN </v></row>
> <!-- 2006-10-20 14:00:00 EDT / 1161367200 -->
> <row><v> NaN </v></row>
>
>
>> The way I tested this was to capture the output of a client side
>> script (just cut from the browser and paste in a text file), then run
>> it by hand using the above method. The RRD commands are written to
>> the terminal, and any griping is in the log.
>
>> Glad you are making progress.
>
>> GLH
>
>> -----Original Message-----
>> From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com]
>> Sent: Thursday, October 19, 2006 2:48 PM
>> To: hobbit at hswn.dk
>> Subject: Re: [hobbit] RRD data not being created.
>
>> Hubbard, Greg L wrote:
>>> Rob, if you implemented the script example I posted, you should be
>>> able to look in the script log to see if it is doing anything. Just
>>> remember not to refer to NCV anywhere in the configuration.
>>> The log will tell you if the script is being called at all -- you can
>
>>> enable any debug you want -- just make sure you write it to the log,
>>> since you will never see STDOUT. You can even cat the incoming file
>>> out to the log.
>>> This is what I had to do to get it working -- sort of organically.
>> I have .rrd files! huzzah. Now i just need to get the actual graph to
>
>> appear, instead of a text link.
>
>> Also, something Odd is happening such that variables are not being
>> expanded. Frex,
>
>> TESTNAME="$2"
>> echo $TESTNAME.rrd
>
>> is coming out as just
>
>> .rrd
>
>> o_O
>> still, it's progress :D
>
>>> GLH
>>> -----Original Message-----
>>> From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com]
>>> Sent: Thursday, October 19, 2006 1:47 PM
>>> To: hobbit at hswn.dk
>>> Subject: [hobbit] RRD data not being created.
>>> I'm pretty sure this is the trouble. Ladies and gentlemen, i am
>>> stumped. Following all the instructions in the docs, manpages, faqs
>>> and alien communications, as well as the very helpful samples
>>> provided
>>> by list members... no new file ever gets created in
>> ~/data/rrd/<hostname>.
>>> I have status, so i know client info is reaching server.
>>> I have copied almost verbatim the sample server-side script needed to
>
>>> parse this info and spit it back out to RRD.
>>> And i have eschewed NCV and gone in favor of hobbitd_channel
>>> --options
>>> to make this all work right, or so I thought.
>>> If you make a custom script and the rrd file never happens, where
>>> would you look first? The serverside script itself? hobbitlaunch.
>>> or
>>> -graph.cfg options? Somewhere else? Mars? I'd be willing to check
>>> Mars at this point.
>
>> To unsubscribe from the hobbit list, send an e-mail to
>> hobbit-unsubscribe at hswn.dk
>
>
>
>> To unsubscribe from the hobbit list, send an e-mail to
>> hobbit-unsubscribe at hswn.dk
>
>
>
>
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
>
>
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
>
>
>
>
To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk
- --
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
iD8DBQFFOSQpBvBcJFK6xYURAvzNAJ9kvb8BKe3DARY8vtTGmJ+aqOBcNgCfQFGf
+dGBWtOCbAkyD9gwkOb5R78=
=4qGs
-----END PGP SIGNATURE-----
More information about the Xymon
mailing list