[Xymon] Is there a way to get DISK analysis.cfg functionality for a custom test?

Jeremy Laidman jlaidman at rebel-it.com.au
Tue Oct 2 06:28:28 CEST 2012


On 29 September 2012 10:09, Betsy Schwartz <betsy.schwartz at gmail.com> wrote:

> Is there a way I can write my custom test to take advantage of all the
> built-in capabilities?
>

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.

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.

 Would it make sense to write a script that mimics
> /home/xymon/client/bin/xymonclient-<os>.sh and kick the results to
> xymonclient somehow?


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.

For example, this should do it for you:

xymoncmd xymon 127.0.0.1 "client server,name,with,commas.linux linux
[date]
`date`
[df]
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/device1 1024000 50000 1019000 1% /"

And if so how? Is there a good generic "os" to
> use?


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.

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.

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.


> Will xymon fall over and cry when I don't have all the sorts of
> information that xymonclient usually has?
>

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.

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.

Cheers
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20121002/0c53f291/attachment.html>


More information about the Xymon mailing list