[Xymon] question

Root, Paul T Paul.Root at CenturyLink.com
Thu Jun 2 15:00:29 CEST 2016


I wrote a perl script that reads the output of ps, and checks the size of (%mem) of processes defined in a config file. That config file, sets alert levels for yellow and red.  Then run that from cron. It would be pretty easy to run from ext as well.


From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Jeremy Laidman
Sent: Thursday, June 02, 2016 5:01 AM
To: m.pingel at ndr.de; xymon at xymon.com
Subject: Re: [Xymon] question

On Mon, May 30, 2016 at 10:52 PM <m.pingel at ndr.de<mailto: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

This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20160602/428b69da/attachment.html>


More information about the Xymon mailing list