[Xymon] question

Jeremy Laidman jlaidman at rebel-it.com.au
Thu Jun 2 12:01:09 CEST 2016


On Mon, May 30, 2016 at 10:52 PM <m.pingel at ndr.de> wrote:

> is it possible to configure a maximum level of memory from a process?
>

Let me rephrase to make sure I understand.  You want to monitor the memory
usage of a process (by name, presumably) and if it exceeds a predefined
threshold, you would like it to change colour?

This is not really possible out-of-the-box.

However, there are ways to do this.  The xymon client data message contains
the "ps" section to list all running processes.  Generally, this includes
memory usage for each process.  So the Xymon server has the data for it to
use.

Example:
https://www.xymon.org/xymon-cgi/svcstatus.sh?CLIENT=claudio.hswn.dk&section=ps

Note that there are several columns you might be interested in here.  An
absolute MB of memory is shown in the resident size (RZ) and virtual size
(VZ), but also the percentage of memory (%MEM).  So, step one is to decide
what you're interested in, perhaps based on what problem you're trying to
detect.

If you wanted to alert on client data, you could write a server-side task
to query every device and do the thresholding.  You could either create a
new test such as "procmem", or you could modify the state of the "proc"
test.  Here's a scriptlet that would probably (untested) do the latter:

#!/bin/sh
PROCMATCH="/usr/sbin/ntpd" # should fetch per-host with hostinfo or
xymongrep
$XYMON $XYMSRV "xymondboard test=proc fields=hostname,client" | grep ",Y$"
| while read LINE; do
    HN=`IFS="|"; set - $LINE; echo $1`
    PS=`$XYMON $XYMSRV "clientlog $HN section=ps" | grep "$PROCMATCH"`
    # parse PS for the appripriate column and generate a "modify" message
for the "prox" status
done

Sorry, I don't have access to a Xymon server to test this with just now.

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20160602/eed30716/attachment.html>


More information about the Xymon mailing list