Xymon Mailing List Archive search

Sample of Hobbit server-side module (was: Who Test)

list Henrik Størner
Sun, 28 Jan 2007 13:47:49 +0100
Message-Id: <user-3a0e2af62385@xymon.invalid>

On Sat, Jan 27, 2007 at 09:29:12AM +0100, Henrik Stoerner wrote:
On Fri, Jan 26, 2007 at 05:51:49PM -0600, Richard Leon wrote:
I have noticed that the client collects all of the data and then the server
"tests" the condition.

How would I go about writing a who script that would tell me when someone is
logged in as root?
For someone familiar with Perl, I think it should be fairly straight-forward.
I'm not familiar with Perl at all, but a couple of hours work produced
this, which appears to work fine. I'll include it as a sample of how to
hook into the Hobbit server-side channels.

To use it, put it in your ~hobbit/server/ext/ directory, and add this to
your hobbitlaunch.cfg on your server:

[rootlogin]
	ENVFILE /usr/lib/hobbit/server/etc/hobbitserver.cfg
	NEEDS hobbitd
	CMD hobbitd_channel --channel=client --log=$BBSERVERLOGS/rootlogin.log $BBHOME/ext/rootlogin.pl


Regards,
Henrik
Attachments (1)