New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


monitor memory usage of a process on linux box

Votes:

0

Your Vote:

Up

Down

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

centos memory process

Created on Feb 12, 2014 11:55:19 AM by  spoonerd (0) 1



3 Replies

Votes:

0

Your Vote:

Up

Down

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

Created on Feb 12, 2014 1:04:26 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

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

Created on Feb 12, 2014 3:05:35 PM by  spoonerd (0) 1



Votes:

0

Your Vote:

Up

Down

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

Created on Feb 13, 2014 11:49:33 AM by  Konstantin Wolff [Paessler Support]

Last change on Feb 13, 2014 11:49:46 AM by  Konstantin Wolff [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.