Thank you!   I think I originally saw the client-local trick in a Solaris iostat script.  This one turned out simple enough to warrant posting as an example.<div><br></div><div>Ralph Mitchell<br><br><br><div class="gmail_quote">
On Sat, Dec 3, 2011 at 2:30 PM, Xymon User in Richmond <span dir="ltr"><<a href="mailto:hobbit@epperson.homelinux.net">hobbit@epperson.homelinux.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Neatly done.  And the script is easily adaptable to use grubby if you want<br>
to check for the condition I mentioned instead of maintaining a cfg file<br>
for checking a specified version.<br>
<div class="HOEnZb"><div class="h5"><br>
On Sat, December 3, 2011 13:57, Ralph Mitchell wrote:<br>
> Just out of curiousity I fooled around with this a bit last night.  Seems<br>
> easy enough to implement as an external test, if you're OK with having an<br>
> extra column show up.  Or maybe make a combo with something else, though<br>
> I've never tried that at all.<br>
><br>
> ========== client side:  /home/xymon/client/ext/osver.sh ==========<br>
><br>
> #!/bin/bash<br>
><br>
> # column name to report<br>
> TEST="osver"<br>
><br>
> # our current os version<br>
> CURVER=`uname -r`<br>
><br>
> # the logfetch cfg file is filled by xymonclient.sh<br>
> LOGFETCH=${XYMONTMP}/logfetch.$(uname -n).cfg<br>
><br>
> # Default to OK<br>
> COLOR=green<br>
> MESSAGE="No OS version specified in client-local.cfg.  OS version is:<br>
> $CURVER"<br>
><br>
> # anything interesting for us?<br>
> if [ -f "$LOGFETCH" ]; then<br>
>   OSVER=`grep "^OSVER:" $LOGFETCH | cut -d":" -f2`<br>
>   if [ "$OSVER" ]; then<br>
>     # found OSVER in the cfg<br>
>     if [ "$CURVER" = "$OSVER" ]; then<br>
>       COLOR=green<br>
>       MESSAGE="OS version is correct: $OSVER"<br>
>     else<br>
>       # report mismatch<br>
>       COLOR=yellow<br>
>       MESSAGE="OS version is incorrect.  $CURVER should be $OSVER"<br>
>     fi<br>
>   fi<br>
> fi<br>
><br>
> $XYMON $XYMSRV "status $MACHINE.$TEST $COLOR `date`<br>
><br>
> $MESSAGE"<br>
><br>
> exit 0<br>
><br>
> ========= client side: /home/xymon/client/etc/clientlaunch.cfg ==========<br>
><br>
> [osver]<br>
> ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg<br>
> CMD $XYMONCLIENTHOME/ext/osver.sh<br>
> LOGFILE $XYMONCLIENTLOGS/osver.log<br>
> INTERVAL 5m<br>
><br>
><br>
> ========== server side: /home/xymon/server/etc/client-local.cfg ==========<br>
><br>
> [linux]<br>
> OSVER:2.6.32-131.21.1.el6.x86_64<br>
><br>
><br>
> Obviously you would append the above line to any system-specific<br>
> client-local.cfg entries.<br>
><br>
> The same approach works for *any* config value that you might want to pass<br>
> from the server to the clients for client/ext scripts.  I imagine there<br>
> are<br>
> probably some limitations on what special characters can be passed, but<br>
> simple name/value pairs ought to be just fine.<br>
><br>
> Ralph Mitchell<br>
><br>
><br>
> On Fri, Dec 2, 2011 at 5:58 PM, Xymon User in Richmond <<br>
> <a href="mailto:hobbit@epperson.homelinux.net">hobbit@epperson.homelinux.net</a>> wrote:<br>
><br>
>> On Fri, December 2, 2011 14:48, McGraw, Robert P wrote:<br>
>> > Xymon's "info" column for a host already reports<br>
>> > the uname -r value. For example, on hardy, the<br>
>> > info page shows<br>
>> ><br>
>> > OS: Linux <a href="http://hardy.math.purdue.edu" target="_blank">hardy.math.purdue.edu</a> 2.6.18-274.7.1.el5xen x86_64<br>
>> ><br>
>> > Question: is Xymon able to let us specify<br>
>> > somewhere (client-local.cfg maybe?) what<br>
>> > the current kernel version *should* be,<br>
>> > so that when the current kernel is<br>
>> > supposed to be 2.6.18-274.7.1 then we<br>
>> > can have the info column go yellow or<br>
>> > red for hosts that haven't been booted to<br>
>> > that version yet?<br>
>> ><br>
>><br>
>> If what you're after is essentially running kernel doesn't match kernel<br>
>> that will run on next boot, should be a fairly trivial ext script to<br>
>> compare contents of uname -r to grubby --default-kernel|sed<br>
>> "s/\/boot\/vmlinuz-//".  That would be how to do it on Red Hat, looks<br>
>> like<br>
>> you'd also have to massage uname -r for hardy.<br>
>><br>
>> Don't know if it's already been done.<br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Xymon mailing list<br>
>> <a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
>> <a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
>><br>
><br>
<br>
<br>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
</div></div></blockquote></div><br></div>