[hobbit] Adding data to a client

Henrik Stoerner henrik at hswn.dk
Tue Oct 17 23:12:53 CEST 2006


On Tue, Oct 17, 2006 at 02:31:18PM -0400, Asif Iqbal wrote:
> I like to use `bb data hostname.serial<newline><the serial number>' to
> hobbit server. I do not want a column to be created. Then is it
> possible to query the serial number from within hobbit server using
> `bb query hostname.serial' just for the serial info?

Hobbit doesn't store information received in "data" messages. You'll
have to handle that yourself - but writing a "data" backend module isn't
all that difficult. Basically, you'll need to write a script that
handles input like what you'll get if you run this command on your
Hobbit server (as the hobbit user): 
  ~hobbit/server/bin/bbcmd hobbitd_channel --channel=data cat
It looks like this (this is from the "vmstat" data):

@@data#14769|1161119241.285339|127.0.0.1||client2.hswn.dk|vmstat
data client2,hswn,dk.vmstat
linux
 0  0   8316  84916  87264 1125020    0    0     0    69  468   682  3 1 96  0
@@

So: One line with the meta-info (timestamp, source IP, hostname,
dataname), and then all of the data sent in the "data" command.
The "@@" on a line by itself means "end-of-message".

Once your custom backend gets the data, it is up to you to figure out
some way of retriving it.


Another solution would be to include this in the Hobbit "client"
message. E.g. if you append this to the client message:

[serial]
1234567

then you can query it through the URL

http://hobbitserver/hobbit-cgi/bb-hostsvc.sh?CLIENT=myhost&SECTION=serial


> I don't want the data to expire. I guess I could test it myself. I
> dont want this data in the info column since it is suppose to be
> confidential due to support contract with SUN.

OK, the client data is visible to anyone - so for confidential data, it
is probably not a good idea.


Regards,
Henrik




More information about the Xymon mailing list