[hobbit] Sending data from script to an rrd
Rob Munsch
rmunsch at solutionsforprogress.com
Wed Oct 18 21:57:38 CEST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hubbard, Greg L wrote:
> Rob,
>
> You are trying to combine two scripts into one. Read the FAQ.
The faq, of note, has some contradictions, while we're on the subject.
Frex:
"If you want the graph included with the other graphs on the trends
column, you must add it to the GRAPHS setting in the
~hobbit/server/etc/hobbitserver.cfg file.
GRAPHS="la,disk,<... lots more ...>,bbproxy,hobbitd,slab"
Okay. Did that with cputemp. Then at the bottom:
"Make sure you have ncv listed in the GRAPHS setting in
hobbitserver.cfg. (Don't ask why - just take my word that it must be
there)."
Huh? Does this refer to TEST2RRD and is a typo? Does it mean the
"extra setting" vaguely described as
- -----
So we add an extra setting to hobbitserver.cfg:
NCV_slab="inodecache:GAUGE,dentrycache:GAUGE"
- -----
which i kept after the existing statements in the Graph section, for
lack of any more specific notes.
Or does it mean that "ncv" must now appear in GRAPHS= by itself, and
this is the first mention of it?
I have spent all day working with this. Please don't respond to threads
with "read the FAQ" when i quite obviously stated i have done so, and
they are definitely not written for the novice in any event. It means
either you have not read what I have written, or that you feel I am in
some way not worth your time. This is very frustrating.
Thank you.
>
> -----Original Message-----
> From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com]
> Sent: Wednesday, October 18, 2006 2:13 PM
> To: hobbit at hswn.dk
> Subject: Re: [hobbit] Sending data from script to an rrd
>
> Ralph Mitchell wrote:
>> On 10/18/06, Rob Munsch <rmunsch at solutionsforprogress.com> wrote:
>>>> When you add the --extra-script option in the [rrdstatus] block,
>>> Well i'm stuck already. What file is that block in? I can't find it
>
>>> in 'server.cfg nor 'graph.cfg...
>> It's in server/etc/hobbitlaunch.cfg
>
> yeah found that with a grep rrdstatus, heh oops.
>
>>> So something like
>>>
>>> echo "DS:cputemp:GAUGE:600:0:U"
>>> echo "cputemp.rrd"
>>>
>>> probably isn't far off after all?
>> That should do it, yes. That's the format for the RRD creation, and
>> the name to create. If you just want to push out one value, you'd
>> follow that with:
>
>> echo "$temp"
>
> I seem to still be doing something wrong...
>
>> I don't think hobbit_rrd will recreate the rrd if it already exists,
>> so you'd have to delete it sometime to get it rebuilt with the extra
>> variables. Wave bye-bye to your old data...
>
> "Sir, I have no data."
>
> Ok, so i did this
>
> [cputemp]
> TITLE CPU Temp
> YAXIS Degrees Fahrenheit
> DEF:avg=cputemp.rrd:cputemp:AVERAGE
> AREA:cputemp#00CC00:CPU Temp Average
> -u 1.0
> GPRINT:cputemp:LAST: \: %5.11f (cur)
> GPRINT:cputemp:MAX: \: %5.1lf (max)
> GPRINT:cputemp:MIN: \: %5.1lf (min)
> GPRINT:cputemp:AVERAGE: \: %5.1lf (avg)\n
>
> and this
>
> GRAPHS="la,disk,inode,qtree,memory,users,cputemp,.....8<...
>
> as well, on the server.
> but what i get is a text link called
>
> Status unchanged in 1 hours, 41 minutes
> Status message received from 10.10.10.12 hobbit graph cputemp
>
> that leads to nothing. Not even a "nan" graph :P
>
> I think maybe by echo is in the wrong place...? Should it be before or
> after the $BB msg command? Does it matter?
>
> hobbit at currant:~/client/ext$ cat cputemp.sh #!/bin/sh
>
> umask 133
>
> COLUMN=cputemp
> COLOR=green
> MSG="Current CPU Temperature: "
> host=`hostname`
>
> ipmitool sensor | grep Temp | awk -F\| '{print $1,$2,$3,$4}' >
> $BBTMP/cputemp.$host
>
> cpu_temp=`tail -n 4 $BBTMP/cputemp.$host |head -n 1 | awk '{print $2}'
> |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 Bad, or even Very Bad.
>
> if $temp > 130
> then
> COLOR=red
> MSG="${MSG} $temp degrees Fahrenheit!
>
> Hothothot!
> "
> else
> MSG="${MSG} $temp Degrees Fahrenheit
>
> Chillin' like a Villain.
> "
> fi
>
> echo "DS:cputemp:GAUGE:600:0:U"
> echo "cputemp.rrd"
> echo "$temp"
>
> # Get this to the hobbit server
> $BB $BBDISP "status $MACHINE.$COLUMN $COLOR `date`
>
> ${MSG}
> "
>
> exit 0
>
>
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
iD8DBQFFNocyBvBcJFK6xYURAm1xAJ0eMz7qu+x+i1UZOXH0365rY1DefgCfT5P0
bh0QNDTExMNmwD3tyNpOkZc=
=q/sU
-----END PGP SIGNATURE-----
More information about the Xymon
mailing list