[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] Central configuration hobbitd_client and extended testing
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] Central configuration hobbitd_client and extended testing
- From: Henrik Stoerner <henrik (at) hswn.dk>
- Date: Tue, 8 Apr 2008 12:51:30 +0200
- References: <258e9b160804072107k39354443p854b60760b8c371c (at) mail.gmail.com>
- User-agent: Mutt/1.5.15+20070412 (2007-04-11)
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