Page 1 of 1

top process monitoring

Posted: Wed Aug 01, 2018 1:54 am
by progressive.nagiosXI
Hi Team,

How can we monitor top process usage in any host, as we are only able to get CPU or memory utilization detail but not getting which process is consuming this?

Re: top process monitoring

Posted: Wed Aug 01, 2018 10:10 am
by lmiltchev
What kind of system are you monitoring - Windows, Linux, etc.? Have you searched for a suitable plugin on the Nagios Exchange?

https://exchange.nagios.org/

On Windows machines, your best bet would be to use a powershell script, that you could call from Nagios XI via NCPA or NRPE (with NSClient++).

Re: top process monitoring

Posted: Thu Aug 02, 2018 2:27 am
by progressive.nagiosXI
we are using both Windows, Linux,

We have searched but have not found any plugin which gives data about which process is taking most resources.

Could you please give us one or two plugins which can give the data.

Re: top process monitoring

Posted: Thu Aug 02, 2018 10:01 am
by lmiltchev
There are some plugins here that you could use to monitor CPU/Memory for a process:

https://exchange.nagios.org/index.php?o ... cess%20cpu

Some are for Windows, some - for Linux. There are 2 pages. We cannot recommend one over another. Sorry. These are 3rd party plugins and haven't been tested by us. I would recommend that you take some time toy them out before making a decision on which one to use.

Let us know if you get stuck on something.

Re: top process monitoring

Posted: Fri Aug 03, 2018 4:37 am
by progressive.nagiosXI
how can we get top process data via NCPA Agent, kindly share any appropriate plugins for same.

Re: top process monitoring

Posted: Fri Aug 03, 2018 9:52 am
by lmiltchev
Currently, you cannot get a CPU/Memory usage for a specific Windows process via NCPA natively. This functionality will be added in the future.

For the time being, you could use a custom, e.g. PS script to achieve your goal.

Example:

I downloaded this script from the Nagios Exchange - https://exchange.nagios.org/directory/P ... 29/details and placed it in the "C:\Program Files (x86)\Nagios\NCPA\plugins" directory.

Next, I ran the script via check_ncpa.py:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t mytoken -P 5693 -M 'plugins/resourcecheck.ps1' -a COMPUTERNAME 1 2 1 2
CRITICAL: Memory is 31% used. svchost is using the most resources, its PID is 1056. | Memory=31%;;;0
Note: You can use a different (better) script. This is just an example.

Re: top process monitoring

Posted: Sun Aug 05, 2018 6:27 pm
@progressive.nagiosXI
As for linux: please see the Process Resources section @ https://support.nagios.com/kb/article/p ... _resources
You can run check_procs as plugin on the server that runs NCPA. Please use verbosity level (-v) to see what process(es) exceed your thresholds. Observe this example for CPU (pcpu) usage that finds out both yum and python exceeded the given thresholds.

Code: Select all

# /usr/local/nagios/libexec/check_ncpa.py -H centos-rpi3 -t mytoken -M 'plugins/check_procs' -q 'args=-w 40 -c 90 --metric=CPU -v'
CPU WARNING: 2 warn out of 145 processes [yum, python] | procs=145;;;0; procs_warn=2;;;0; procs_crit=0;;;0;

Re: top process monitoring

Posted: Mon Aug 06, 2018 8:35 am
by lmiltchev
Thanks @[email protected]!

@progressive.nagiosXI, let us know if you have any more questions.