Customizing top (CPU/Memory) processes to record output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Customizing top (CPU/Memory) processes to record output

Post 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 %
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

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

Post 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
Locked