Hi

PRTG newbie here so please forgive my ignorance. We are running V13.4.6

I have an appliance that run centos linux. We have been trying to debug some issues with it and the support company has asked us to track the memory usage of a particular processes and alarm when it reaches a certain limit.

There are multiple processes running that all have the same name. For example from ps auxfww | grep kosch
.msu

root 24967 0.5 1.7 2309836 138208 ? Ss Feb04 7:23 /opt/kosch/ddi/bin/kosch.msu root 24974 4.4 21.9 2825356 1732336 ? S Feb04 57:49 \_ /opt/kosch/ddi/bin/kosch.msu root 24975 10.3 32.2 4122764 2551088 ? R Feb04 133:28 \_ /opt/kosch/ddi/bin/kosch.msu root 24976 8.5 26.2 3320268 2075736 ? S Feb04 110:51 \_ /opt/kosch/ddi/bin/kosch.msu root 24977 20.8 25.1 3676364 1985600 ? S Feb04 268:32 \_ /opt/kosch/ddi/bin/kosch.msu

How can I setup a sensor to monitor these processes and then warn me when the memory reaches a certain threshold for each individual process?

Thanks


Article Comments

Hi,
the way to go here would be an SSH Script (Advanced) sensor which is executing a script which parses the memory usage from the command output. The command executed might look something like the following:

ps auxfww |grep 3339 | awk -F" " '{ print $4 }'

(Note: Some adjustments might be necessary. :))
3339 used above would be the PID which I used for greping. The output in order for PRTG pick the same up should be in the following format:

exitcode:value:message

In your case, as you need the script for documentation purposes, you might just use 0 as exit code every time. If you are using the Advanced sensor mentioned above the output would be in XML as outlined in the documentation.
Best regards


Feb, 2014 - Permalink

Hi

Thank you for the reply.

When I SSH to test the command I run this.

root@devbox1:~# ps auxfww |grep 18256 | awk -F" " '{ print $5 }' 10404 2194512 root@devbox1:~#

and it seems to give two values. I know the second value is VSZ column but what is the first as from what I understand the above command is only supposed to show the 5th column?

Thanks


Feb, 2014 - Permalink

Hi,
could you try to grep for the process name and then post the full output without piping the same to awk?


Feb, 2014 - Permalink