Need to capture cpu utilization with top process

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
lanxessinfy
Posts: 68
Joined: Tue Nov 24, 2020 5:55 am

Re: Need to capture cpu utilization with top process

Post 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?
lanxessinfy
Posts: 68
Joined: Tue Nov 24, 2020 5:55 am

Re: Need to capture cpu utilization with top process

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

Re: Need to capture cpu utilization with top process

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

Post by lanxessinfy »

Hi Vinh,

Thanks much
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Need to capture cpu utilization with top process

Post by vtrac »

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

Post by lanxessinfy »

Yes please.

Thanks.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Need to capture cpu utilization with top process

Post by vtrac »

Locking thread!! ... :-)
Locked