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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
padu_3891
Posts: 50
Joined: Thu Sep 05, 2013 10:12 pm

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

Post 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 .
dwasswa

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

Post 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
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

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

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

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

Post 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.
padu_3891
Posts: 50
Joined: Thu Sep 05, 2013 10:12 pm

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

Post 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 .
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
padu_3891
Posts: 50
Joined: Thu Sep 05, 2013 10:12 pm

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

Post 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 .
dwasswa

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

Post 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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post 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.
Former Nagios employee
https://www.mcapra.com/
dwasswa

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

Post by dwasswa »

Thanks @mcapra.

@padu_3891, did you try what we suggested?
Locked