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?
Need to capture cpu utilization with top process
-
lanxessinfy
- Posts: 68
- Joined: Tue Nov 24, 2020 5:55 am
-
lanxessinfy
- Posts: 68
- Joined: Tue Nov 24, 2020 5:55 am
Re: Need to capture cpu utilization with top process
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"
}
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
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. 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
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. 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
You do not have the required permissions to view the files attached to this post.
-
lanxessinfy
- Posts: 68
- Joined: Tue Nov 24, 2020 5:55 am
Re: Need to capture cpu utilization with top process
Hi Vinh,
Thanks much
Thanks much
Re: Need to capture cpu utilization with top process
Great!! .... may I close this thread? ... 
-
lanxessinfy
- Posts: 68
- Joined: Tue Nov 24, 2020 5:55 am
Re: Need to capture cpu utilization with top process
Yes please.
Thanks.
Thanks.
Re: Need to capture cpu utilization with top process
Locking thread!! ... 