[hobbit] File status information in client-data

Henrik Stoerner henrik at hswn.dk
Tue Nov 14 09:30:19 CET 2006


On Mon, Nov 13, 2006 at 11:41:35PM -0500, Kern, Thomas wrote:
> Now comes the twist in this. Rich and I are building a hobbit client for
> a NON-Linux platform, so whatever code that reads hobbit-clients.cfg and
> determines the rules, doesn't run on our platform. We have to figure out
> how to completely mimic the data flow to the server. 
> 
> So if a linux server has a hobbit-client.cfg that has a file entry for
> /var/log/special and we only care that the file exists, what does the
> client-data stream need to contain in the [file:/var/log/special]
> section that will signal a hobbit server to mark this as a Yellow
> condition? The size and modification date might be other conditions that
> people will want to check on our platform.

You should take a look at the printfiledata() routine in
client/logfetch.c - this is where those [file:/foo/bar.baz] data are
generated.

However, that is only part of the picture. What you want to do is really
to build a more-or-less complete Hobbit client message. This begins with
a line that identifies the OS the message is from (see the
~client/tmp/msg.HOSTNAME.txt file on any Hobbit client); this in turn
determines how the data are processed by hobbitd_client. The catch here
is that if your OS name is not recognized, then no processing is done -
even though part of the message might be formatted just like another OS.

So to get your data recognized by Hobbit, you must add the OS to those
recognized, and write a back-end module for hobbitd_client that picks up
those parts of the client message you want to process and sends them
through Hobbit's built-in routines that match the data against the
hobbit-clients.cfg configuration settings. It's not a whole lot of code;
you can copy one of the existing files in the hobbitd/client/ directory,
and use it more or less unchanged for your OS. Then a couple of lines
must be added in hobbitd/hobbitd_client.c to call your new OS module,
and in lib/misc.c to recognize the OS name. I'll be happy to help you
with those bits if you need assistance.


Regards,
Henrik





More information about the Xymon mailing list