[Xymon] execute shell command on xymon clients

Jeremy Laidman jlaidman at rebel-it.com.au
Fri Mar 14 23:28:05 CET 2014


On 4 March 2014 07:59, deepak deore <deepakdeore2004 at gmail.com> wrote:

> Is it possible to execute command on xymon clients and it will give reply/
> results to the server.
>

One way to do this is to create a pseudo-file entry in client-local.cfg.
 It gets really ugly if you want to do complicated stuff, but for a simple
check it can be very effective, and painless to roll out.  The purpose of
using backticks in a file clause is to allow dynamic filename generation,
such as when you need to monitor a file but the filename changes over time.
 However, we can (ab)use this feature for our own purposes.  Xymon just
wants the output, but if we generate no output, Xymon will silently ignore
it, and so we can do whatever else we want.  As a bonus, the Xymon client
will have already setup the environment for us to do things like sending a
status report to the Xymon server.

For example:

file:`( echo "client/xymonversion $MACHINE.$OSTYPE"; echo
"[clientversion]"; $XYMON --version ) | $XYMON $XYMSRV @ >/dev/null`

If I assign this to a server in client-local.cfg, it will execute the
commands within backticks, and as there's no final output, Xymon will
ignore it as a filename.  What this does is create a [clientversion]
section in a client message that shows the client version so that it shows
up in the host's "info" page.

The only constraints on what you can do with pseudo-files is that you can't
use colons or backticks.  There are ways to work around these limitations.

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140315/22dd3061/attachment.html>


More information about the Xymon mailing list