Page 1 of 2

CPU 100% alerts

Posted: Wed Sep 23, 2015 8:56 am
by angus
I have virtual servers that contain multiple cores that represent the CPU. If one core hits 100% then an alarm goes off. Can i combine all the cores and average out the CPU power to make the alerts more representative to the actual issue? Please see image.

Re: CPU 100% alerts

Posted: Wed Sep 23, 2015 10:43 am
by tgriep
Can you post the current check that you are using and which OS and version the virtual server is running?

Re: CPU 100% alerts

Posted: Wed Sep 23, 2015 2:48 pm
by angus
COMMAND: /usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -t 'XXXXXXXXX' -P 5693 -M cpu/percent
OUTPUT: OK: percent was 1%,0%,100%,0%,0%,0%,0%,0% | 'percent_0'=1%;;; 'percent_1'=0%;;; 'percent_2'=100%;;; 'percent_3'=0%;;; 'percent_4'=0%;;; 'percent_5'=0%;;; 'percent_6'=0%;;; 'percent_7'=0%;;;

Re: CPU 100% alerts

Posted: Wed Sep 23, 2015 2:51 pm
by angus
Windows server 2008 sp2 x64

Re: CPU 100% alerts

Posted: Wed Sep 23, 2015 4:04 pm
by tmcdonald
What NCPA and plugin versions are you using? Depending on your version, you might have the aggregation function available:

https://github.com/NagiosEnterprises/nc ... t-97501818

Re: CPU 100% alerts

Posted: Wed Sep 23, 2015 4:45 pm
by tgriep
I confirmed that you have to upgrade to the latest NCPA software on the windows host and also the plugin on the XI system
You can get is here.
https://assets.nagios.com/downloads/ncp ... on-windows

After updating both, you would define your command like below. That will aggregate and average the check for you.

Code: Select all

 /usr/local/nagios/libexec/check_ncpa.py -H 192.168.1.1 -t ncpapass -P 5693 -M cpu/percent -q aggregate=avg

Re: CPU 100% alerts

Posted: Thu Sep 24, 2015 7:07 am
by angus
Will i have to upgrade the plugin for every host i am monitoring with NCPA?

Re: CPU 100% alerts

Posted: Thu Sep 24, 2015 9:17 am
by tmcdonald
The plugin resides on the Nagios XI machine, so you will only need to upgrade that once, however the agent running on the Windows machine will need to be updated on any that you want aggregation for.

Re: CPU 100% alerts

Posted: Thu Sep 24, 2015 10:07 am
by angus
I am on NCPA 1.8.1, is that not the latest version?

Below is the result to the aggregate=avg tag. I switched the -Q from your command to an -A.

./check_ncpa.py -H X.X.X.X -t XXXXXX -P 5693 -M cpu/percent -a aggregate=avg
OK: percent was 0%,0%,0%,0%,100%,0%,0%,100%,100%,0%,0%,0% | 'percent_0'=0%;;; 'percent_1'=0%;;; 'percent_2'=0%;;; 'percent_3'=0%;;; 'percent_4'=100%;;; 'percent_5'=0%;;; 'percent_6'=0%;;; 'percent_7'=100%;;; 'percent_8'=100%;;; 'percent_9'=0%;;; 'percent_10'=0%;;; 'percent_11'=0%;;;

Re: CPU 100% alerts

Posted: Thu Sep 24, 2015 12:36 pm
by tgriep
NCPA 1.8.1 is the latest version for the client but if the -q argument doesn't work, you will need to update the plugin on the Nagios XI system.
You can download it at this link and then upload it to the XI system and the -q argument should work for you.
https://raw.github.com/NagiosEnterprise ... ck_ncpa.py