[Xymon] Client script using BB variables?

John Horne john.horne at plymouth.ac.uk
Tue May 15 17:25:00 CEST 2012


On Tue, 2012-05-15 at 14:57 +0200, Henrik Størner wrote:
> On 15-05-2012 14:08, John Horne wrote:
> > Using Xymon 4.3.7, I am trying to install a BB client script onto a
> > Xymon client. However, the script uses some variables which no longer
> > seem to be available in Xymon. It uses the BBHOSTS and MACHINE
> > variables.
> 
> MACHINE is defined - it is setup by the "runclient.sh" script which is 
> used to start the Xymon client.
> 
Yup, thanks just noticed that. However, I think using the 'CLIENT:'
option in hosts.cfg will do what I want (as a way of providing an alias
name for a client).

> BBHOSTS is not set, since that should not be used by a client script - 
> it is only available on the Xymon server. I don't recall if the BB 
> clients required a bb-hosts file to be present on the client side...
> 
> > The problem is basically that the client needs to look up its name in
> > the hosts.cfg file.
> 
> Why the heck would it need to do that ? I mean, surely it knows who 
> itself is.
> 
Yes, it knows how it is, but doesn't know what options have been
provided for the test. E.g use of '!' to reverse the test result. This
is only in the hosts.cfg file, and the test may well be reversed on some
clients, but not others. However, looking through things we can actually
dispense with this since none of the clients now reverse this test. If
we need it in the future, then I'll worry about it then.

As a side note, I am using the 'user' channel to send asynchronous
events back to the Xymon server (as well as from client scripts). This
basically, emulates what the 'TheState' BB addon did. Because the
channel is received on the server side, it can, therefore, easily see
the hosts.cfg file and any test options and alias names. TheState was
something which we used very much (and still do at the moment!), so I am
pleased that we seem to be able to do the same with Xymon.




John.

-- 
John Horne                   Tel: +44 (0)1752 587287
Plymouth University, UK      Fax: +44 (0)1752 587001



More information about the Xymon mailing list