[hobbit] Sending data from script to an rrd

Rob Munsch rmunsch at solutionsforprogress.com
Wed Oct 18 22:54:44 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hubbard, Greg L wrote:
> Rob,

Hi greg.  thanks for your patience.

> The problem is that this is scattered across several different places in
> the Hobbit architecture.

and how XD

> 1. Detecting the numbers.  In a client-side (or server-side, though more
> rare) script, you do whatever you need to do to get some numbers.  You
> format these numbers and send them to Hobbit.  All Hobbit is looking for
> is the header line where you give it a color.  The rest is just text
> that Hobbit will faithfully store and repeat back to you as date under
> the column you have selected.  Knowing that only the first line is
> important, then you can do WHATEVER you want to show your numbers.
> Knowing that you will be parsing this text when you receive it, it is
> very helpful to put the data in a format that is easy to recognize and
> parse later, but is still readable to the human eye.

This i got...
> 
> Another note -- you need to do all of this on new columns -- don't try
> to augment the existing Hobbit tests.

...and did.  And works well.  I have a new CPUTemp column which shows
the "CPU Temp: X degrees Fahrenheit."  That was the easy part.

 > 2. On the Hobbit server, you write a custom parser script.  This script
> is called with three parameters -- the column name (aka test name), the
> node name associated with the test, and a file name.  What your script
> should do is branch appropriately according to the test name, and then
> read the file, parsing it as needed.  The script can be written in any
> language (Perl comes to mind if you don't like shell).  But keep in mind
> that there is ONLY ONE parsing script allowed, and it needs to be able
> to service all of your custom tests.

Oho.  I have NO new script on the server.  This part is what isn't
documented well i think... is it a copy of my client script?  Does it
pull from the data that the client script is sending to the server?
This what seems odd to me, the client is already sending the numbers i
need to generate the color status.  Why can't i use that??

> When you find the numbers you want for your test, you simply write to
> STDOUT the sequence that Hobbit is looking for to put your data in RRDS.

which is where those Echo commands came from, i see now.

> ANYTHING else that you want to say in your script needs to be directed
> to a log file, or some other place.
> 
> You have to tell the Hobbit server to use your script -- this requires
> modification of the hobbitlaunch file to change the parameter list for
> the hobbit_rrd modules.  Notice that there are two of them -- one for
> data, and one for status.

Did both of those.  They just aren't uh running anything atm XD

> 
> To debug: run your new test script by hand, supplying a bogus node name,

node name? :-/

> the name of the real test, and the name of a file.  I found it helpful
> to snag all of the test from the column detail and save it in a file,
> and then use that file as the file parameter.  All you should see come
> out of your script is the RRD language -- first the DS statements, then
> the file name, and finally the data record.  You can write it all to one
> RRD, or to several, depending on what you write out.
> 
> 3. Now that RRD's are being created, you have to go and create graph
> definitions in hobbit-graph.cfg 

This is also already done, since i thought i'd taken care of the rest.

 > Now you need to update the Hobbit server configuration to include your
> graphs in both lists -- TRENDS and TEST2RRD.  I could not keep things
> straight, so I ended up calling my graph definitions by the same name as
> my tests.  So for test "foo" I create a graph definition "foo" instead
> of "bar".

Done also.

> 
> To debug: First, are the RRD entries being created?  You should see them
> in the data directory underneath the name of the host where the
> client-side test is being run.
> 
> Next, is there data being written to the RRD?  You can dump the contents
> with RRDTool, but I forget the syntax.  All you are looking for is that
> your data is ending up in the right place.
> 
> Next, can you see your graphs?  If you don't see a graph at all on your
> test page, then you probably have not identified it correctly to the
> Hobbit server in the hobbitconfig.  If you see a broken link where you
> expect a graph, the problem is probably with your hobbitgraph.cfg file
> -- you made an error specifying the graph.

argh.  not done well, apparently... instead of what one would expect
with correct definitions - a nan or blank graph - i have simply

hobbit graph ncv:cputemp

where the graph should be.  In the absence of data, i should still have
a blank graph, if i defined it correctly, right?  So i messed that up.


> I have created 7 or 8 custom tests with graphs and everything.  The
> first one took several days, then I got a lot faster.

I shall continue to slug away.

> I wish I had time to be more exhaustive in the instructions...

Thank you for your time, this is starting to make sense to me now.

I still do not quite get how the actual data gets to rrd.  It seems to
me that there is an isolated client script that sends data which
determines the status color.. then a DIFFERENT server-side script is
used to send the SAME DATA to RRD for graphing.  ?!?! yesno?

Why isn't there a way to use the existing data that the client's sending
for graphing... for CPU, MEM, etc. isn't that already happening?  or
have i failed another concept here.

On the server, i have made all config changes (despite the badly-crafted
graph definition) but there is NO rrd data collected.  I still don't get
the client-server communication, i guess.

Does anyone have a sample of a server-side RRD data collection script i
could borrow, so i see how and where from it's grabbed?  Thanks...

> 
> Good luck!

i don't need luck, i need to stop being so thick... :)

> 
> GLH
> 
> 
> -----Original Message-----
> From: Rob Munsch [mailto:rmunsch at solutionsforprogress.com] 
> Sent: Wednesday, October 18, 2006 3:03 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:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Hubbard, Greg L wrote:
> 
>> Script #2: is executed by hobbitd_rdd via the --extra-script option.
>> This one extracts relevant information from the incoming status report
> 
>> and echoes out the RRD creation parameters, the RRD file name, and the
> 
>> data to stuff into the RRD.  Hobbit_rrd reads that and does what's 
>> necessary to save the data in an RRD.
> 
> maybe i'm not being clear.  It's been a long day...
> 
> I understand that the goal is to get data to RRD in a format it likes
> with data and filenames it understands.  That part is obvious.  The
> concept is not the issue; i know i want to graph things!
> 
> What is not obvious is where to warn hobbit that this info is coming and
> precisely how to send that info; "echo" clientside was, i thought, read
> by the client's hobbitd as in a wrapper, but i guess not..?
> 

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

iD8DBQFFNpSUBvBcJFK6xYURArUzAJ9l4tNis+OwO0PnLrhADh1NUgaCIgCeMwC8
7yWkzgJoIXM+BvxSmoxDFQA=
=/rmJ
-----END PGP SIGNATURE-----



More information about the Xymon mailing list