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

Henrik Stoerner henrik at hswn.dk
Sun Jan 28 13:47:49 CET 2007


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rootlogin.pl
Type: text/x-perl
Size: 3833 bytes
Desc: not available
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20070128/571d7128/attachment.pl>


More information about the Xymon mailing list