<div dir="ltr">On 23 August 2013 20:52, Andrey Chervonets <span dir="ltr"><<a href="mailto:A.Chervonets@cominder.eu" target="_blank">A.Chervonets@cominder.eu</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<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"><font face="sans-serif">Version can be easy detected at client
side like with </font>
<br><font face="sans-serif">cmd:</font>
<br><font face="sans-serif">         echo
`hostname`:`./xymon  2>&1 | grep "version"`</font>
<br><font face="sans-serif">out: </font>
<br><font face="sans-serif">        realhostname:Xymon
version 4.3.5</font>
<br></blockquote><div><br></div><div>You can also do "xymon --version". </div><div><br></div><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">

<font face="sans-serif">so we just need to loop through all
hosts and execute such call.</font>
<br>
<br><font face="sans-serif">But this is quite inconvenient (most
target hosts will not have passwordless ssh connection setup).</font>
<br></blockquote><div><br></div><div>You can do this automatically with a pseudo-file test in client-local.cfg.  More on this below.</div><div> </div><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">

<font face="sans-serif">May be XyMon developers can implement
new metric test  "xymonver" which, depending on settings
will show in web UI:</font>
<br><font face="sans-serif">a) just version of xymon client installed</font>
<br></blockquote><div><br></div><div>This is available in the "info" status page, under "Client S/W".  It is extracted by xymond from the [clientversion] section in the client message.  In most installations, this isn't actually working, because it's part of the automated client update process, although you should see it on your Xymon server.  But it can be added by doing some tweaks on the client side, either creating an entry in clientlaunch.cfg, or updating the xymonclient.sh script to get its value of CLIENTVERSION from `$XYMON --version` instead of the output of "clientupdate --level").  It can also be simulated using the pseudo-file test I mentioned, and I prefer this because it requires no adjustments on the client side.</div>

<div> </div><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"><font face="sans-serif">b) red, yellow or green depending on
how old version is instaled compared with </font>
<br><font face="sans-serif">        *
xymon server version</font>
<br><font face="sans-serif">        *
or maximum version detected in all target servers</font>
<br></blockquote><div><br></div><div>This could be a useful feature.  Although for some people, it's acceptable to be behind one or two releases, rather than every client having exactly the same version.  This could be implemented entirely server-side, as log as the client is reporting its version in the client message.</div>

<div><br></div><div>The client update feature is facilitated by setting a client version string in client-local.cfg.  So this version could be extracted and used to compare the current version against the expected version, and warning when it does not match.</div>

<div> </div><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"><font face="sans-serif">If this is too complex, may be add client
version to "info" repost like this is done for OS?</font>
<br></blockquote><div><br></div><div>To add the client version into "info" (via the client message), add the following pseudo-file definition to the client-local.cfg file into a suitable location in the file:</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>After 10 minutes or so, the client will start running the command in backticks, attempting to get a dynamic filename to monitor.  It always shows nothing so no additional file gets monitored.  But the side-effect of running the command is to create a client message that populates the [clientversion] section of the client data, with the output of "xymon --version".  Once it runs, you should see something useful in the [clientversion] section, and as a result, the "info" status page for the server should start showing the client version string.</div>

<div><br></div><div>Note that this requires that Xymond support collector IDs (the bit after the "client/" text - in this case "xymonversion" is the collector ID).  This was introduced in Xymon version 4.3.0-beta3, when the "bb" binary changed name to "xymon".  If your server is newer than this, you should be OK to use this method.</div>

<div><br></div><div>Once you're getting the version number, you could turn it into an alarm with a bit of scripting on the server side, getting the current version with a "clientlog" message and the required version from client-local.cfg with a dummy client message.  Something like this (mostly untested):</div>

<div><br></div><div>#!/bin/sh</div><div>[ "$XYMON" -a "$XYMSRV" -a "$MACHINE" ] || { echo "Run via xymoncmd or xymonlaunch">&2; exit 1; }</div><div>REQVER=`$XYMON $XYMSRV "client/dummy $MACHINE.$SERVEROSTYPE $CONFIGCLASS" | sed -n '/^clientversion:/s/^clientversion://p'`</div>

<div>CURVER=`$XYMON $XYMSRV "clientlog $MACHINE section=clientversion"|sed -n '/^Xymon version/s/^Xymon version //p'`</div><div>if [ "$REQVER" = "" -o "$CURVER" = "" ]; then</div>

<div>  $XYMON $XYMSRV "status $MACHINE.ver clear Unable to get either current version [$CURVER] or required version [$REQVER] of client"</div><div>elif [ "$REQVER" = "$CURVER" ]; then</div><div>

  $XYMON $XYMSRV "status $MACHINE.ver green Client version $CURVER"</div><div>else</div><div>  $XYMON $XYMSRV "status $MACHINE.ver red Client version $CURVER does not match $REQVER"</div><div>fi<br></div>

<div><br></div><div>Cheers</div><div>Jeremy</div><div><br></div></div></div></div>