<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, May 30, 2016 at 10:52 PM <<a href="mailto:m.pingel@ndr.de">m.pingel@ndr.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2" face="sans-serif">is it possible to configure a maximum
level of memory from a process?</font>
<br></blockquote><div><br></div><div>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?</div><div><br></div><div>This is not really possible out-of-the-box.</div><div><br></div><div>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.</div><div><br></div><div>Example: <a href="https://www.xymon.org/xymon-cgi/svcstatus.sh?CLIENT=claudio.hswn.dk&section=ps">https://www.xymon.org/xymon-cgi/svcstatus.sh?CLIENT=claudio.hswn.dk&section=ps</a></div><div><br></div><div>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.</div><div><br></div><div><span style="line-height:1.5">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:</span><br></div><div><br></div><div>#!/bin/sh</div><div>PROCMATCH="/usr/sbin/ntpd" # should fetch per-host with hostinfo or xymongrep</div><div><span style="line-height:1.5">$XYMON $XYMSRV "xymondboard test=proc fields=hostname,client" | grep ",Y$" | while read LINE; do</span><br></div><div>    HN=`IFS="|"; set - $LINE; echo $1`</div><div>    PS=`$XYMON $XYMSRV "clientlog $HN section=ps" | grep "$PROCMATCH"`</div><div>    # parse PS for the appripriate column and generate a "modify" message for the "prox" status</div><div><span style="line-height:1.5">done</span><br></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">Sorry, I don't have access to a Xymon server to test this with just now.</span></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">J</span></div><div><span style="line-height:1.5"><br></span></div></div></div>