[hobbit] Appending tests to client data
Henrik Stoerner
henrik at hswn.dk
Tue Aug 21 16:49:36 CEST 2007
On Tue, Aug 21, 2007 at 01:40:54PM +0100, Jones, Jason (Altrincham) wrote:
> I asked this question before but got a mixed response. If I wanted to
> add an additional test to the client data received by hobbit from a
> client machine with the intention of writing a server side module to
> produce a status message (the way the core hobbit tests do) how would I
> go about sending the data from the client to the server?
>
> I have looked at the man pages for bb and I think it's the data "stream"
> i.e:
>
> $BBHOME/bin/bb <Server IP> "data foo,bar,com.test\n This is a test"
>
> But after running this nothing appears on the server - have I
> misunderstood?
There are really 3 different ways you can feed information into Hobbit.
1) "status" message.
The simplest one - the client determines everything, including the
color of the status, and sends all of it to the Hobbit server. There
is no server-side processing of the status, it just goes on the web
display (and triggers alerts, stores graph data etc.)
2) "data" message.
Similar to "status", but it doesn't generate a status column item on
the webpage. This data is just copied to the server-side modules that
are fed from the "data" channel; they can then do whatever they like
with the data, including some analysis that ends up generating a
"status" column. But in itself, the data you send in a "data" message
does nothing on the Hobbit server.
This is currently used for some of the standard data that Hobbit
tracks, like "vmstat" which doesn't have a status column but which
does get analysed and stored in graphs.
3) "client" message.
A special kind of "data" message generated by the Hobbit clients.
You really shouldn't generate this kind of message from a script;
if you must, then I'd recommend adding it to the hobbit-client's
bin/hobbitclient-OSNAME.sh script. The reason is that the server-
side module handling "client" messages assumes that certain parts
of the client-data is always present, so if you feed it a message
with only your custom bits then things might break.
So you're on the right track, I think, with your custom "data" message.
You just need to come up with a small server-side script to grab the
message off the Hobbit "data" channel on the server. Try running (on the
Hobbit server, logged in as the "hobbit" user)
bbcmd hobbitd_channel --channel=data cat
and then fire off the command on the client that sends your test-data;
you should then see it dumped to the screen on your Hobbit server.
Regards,
Henrik
More information about the Xymon
mailing list