On 29 September 2012 10:09, Betsy Schwartz <span dir="ltr"><<a href="mailto:betsy.schwartz@gmail.com" target="_blank">betsy.schwartz@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Is there a way I can write my custom test to take advantage of all the<br>
built-in capabilities?<br></blockquote><div><br></div><div>Devmon can do it.  We use devmon to collect disk (and other) usage from appliances, using SNMP.  Devmon then feeds the details into Xymon by sending status messages for the "disk" test.  I get graphs (RRD files) and I'm guessing I would see disk usage alerts the same as regular devices.</div>

<div><br></div><div>If you're already using devmon, you could enable SNMP on the servers and solve the problem that way.  But possibly overkill if you don't have devmon running already.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

 Would it make sense to write a script that mimics<br>
/home/xymon/client/bin/xymonclient-<os>.sh and kick the results to<br>
xymonclient somehow?</blockquote><div><br></div><div>This is doable.  My "xymon-rclient" script effectively does this.  After getting the disk info, it gets injected into Xymon as client data (using a "data" message with a special format).  If all you want is disk data, you can probably just create a client message with a "[df]" stanza, with the format replicated from a real host's client data.</div>

<div><br></div><div>For example, this should do it for you:</div><div><br></div><div>xymoncmd xymon 127.0.0.1 "client server,name,with,commas.linux linux</div><div>[date]</div><div>`date`</div><div>[df]</div><div>Filesystem 1024-blocks Used Available Capacity Mounted on</div>

<div>/dev/device1 1024000 50000 1019000 1% /"</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And if so how? Is there a good generic "os" to<br>


use?</blockquote><div><br></div><div>Note that if you use "status" messages (like devmon does) you either need to handle the colour/status yourself, or create a "DS" definition to analyse your RRD files.  Instead, using properly formatted "client" messages means that xymond_client will handle this for you.</div>

<div><br></div><div>Most appliance devices are Linux, so that might be appropriate.  It doesn't matter very much, as long as the format of the client message matches the OS.  Apart from the common OSes (linux, irix, darwin, solaris, aix, openbsd, etc) there are some other interesting ones that you could use as appropriate: snmpcollect, powershell, win32_bbwin.  If you use an OS that Xymon doesn't know about, it will silently ignore the client message.</div>

<div><br></div><div>Note that if you plan on adding metrics for other resources, some of the OS handlers support more than others.  The Solaris processor handles 19 different client stanzas, second is AIX and FreeBSD with 17, then SCO with 16.  Linux, Windows and OpenBSD all support 15 different stanzas in the client data.  Most of the extra stanzas in Solaris (prtconf, iostatdisk) are probably too OS-specific to be useful to you.  The extra stanzas in some OSes are consolidated in other OSes, and so they give the same result.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Will xymon fall over and cry when I don't have all the sorts of<br>
information that xymonclient usually has?<br></blockquote><div><br></div><div>Generally, if it doesn't find it, it won't try to use it.  For example, the unix_disk_report() function call silently returns if there is no "[df]" stanza in the client data, and it appears that the corresponding code for memory, procs and netstat all do the same.  I can't say for certain that you can get by with only the "[df]" stanza, but it's worth a shot, and I'd be surprised if it didn't work.</div>

<div><br></div><div>If you don't have the [date] stanza, it has nothing to put into the status messages for the tests, so it's probably good (and trivial) to include that.</div><div><br></div><div>Cheers</div><div>

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