I'v been searching for this for quiet some time but haven't found a real sollution yet.I have monitor sets running which generate an alert when de CPU is above 90%.I am looking for a script i can run when this happends and capture the top processes with %CPU usages.
SNMP Device: N/AMonitor Set: Server PrestatiesType: CounterLog Object Name: CPUAgent Alarm Time: 17:24:02 17-Feb-15Event Time: 16:24:02 17-Feb-15 UTCLog Value: 100Alarm Operator: OverAlarm Threshold: 90 % Processor TimeAlarm Duration: 1 Minute(s)
Output of the script
ImageName PID Threads Priority CPU Owner Idle 0 4 0 11 Error 0x6 : De ingang is ongeldig. System 4 167 8 0 Error 0x6 : De ingang is ongeldig. smss.exe 400 2 11 0 NT AUTHORITY\SYSTEM csrss.exe 544 9 13 0 NT AUTHORITY\SYSTEM wininit.exe 620 3 13 0 NT AUTHORITY\SYSTEM csrss.exe 648 15 13 0 NT AUTHORITY\SYSTEM services.exe 680 6 9 0 NT AUTHORITY\SYSTEM lsass.exe 704 7 9 0 NT AUTHORITY\SYSTEM lsm.exe 716 9 8 0 NT AUTHORITY\SYSTEM winlogon.exe 808 3 13 0 NT AUTHORITY\SYSTEM svchost.exe 868 10 8 0 NT AUTHORITY\SYSTEM
Ps. I have tried some tools like":
But none give me the correct results. Process.exe does actualy come close but the % CPU is not correct.
Try this . IT's the Agent procedure plus to vbs files to get top 10 CPU and top 10 Mem users
You'll also need to edit the script and remove or disable the last 2 lines as they delete the files you actually need.
So add a step before them to get the file content as a variable etc , or just delete them