Xymon Mailing List Archive search

Suggestion: monitor CPU utilization by process

4 messages in this thread

list Glauber Ribeiro · Mon, 28 Aug 2017 21:10:59 +0000 ·
Currently we can monitor for presence of certain processes in the "ps" listing, under the "procs" test and configured in analysis.cfg.

It would be nice to be able to monitor also on CPU utilization. E.g.: "process db2sysc taking more than 90% of the CPU"


glauber ribeiro
list Paul Root · Mon, 28 Aug 2017 22:27:17 +0000 ·
I wrote an external script that monitors percentage of memory a process uses. That helped us track apps with memory leaks.

It's just a matter of parsing the ps output.
quoted from Glauber Ribeiro

From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Ribeiro, Glauber
Sent: Monday, August 28, 2017 4:11 PM
To: xymon at xymon.com
Subject: [Xymon] Suggestion: monitor CPU utilization by process

Currently we can monitor for presence of certain processes in the "ps" listing, under the "procs" test and configured in analysis.cfg.

It would be nice to be able to monitor also on CPU utilization. E.g.: "process db2sysc taking more than 90% of the CPU"


glauber ribeiro

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.
list Jeremy Laidman · Tue, 29 Aug 2017 15:42:13 +1000 ·
xymon-procmem (on Xymonton.org) is a server-side script that does this for
per-process memory usage. I imagine it would be fairly simple to
modify/extend this to support CPU usage.


On 29 August 2017 at 07:10, Ribeiro, Glauber <user-59d088777028@xymon.invalid>
quoted from Paul Root
wrote:
Currently we can monitor for presence of certain processes in the “ps”
listing, under the “procs” test and configured in analysis.cfg.


It would be nice to be able to monitor also on CPU utilization. E.g.:
“process db2sysc taking more than 90% of the CPU”


glauber ribeiro

list Glauber Ribeiro · Wed, 30 Aug 2017 21:20:20 +0000 ·
I created a server-side extension that gets the "ps" information from the client data (already available), parses it, etc. I thought I was set, but it turns out that ps reports the percentage of CPU utilization over the lifetime of the process. This makes it useless for monitoring CPU utilization by long-running processes, because the data becomes flat.

At the moment I'm running
tprof -x sleep 60
on the client side, then sending over the output (using the client/local mechanism). Then, my server-side program (which I had already written) obtains the information from the server using a "xymon clientlog" call, and parses it. (If I didn't have the server-side part already written, I probably would have run it entirely on the client side, for simplicity.) I also use "NCV" to generate a graph on the server.

The information obtained this way is the percentage of CPU utilization by the top processes during the time interval sampled (1 minute, since I'm running "sleep 60"). It parallels much better what one can get, for example from "topas". If this were Linux, I might have used "top" instead of "tprof", but AIX's version ("topas") is for interactive use only. And "tprof" allows me to vary the length of the sampling interval. I have a feeling that 60 seconds is too much; 30 or 15 should be enough.

This seems to be working. I'll know better after a few days. The graph is a very valuable tool for validating this kind of stuff.
g
quoted from Jeremy Laidman

From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Ribeiro, Glauber
Sent: Monday, August 28, 2017 16:11
To: xymon at xymon.com
Subject: [Xymon] Suggestion: monitor CPU utilization by process

Currently we can monitor for presence of certain processes in the "ps" listing, under the "procs" test and configured in analysis.cfg.

It would be nice to be able to monitor also on CPU utilization. E.g.: "process db2sysc taking more than 90% of the CPU"


glauber ribeiro