Page 2 of 2
Re: Need to capture cpu utilization with top process
Posted: Fri Jun 25, 2021 4:03 am
by lanxessinfy
Hi Vinh,
We have a requirement that
1st as Warning - exceeds 90% for prolonged period of 10-15mins
2nd as Critical - at 98% for prolonged period of 10-15mins.
Is it possible?
Re: Need to capture cpu utilization with top process
Posted: Fri Jun 25, 2021 4:06 am
by lanxessinfy
This is the script we have now
Try {
$Threshold1 = 98
$Threshold2 = 90
$CpuLoad = (Get-WmiObject win32_processor | Measure-Object -property LoadPercentage -Average | Select Average ).Average
IF($CpuLoad -gt $Threshold1) {
Write-Output (Get-Process | Sort -Descending CPU | Select -First 5 | Format-Table -HideTableHeaders);exit 2
}elseif($CpuLoad -gt $Threshold2) {
Write-Output (Get-Process | Sort -Descending CPU | Select -First 5 | Format-Table -HideTableHeaders);exit 1
} Else {
Write-Host "CPU load is" $CpuLoad "%"
}
}
Catch {
Write-Host "Script Check Failed"
}
Re: Need to capture cpu utilization with top process
Posted: Fri Jun 25, 2021 2:15 pm
by vtrac
Hi,
Hope you are having a good day!!
There is not a way to prolong the to 15 min after issue has been identified.
The solution would be to change the "Check Settings" of the service as shown in the picture.
F1.png
Looking at the picture, service check interval every 5 minutes, when issue is identified, XI will check every 3 minutes for up to 5 times (total 15 minutes) before sending out notifications.
Best Regards,
Vinh
Re: Need to capture cpu utilization with top process
Posted: Mon Jun 28, 2021 8:59 am
by lanxessinfy
Hi Vinh,
Thanks much
Re: Need to capture cpu utilization with top process
Posted: Mon Jun 28, 2021 10:40 am
by vtrac
Great!! .... may I close this thread? ...

Re: Need to capture cpu utilization with top process
Posted: Mon Jun 28, 2021 11:00 am
by lanxessinfy
Yes please.
Thanks.
Re: Need to capture cpu utilization with top process
Posted: Mon Jun 28, 2021 11:21 am
by vtrac
Locking thread!! ...
