<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 4 March 2014 07:59, deepak deore <span dir="ltr"><<a href="mailto:deepakdeore2004@gmail.com" target="_blank">deepakdeore2004@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Is it possible to execute command on xymon clients and it will give reply/ results to the server.</div>

</div></blockquote><div><br></div><div>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.</div>

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

<div><br></div><div>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.</div>

<div><br></div><div>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.</div><div><br></div><div>J</div><div><br></div>

</div></div></div>