Page 1 of 1

Customizing top (CPU/Memory) processes to record output

Posted: Wed Jun 16, 2021 9:30 am
by dlukinski
Please help with customizing top processes command to record its output when warning/critical thresholds are met

Processes Matched
PID: Name: Username: Exe: Memory: CPU
-----------------------------------
0: System Idle Process: NT AUTHORITY\\SYSTEM: 0.0 % (VMS 0.00 GB, RSS 0.00 GB): 82.14 %
9560: tomcat9.exe: RES\\siebelfs: 7.95 % (VMS 4.29 GB, RSS 3.42 GB): 4.82 %
10088: java.exe: NT AUTHORITY\\SYSTEM: 0.36 % (VMS 0.50 GB, RSS 0.15 GB): 5.06 %
20732: siebmtshmw.exe: RES\\siebelfs: 2.72 % (VMS 1.16 GB, RSS 1.17 GB): 2.23 %

Total Memory: 11.03 % (VMS 5.95 GB, RSS 4.74 GB)
Total CPU: 94.25 %

Re: Customizing top (CPU/Memory) processes to record output

Posted: Thu Jun 17, 2021 11:11 am
by vtrac
Hi,
How are you doing?

What command are you using today (please share)?

Please check Nagios Exchange page below, I'm sure you will find one that will fit your needs.
https://exchange.nagios.org/

Another solution you could try is to write a PowerShell script, then call its using either "check_nrpe" (need NSClient++) or "check_ncpa.py" (Need NCPA).

I'm not a PS programmer, so this is what I found on the web which will list top 5 CPU:

Code: Select all

Get-Process | Sort -Descending CPU | Select -First 5

Best Regards,
Vinh