Hi Team,
I would like to know if there is a way to build an alert that only fires when the CPU has never dropped below 20% for over a certain period of time. I’m not looking for an alert about CPU utilization being at 100%. What I would like to know is if there is a monitor that will inform me if the CPU has been no less than 20% busy over the course of 4 hours. Both the 20% and the 4 hours are base values that should be easily changed.
NagiosXi CPU performance
-
dwasswa
Re: NagiosXi CPU performance
I want to know for both cases. (Windows and Linux) @dwasswa
-
dwasswa
Re: NagiosXi CPU performance
Have you used the check_cpu plugin before?
There is one for windows that runs as a system command through NSClient and NRPE.
There is one for windows that runs as a system command through NSClient and NRPE.
Re: NagiosXi CPU performance
I checked check_cpu plugin , it shows us the CPU idle % , how can i configure to check when CPU is not being utilized not more that 20% for last 4 hours ..?
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: NagiosXi CPU performance
@madhu2852, You can achieve what you're looking for by setting a custom check notification settings for the CPU service check.
1) You install the check_cpu plugin and add a warning argument of 20%.
2)When you go to the checks settings you need to define:
a)check_interval thats how often your cpu is going to be checked if everything is OK
b)Retry interval. If XI determines that your cpu load is above 20% it will try again X amount of times before it actually sends you an email. So you can define X by specifying check_attempts.
c) And finally, you need to specify a retry interval. Since you want to have this problem for 4 hours straight before notification, i'd set a retry interval to maybe 30 min?
So retry_interval in minutes(say 30 min) multiply by max_check attempts(say 8) = 240 min (thats 4 hours)
That means if CPU check gets above 20% xi will wait for 30 min, check it again. If the CPU is above 20% still it will wait another 30 min to check it. It'll do it for 8 times. And only after the 8th time it will send you the email.
Hope this makes sense.
1) You install the check_cpu plugin and add a warning argument of 20%.
2)When you go to the checks settings you need to define:
a)check_interval thats how often your cpu is going to be checked if everything is OK
b)Retry interval. If XI determines that your cpu load is above 20% it will try again X amount of times before it actually sends you an email. So you can define X by specifying check_attempts.
c) And finally, you need to specify a retry interval. Since you want to have this problem for 4 hours straight before notification, i'd set a retry interval to maybe 30 min?
So retry_interval in minutes(say 30 min) multiply by max_check attempts(say 8) = 240 min (thats 4 hours)
That means if CPU check gets above 20% xi will wait for 30 min, check it again. If the CPU is above 20% still it will wait another 30 min to check it. It'll do it for 8 times. And only after the 8th time it will send you the email.
Hope this makes sense.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: NagiosXi CPU performance
Can we configure similar check using check_ncpa..? Something like below..? The only difference i see is that the way we configure check_interval settings..
./check_ncpa.py -H <Host> -t '<your token>' -M 'cpu/percent' -q 'aggregate=avg'
./check_ncpa.py -H <Host> -t '<your token>' -M 'cpu/percent' -q 'aggregate=avg'
Re: NagiosXi CPU performance
One thing to note, most plugins only check the current state of whatever you are checking.
They cannot store the performance data for the checks that ran for over the last 4 hours and if the CPU load was below a certain percentage, generate an alert.
For example, you set the check to run every 10 minutes for example, you check it and the CPU usage is at 50%, Then 10 seconds later, the CPU usage drops to 10% and stays that way for over 9 minutes and then rises back to 50%.
Then the plugin runs again and see that it is at 50%. But in truth, the average between the checks is lower than 50%.
The shortest interval Nagios can run a check is 1 minute, and if you want to to generate an alert after 240 minutes, you would set the check interval to 1 minute, the retry interval to 1 minute and the max check attempts to 240.
That way, after 240 checks that are below your threshold, would send an email notification.
If you want to use the NCPA plugin and generate a critical alert for less that 20%, you would use this example.
If the check finds the utilization to be below 20% every minute for 240 minutes, that would put the check in to a hard down state and send an email if it is configured to do so.
If any of the checks go above 20%, it will reset the check and start over.
They cannot store the performance data for the checks that ran for over the last 4 hours and if the CPU load was below a certain percentage, generate an alert.
For example, you set the check to run every 10 minutes for example, you check it and the CPU usage is at 50%, Then 10 seconds later, the CPU usage drops to 10% and stays that way for over 9 minutes and then rises back to 50%.
Then the plugin runs again and see that it is at 50%. But in truth, the average between the checks is lower than 50%.
The shortest interval Nagios can run a check is 1 minute, and if you want to to generate an alert after 240 minutes, you would set the check interval to 1 minute, the retry interval to 1 minute and the max check attempts to 240.
That way, after 240 checks that are below your threshold, would send an email notification.
If you want to use the NCPA plugin and generate a critical alert for less that 20%, you would use this example.
Code: Select all
./check_ncpa.py -H <Host> -t '<your token>' -M 'cpu/percent' -q 'aggregate=avg' -c 20:If any of the checks go above 20%, it will reset the check and start over.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NagiosXi CPU performance
yeah thanks for the response. I'm aware of this but wanted to check with you before communicating to my team . Thanks for the help.
-
dwasswa
Re: NagiosXi CPU performance
@ madhu2852 ,
Please us know how everything goes and feel free to ask us any questions.
Please us know how everything goes and feel free to ask us any questions.