top process monitoring

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
progressive.nagiosXI
Posts: 277
Joined: Mon Jul 31, 2017 5:54 am

top process monitoring

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: top process monitoring

Post 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++).
Be sure to check out our Knowledgebase for helpful articles and solutions!
progressive.nagiosXI
Posts: 277
Joined: Mon Jul 31, 2017 5:54 am

Re: top process monitoring

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: top process monitoring

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
progressive.nagiosXI
Posts: 277
Joined: Mon Jul 31, 2017 5:54 am

Re: top process monitoring

Post by progressive.nagiosXI »

how can we get top process data via NCPA Agent, kindly share any appropriate plugins for same.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: top process monitoring

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
[email protected]
Posts: 68
Joined: Wed Dec 27, 2017 2:20 pm
Location: Nieuwegein, The Netherlands
Contact:

Re: top process monitoring

Post by [email protected] »

@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;
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: top process monitoring

Post by lmiltchev »

Thanks @[email protected]!

@progressive.nagiosXI, let us know if you have any more questions.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked