[hobbit] Sending data from script to an rrd
So for those of us on Non-Linux systems, the hobbit_rrd source code has all of the parsing definitions for the 'standard' tests. If I want to present 'standard' data to hobbit to be reported AND graphed, it must fit the parsing as defined in hobbit_rrd. If I want to present NEW data, I create a new column with a single extension script on the hobbit server to parse the new data delivered by the clients.
/Thomas Kern /301-903-2211
-----Original Message----- From: henrik at hswn.dk [mailto:henrik at hswn.dk] Sent: Wednesday, October 18, 2006 5:25 PM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
... Snipped ... When the Hobbit server - specifically, the "hobbitd" process that receives messages from the network - gets your data via a "status" message, it creates a column with the color your script decided upon. But it doesn't do any analysis of the data. Instead, it just shoves the raw message out through one or more of the Hobbit "channels", and lets the hobbitd_* worker modules do whatever they want to do with it. One of these worker modules is "hobbitd_rrd", which (as the name implies) handles updating of RRD files. It has to pick out the interesting numbers from the raw status message, and put them into an RRD file. hobbitd_rrd knows how to handle several different kinds of status messages (cpu, disk, memory, network response times ...), but for custom tests that you write yourself, you'll have to provide the code to pick out those numbers you want to put into the graph. So this is where the second script comes into play: This script is the one with the "echo" statements that you cannot quite figure out how should work. Basically, whenever hobbitd_rrd sees a status message which is one of those listed in the "--extra-tests" option, then it hands over the parsing of the status message data to a script you've written. This script must then return the data that should go into the RRD file.
Or use the NCV option which I use in a number of my custom tests for mainframe based systems.
Kern, Thomas wrote:
So for those of us on Non-Linux systems, the hobbit_rrd source code has all of the parsing definitions for the 'standard' tests. If I want to present 'standard' data to hobbit to be reported AND graphed, it must fit the parsing as defined in hobbit_rrd. If I want to present NEW data, I create a new column with a single extension script on the hobbit server to parse the new data delivered by the clients.
/Thomas Kern /301-903-2211
-- Rich Smrcina VM Assist, Inc. Phone: 414-491-6001 Ans Service: 360-715-2467 rich.smrcina at vmassist.com
Catch the WAVV! http://www.wavv.org WAVV 2007 - Green Bay, WI - May 18-22, 2007
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'm askin' the wrong questions, i just realized.
For custom test Foo which has Custom Script Foo.sh, which is a clientside script living in ~/client/ext;
assuming all other .cfg acrobatics have been accomplished, where on the server am i going to find the raw $host.foo data/numbers for me to parse and pass on?
I understand i can maybe copy someone else's macro for it, but i need to see what the raw data looks like so i know what i'm parsing :D.
tia,
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
iD8DBQFFN4yUBvBcJFK6xYURAs85AJoC6DdhUaYMNwch0IEi1YxjB/CM/ACfWlRq dagJRNkDMOJlDjpaVnLEe/M= =2g9/ -----END PGP SIGNATURE-----
Hey Rob,
What is being passed is all the text you so carefully sent in your client-side text. That is why it is important to "pitch" what you can "catch."
When your custom, server-side, RRD-parsing script is called by the Hobbit server, it will be called with three parameters. One of these parameters is the fully qualified name of a file that you can open and read. When your script exits, the Hobbit server will delete the file.
Look in the man pages for hobbitd_rrd, and look at the section called "Custom RRD Data via Scripts"
GLH
Here is an example of this script, based on what I actually use (please don't laugh at my code):
#!/bin/sh
Custom script to parse non-standard files to get data for RRD datasets
Designed to work with the open source "Hobbit Monitor" system
HOSTNAME="$1" TESTNAME="$2" FNAME="$3"
MYNAME="example-rrdparser"
DEBUG=1 # Set to 1 or uncomment to enable debugging output in log
LOG="/opt/hobbit/server/log/$MYNAME.log"
NOW=date '+%d-%h-%Y %H:%M:%S'
Each test name corresponds to the column name used by whoever posts
the
data. At the very root level, this is specified when bb is called to
send the message.
case $TESTNAME in
foo)
# Snag each foo data line
FOO_ALL=`grep "FOO_Events:" $FNAME | awk '{print $3}'`
if [ "$FOO_ALL" = "" ]
then
FOO_ALL="U"
fi
FOO_NOTIFY=`grep "FOO_Notifications:" $FNAME | awk
'{print $3}'`
if [ "$FOO_NOTIFY" = "" ]
then
FOO_NOTIFY="U"
fi
# Print out RRD Foo Dataset definitions
echo "DS:Events:GAUGE:600:0:U"
echo "DS:Notifications:GAUGE:600:0:U"
echo "foo.rrd"
echo "$FOO_ALL:$FOO_NOTIFY"
# Log good news
if [ $DEBUG ]; then
echo "[$NOW] $HOSTNAME:$TESTNAME -->
$FOO_ALL:$NCO_NOTIFY" >> $LOG fi
;;
bar)
BAR_NODES=`grep "BAR-Nodes:" $FNAME | awk '{print $2}'`
if [ "$BAR_NODES" = "" ]
then
BAR_NODES="U"
fi
BAR_INTS=`grep "BAR-Interfaces:" $FNAME | awk '{print
$2}'`
if [ "$BAR_INTS" = "" ]
then
BAR_INTS="U"
fi
BAR_CONN=`grep "BAR-Connections:" $FNAME | awk '{print
$2}'`
if [ "$BAR_CONN" = "" ]
then
BAR_CONN="U"
fi
# Print BAR dataset definitions
echo "DS:Nodes:GAUGE:600:0:U"
echo "DS:Interfaces:GAUGE:600:0:U"
echo "DS:Connections:GAUGE:600:0:U"
echo "bar.rrd"
echo "$BAR_NODES:$BAR_INTS:$BAR_CONN"
# Log message
if [ $DEBUG ]; then
echo "[$NOW] $HOSTNAME:$TESTNAME -->
$BAR_NODES:$BAR_INTS:$BAR_CONN" >> $LOG fi
;;
*)
echo "[$NOW] $HOSTNAME:$TESTNAME not implemented" >>
$LOG ;;
esac
#echo "[$NOW] $MYNAME completed." >> $LOG
exit 0
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 9:33 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'm askin' the wrong questions, i just realized.
For custom test Foo which has Custom Script Foo.sh, which is a clientside script living in ~/client/ext;
assuming all other .cfg acrobatics have been accomplished, where on the server am i going to find the raw $host.foo data/numbers for me to parse and pass on?
I understand i can maybe copy someone else's macro for it, but i need to see what the raw data looks like so i know what i'm parsing :D.
tia,
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
iD8DBQFFN4yUBvBcJFK6xYURAs85AJoC6DdhUaYMNwch0IEi1YxjB/CM/ACfWlRq dagJRNkDMOJlDjpaVnLEe/M= =2g9/ -----END PGP SIGNATURE-----
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hubbard, Greg L wrote:
Hey Rob,
What is being passed is all the text you so carefully sent in your client-side text. That is why it is important to "pitch" what you can "catch."
OH, so, you know how to craft your greps and awks based on the MSG you are sending from the client, is that it? I don't need to find and examine that passed data, because i can see its structure based on the $MSG i am sending at the end of the client script. Right?
(please don't laugh at my code):
shyeah, like i'm qualified to do so.
case $TESTNAME in
foo) # Snag each foo data line FOO_ALL=`grep "FOO_Events:" $FNAME | awk '{print $3}'`
this is where i was getting conf00zed. I was wondering what psychic powers you people were employing to know how to pick out what you wanted blindly :).
# Print out RRD Foo Dataset definitions echo "DS:Events:GAUGE:600:0:U" echo "DS:Notifications:GAUGE:600:0:U" echo "foo.rrd" echo "$FOO_ALL:$FOO_NOTIFY"
and this i'll just have to look up to make sure of.
Thank you! I think it's starting to coalesce in my congealed brain...
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 9:33 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
I'm askin' the wrong questions, i just realized.
For custom test Foo which has Custom Script Foo.sh, which is a clientside script living in ~/client/ext;
assuming all other .cfg acrobatics have been accomplished, where on the server am i going to find the raw $host.foo data/numbers for me to parse and pass on?
I understand i can maybe copy someone else's macro for it, but i need to see what the raw data looks like so i know what i'm parsing :D.
tia,
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
iD8DBQFFN5ZnBvBcJFK6xYURAoAsAJ9RcsbnlCxv6hvxh9X3faafQ3pJmQCcDIKO QrAIouK6rFoiE2bBA15wlU4= =2WEU -----END PGP SIGNATURE-----
You got it, big man -- just remember to "pitch" what you know you can "catch". Since the catcher script KNOWS which test it is parsing, you can be as sloppy as you want.
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 10:15 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hubbard, Greg L wrote:
Hey Rob,
What is being passed is all the text you so carefully sent in your client-side text. That is why it is important to "pitch" what you can
"catch."
OH, so, you know how to craft your greps and awks based on the MSG you are sending from the client, is that it? I don't need to find and examine that passed data, because i can see its structure based on the $MSG i am sending at the end of the client script. Right?
(please don't laugh at my code):
shyeah, like i'm qualified to do so.
case $TESTNAME in
foo) # Snag each foo data line FOO_ALL=`grep "FOO_Events:" $FNAME | awk '{print $3}'`
this is where i was getting conf00zed. I was wondering what psychic powers you people were employing to know how to pick out what you wanted blindly :).
# Print out RRD Foo Dataset definitions echo "DS:Events:GAUGE:600:0:U" echo "DS:Notifications:GAUGE:600:0:U" echo "foo.rrd" echo "$FOO_ALL:$FOO_NOTIFY"
and this i'll just have to look up to make sure of.
Thank you! I think it's starting to coalesce in my congealed brain...
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 9:33 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
I'm askin' the wrong questions, i just realized.
For custom test Foo which has Custom Script Foo.sh, which is a clientside script living in ~/client/ext;
assuming all other .cfg acrobatics have been accomplished, where on the server am i going to find the raw $host.foo data/numbers for me to
parse and pass on?
I understand i can maybe copy someone else's macro for it, but i need to see what the raw data looks like so i know what i'm parsing :D.
tia,
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
iD8DBQFFN5ZnBvBcJFK6xYURAoAsAJ9RcsbnlCxv6hvxh9X3faafQ3pJmQCcDIKO QrAIouK6rFoiE2bBA15wlU4= =2WEU -----END PGP SIGNATURE-----
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I am completely clueless. OK, sanity check requested. According to existing docs on the site, i made the following changes, but all i get on the graph page is
hobbit graph ncv:cputemp
Now, if my data was bad, i'd have a blank graph, one where all the values show as "nan." I'm not even getting that, so i am back even further than i thought. I have...
in hobbitlaunch.cfg
[cputemp] ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg CMD $BBHOME/ext/cputemp.sh LOGFILE $BBSERVERLOGS/cputemp.log INTERVAL 1m
in hobbitgraph.cg
[cputemp] TITLE CPU Temp YAXIS Degrees Fahrenheit DEF:cputemp=cputemp.rrd:cputemp:AVERAGE LINE2:cputemp#00CC00:CPU Temp GPRINT:cputemp:LAST:Cpu Temperature \: %5.11f%s (cur) GPRINT:cputemp:MAX: \: %5.1lf%s (max) GPRINT:cputemp:MIN: \: %5.1lf%s (min) GPRINT:cputemp:AVERAGE: \: %5.1lf%s (avg)\n
in hobbitserver.cfg
TEST2RRD="cpu=la,disk,inode,qtree,...,bind,cputemp=ncv" and GRAPHS="ncv,la,disk,...,bbproxy,hobbitd,cputemp" and NCV_cputemp="cputemp:GAUGE"
TIA. I have a feeling the key is something in here. somewhere. somehow.
Hubbard, Greg L wrote:
You got it, big man -- just remember to "pitch" what you know you can "catch". Since the catcher script KNOWS which test it is parsing, you can be as sloppy as you want.
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 10:15 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
Hubbard, Greg L wrote:
Hey Rob,
What is being passed is all the text you so carefully sent in your client-side text. That is why it is important to "pitch" what you can
"catch."
OH, so, you know how to craft your greps and awks based on the MSG you are sending from the client, is that it? I don't need to find and examine that passed data, because i can see its structure based on the $MSG i am sending at the end of the client script. Right?
(please don't laugh at my code):
shyeah, like i'm qualified to do so.
case $TESTNAME in
foo) # Snag each foo data lineFOO_ALL=`grep "FOO_Events:" $FNAME | awk '{print $3}'`this is where i was getting conf00zed. I was wondering what psychic powers you people were employing to know how to pick out what you wanted blindly :).
# Print out RRD Foo Dataset definitionsecho "DS:Events:GAUGE:600:0:U" echo "DS:Notifications:GAUGE:600:0:U" echo "foo.rrd" echo "$FOO_ALL:$FOO_NOTIFY"and this i'll just have to look up to make sure of.
Thank you! I think it's starting to coalesce in my congealed brain...
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 9:33 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
I'm askin' the wrong questions, i just realized.
For custom test Foo which has Custom Script Foo.sh, which is a clientside script living in ~/client/ext;
assuming all other .cfg acrobatics have been accomplished, where on the server am i going to find the raw $host.foo data/numbers for me to
parse and pass on?
I understand i can maybe copy someone else's macro for it, but i need to see what the raw data looks like so i know what i'm parsing :D.
tia,
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
iD8DBQFFN5zaBvBcJFK6xYURArenAJ0SIqG44vJBrRSXa3a11iTkRrDW7QCfRo4f 4+ZfwrLvZTSWEKVT9jsPAwE= =PQNm -----END PGP SIGNATURE-----
Yes, you are using the NCV method, instead of the explicit "pitcher/catcher" method. Which do you want to use?
If you use NCV, the Hobbit server will make a valiant attempt to pick out your data from the text of your message, but only if it is in the proper format. This is a can of worms I quickly threw overboard when I started adding my own custom tests.
If you bind a column (text) to NCV, the custom parser script will not be called.
Look in the NCV section of the hobbitd_rrd man page to see how the data needs to look. You need to make sure that your are sending "cputemp : <number>" or "cputemp = <number>" somewhere in your status message. Or maybe it has to be "cputemp:<number>" or "cputemp: <number>" -- see why I never got it to work? The documentation is hazy about whether or not spaces are required, and which combinations will be okay or not. This is why I quit trying and went for the use-my-own-sledgehammer approach.
GLH
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 10:42 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I am completely clueless. OK, sanity check requested. According to existing docs on the site, i made the following changes, but all i get on the graph page is
hobbit graph ncv:cputemp
Now, if my data was bad, i'd have a blank graph, one where all the values show as "nan." I'm not even getting that, so i am back even further than i thought. I have...
in hobbitlaunch.cfg
[cputemp] ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg CMD $BBHOME/ext/cputemp.sh LOGFILE $BBSERVERLOGS/cputemp.log INTERVAL 1m
in hobbitgraph.cg
[cputemp] TITLE CPU Temp YAXIS Degrees Fahrenheit DEF:cputemp=cputemp.rrd:cputemp:AVERAGE LINE2:cputemp#00CC00:CPU Temp GPRINT:cputemp:LAST:Cpu Temperature \: %5.11f%s (cur) GPRINT:cputemp:MAX: \: %5.1lf%s (max) GPRINT:cputemp:MIN: \: %5.1lf%s (min) GPRINT:cputemp:AVERAGE: \: %5.1lf%s (avg)\n
in hobbitserver.cfg
TEST2RRD="cpu=la,disk,inode,qtree,...,bind,cputemp=ncv" and GRAPHS="ncv,la,disk,...,bbproxy,hobbitd,cputemp" and NCV_cputemp="cputemp:GAUGE"
TIA. I have a feeling the key is something in here. somewhere. somehow.
Hubbard, Greg L wrote:
You got it, big man -- just remember to "pitch" what you know you can "catch". Since the catcher script KNOWS which test it is parsing, you
can be as sloppy as you want.
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 10:15 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
Hubbard, Greg L wrote:
Hey Rob,
What is being passed is all the text you so carefully sent in your client-side text. That is why it is important to "pitch" what you can
"catch."
OH, so, you know how to craft your greps and awks based on the MSG you
are sending from the client, is that it? I don't need to find and examine that passed data, because i can see its structure based on the
$MSG i am sending at the end of the client script. Right?
(please don't laugh at my code):
shyeah, like i'm qualified to do so.
case $TESTNAME in
foo) # Snag each foo data lineFOO_ALL=`grep "FOO_Events:" $FNAME | awk '{print$3}'`
this is where i was getting conf00zed. I was wondering what psychic powers you people were employing to know how to pick out what you wanted blindly :).
# Print out RRD Foo Dataset definitionsecho "DS:Events:GAUGE:600:0:U" echo "DS:Notifications:GAUGE:600:0:U" echo "foo.rrd" echo "$FOO_ALL:$FOO_NOTIFY"and this i'll just have to look up to make sure of.
Thank you! I think it's starting to coalesce in my congealed brain...
-----Original Message----- From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] Sent: Thursday, October 19, 2006 9:33 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Sending data from script to an rrd
I'm askin' the wrong questions, i just realized.
For custom test Foo which has Custom Script Foo.sh, which is a clientside script living in ~/client/ext;
assuming all other .cfg acrobatics have been accomplished, where on the server am i going to find the raw $host.foo data/numbers for me to
parse and pass on?
I understand i can maybe copy someone else's macro for it, but i need
to see what the raw data looks like so i know what i'm parsing :D.
tia,
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
iD8DBQFFN5zaBvBcJFK6xYURArenAJ0SIqG44vJBrRSXa3a11iTkRrDW7QCfRo4f 4+ZfwrLvZTSWEKVT9jsPAwE= =PQNm -----END PGP SIGNATURE-----
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
participants (4)
-
greg.hubbard@eds.com
-
rmunsch@solutionsforprogress.com
-
rsmrcina@wi.rr.com
-
Thomas.Kern@hq.doe.gov