Page 1 of 2

Top 5 Memory n Cpu Consuming Process for windows via nsclie+

Posted: Mon Sep 11, 2017 8:22 am
by padu_3891
Hi Team,

I got a situation here to show the top 5/10 memory and cpu process when there is a alert . I tried event handler . But am unable to show it in nagios front end .

Please suggest an idea to get it done .

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Mon Sep 11, 2017 11:46 am
by dwasswa
Hi @ padu_3891,

Here is another topic on the forum where the same question was answered. see below...
https://support.nagios.com/forum/viewto ... =6&t=36530

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Mon Sep 11, 2017 12:00 pm
by tacolover101
the link @Derick mentioned is your best bet.

as for bringing it to a front end, that's something you would need to build, or possibly ingest these logs into a central log management place.

to add to this, you could also modify those powershell / bash scripts to make REST calls out to a place with the payload, or even add raw TCP/UDP sending to your favourite log collector.

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Mon Sep 11, 2017 12:57 pm
by dwhitfield
tacolover101 wrote:possibly ingest these logs into a central log management place.
If you go that route, let me suggest https://www.nagios.com/products/nagios-log-server/

Let us know if the suggestions above don't work for you.

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Wed Sep 13, 2017 11:10 am
by padu_3891
Am using nscliet ++ 0.4.1 version and i am unable to achive top 5 process with that .
Still i am looking for a solution.

can anyone help on this .

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Wed Sep 13, 2017 2:41 pm
by scottwilkerson
Did you try what was suggested by @dwassa above? In that thread it walks through the creation of a custom script you would need and adding the script to NSClient

https://support.nagios.com/forum/viewto ... =6&t=36530

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Tue Nov 07, 2017 6:38 am
by padu_3891
The link you provided you is for monitoring linux clients . But i am looking Windows .

Since the suggestion is to have awrapper script going to writa a wrapper script for the same .

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Tue Nov 07, 2017 3:46 pm
by dwasswa
Hi @padu_3891,

If you go back to viewtopic.php?f=6&t=36530 that @scottwilkerson suggested, you will find it walks you through what you are asking.

I strongly suggest that you follow that thread carefully up to page 2.

Please go back and follow the steps in that thread and let us know if you have any questions.

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Tue Nov 07, 2017 4:03 pm
by mcapra
The link provided by @dwasswa and @scottwilkerson does indeed offer a Windows solution in the form of a Powershell script:

Code: Select all

date | Out-File "C:\Program Files\NSClient++\scripts\powershell\topcpu.txt" -append
Get-Process | Sort CPU | Select -last 10 | Out-File "C:\Program Files\NSClient++\scripts\powershell\topcpu.txt" -append
Though converting that output into something more Nagios friendly would be required.

Re: Top 5 Memory n Cpu Consuming Process for windows via nsc

Posted: Tue Nov 07, 2017 5:31 pm
by dwasswa
Thanks @mcapra.

@padu_3891, did you try what we suggested?