Xymon Mailing List Archive search

Central configuration hobbitd_client and extended testing

3 messages in this thread

list Phil Wild · Tue, 8 Apr 2008 12:07:59 +0800 ·
Hi Hobbit users,

Up until recently, we have been using the bigbrother client on all our hosts
reporting through to hobbit (legacy configuration post migration to hobbit).

This is now changing and I really like the central processing that happens
with hobbitd_client.

I have just been looking through the man pages and have also been scouring
the mailing list but have not found what I am looking for.

If I want to convert some of my existing tests (which do all the processing
on the client and then send the green,yellow,red messages to hobbit) over to
the way hobbitd_client seems to work with collecting just the required data
and processing centrally, how do I go about doing this?

What I want to achieve is a central configuration for all of the custom
tests? Can the hobbit-clients.cfg file be extended for further tests or
would this break the configuration?

Many thanks

Phil
list Henrik Størner · Tue, 8 Apr 2008 12:51:30 +0200 ·
quoted from Phil Wild
On Tue, Apr 08, 2008 at 12:07:59PM +0800, Phil Wild wrote:
[...] I really like the central processing that happens
with hobbitd_client.

If I want to convert some of my existing tests (which do all the processing
on the client and then send the green,yellow,red messages to hobbit) over to
the way hobbitd_client seems to work with collecting just the required data
and processing centrally, how do I go about doing this?

What I want to achieve is a central configuration for all of the custom
tests? Can the hobbit-clients.cfg file be extended for further tests or
would this break the configuration?

There are (at least) three ways of doing this.

Solution one: Put the configuration file for your custom script into 
the ~hobbit/server/etc/ directory. Then modify the client script
to run 
   $BB $BBDISP "config MYCONFIGFILE.cfg" >myconfig.cfg
to pickup the configuration file from the Hobbit server.


Solution two: This applies if you just want to have a few config-
parameters for your custom test that you can control from the Hobbit
server. In that case, you can add these to client-local.cfg (with 
some custom prefix to separate them from the other entries); this file
is automatically transferred to the clients, so your custom script
can then grab the configuration data from
~hobbit/client/tmp/logfetch.HOSTNAME.cfg .

1 and 2 is usually fairly easy to do, because you don't have to
think too much about changing how your custom test works - you just
pick up the configuration details from somewhere else, and leave the
rest of the script as-is. The downside is that you're still analysing
the data on each client, so if you want to add some new analysis to
the data, you must update all of the clients.


The third solution is to have your custom script on the clients
just do the data collection - using whatever tools are needed on the
client - and then send them to the Hobbit server. Either as part of the
normal client data (to do this, modify the
~hobbit/client/bin/hobbiclient-OS.sh script), or in a separate
message that you send with

   $BB $BBDISP "usermsg $MACHINE.mydata

   <... the data that you've collected ...>
   "

Then on the Hobbit server, you must write a program - in Perl,
Shell, C, C++, Java, ... whatever language you fancy. This program
is fed the client data via standard-input; your program must
then do the analysis and act upon the result: This could be by
generating a new status that it sends to the Hobbit server.

There's a sample script in the Hobbit snapshot -
hobbid/hobbitd_rootlogin.pl - showing how this can be done.

Note that the "usermsg" command is not part of the original 
Hobbit 4.2.0 release, but it is included with the "allinone"
patch available at http://www.hobbitmon.com/hobbitsw/patches/


Regards,
Henrik
list Phil Wild · Tue, 8 Apr 2008 21:00:40 +0800 ·
Thanks Henrik,

I am currently running the all_in_one patch. It is good to know about the
usermsg message type.

I think I will have a go at getting solution3 up and running. We are already
feeding data into custom perl scripts at the backend to create rrd files our
oracle tablespaces so it would be pretty easy to extend that to also do the
testing for free space.

Can we setup our own section in hobbit-clients.cfg for our own test (keeping
the format the same but with different tests etc) for our own purposes or
would this break something?

Cheers

Phil

2008/4/8 Henrik Stoerner <user-ce4a2c883f75@xymon.invalid>:
quoted from Phil Wild
On Tue, Apr 08, 2008 at 12:07:59PM +0800, Phil Wild wrote:
[...] I really like the central processing that happens
with hobbitd_client.

If I want to convert some of my existing tests (which do all the
processing
on the client and then send the green,yellow,red messages to hobbit)
over to
the way hobbitd_client seems to work with collecting just the required
data
and processing centrally, how do I go about doing this?

What I want to achieve is a central configuration for all of the custom
tests? Can the hobbit-clients.cfg file be extended for further tests or
would this break the configuration?

There are (at least) three ways of doing this.

Solution one: Put the configuration file for your custom script into
the ~hobbit/server/etc/ directory. Then modify the client script
to run
  $BB $BBDISP "config MYCONFIGFILE.cfg" >myconfig.cfg
to pickup the configuration file from the Hobbit server.


Solution two: This applies if you just want to have a few config-
parameters for your custom test that you can control from the Hobbit
server. In that case, you can add these to client-local.cfg (with
some custom prefix to separate them from the other entries); this file
is automatically transferred to the clients, so your custom script
can then grab the configuration data from
~hobbit/client/tmp/logfetch.HOSTNAME.cfg .

1 and 2 is usually fairly easy to do, because you don't have to
think too much about changing how your custom test works - you just
pick up the configuration details from somewhere else, and leave the
rest of the script as-is. The downside is that you're still analysing
the data on each client, so if you want to add some new analysis to
the data, you must update all of the clients.


The third solution is to have your custom script on the clients
just do the data collection - using whatever tools are needed on the
client - and then send them to the Hobbit server. Either as part of the
normal client data (to do this, modify the
~hobbit/client/bin/hobbiclient-OS.sh script), or in a separate
message that you send with

  $BB $BBDISP "usermsg $MACHINE.mydata

  <... the data that you've collected ...>
  "

Then on the Hobbit server, you must write a program - in Perl,
Shell, C, C++, Java, ... whatever language you fancy. This program
is fed the client data via standard-input; your program must
then do the analysis and act upon the result: This could be by
generating a new status that it sends to the Hobbit server.

There's a sample script in the Hobbit snapshot -
hobbid/hobbitd_rootlogin.pl - showing how this can be done.

Note that the "usermsg" command is not part of the original
Hobbit 4.2.0 release, but it is included with the "allinone"
patch available at http://www.hobbitmon.com/hobbitsw/patches/


Regards,
Henrik

-- 

Tel: XXXX XXX XXX
Fax: XXXX XXX XXX
email: user-e365c1418192@xymon.invalid