CPU threshold service check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

CPU threshold service check

Post by rferebee »

Hello,

Is it possible to create a service check to monitor if CPU utilization drops below a certain percentage?

For example, the instances in my Log Server cluster typically run anywhere between 85-95% CPU utilization (all the time). Sometimes my environment will crash, but logstash and elasticsearch will still report that they are running. The only way I can tell that the environment is FUBAR is to look at the CPU utilization in vCenter and it will be under 40% for all instances.

I'd like to create a service check that will go Critical when the CPU utilization goes below 50% on my Log Servers.

Is that possible?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: CPU threshold service check

Post by lmiltchev »

It depends on the plugin that you are using. If the plugin is written in accordance with the Nagios Plugins Development Guidelines, you could use ":" after the warning and/or critical threshold.

Example:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -P 5693 -M cpu/percent -w 85 -c 95
OK: Percent was 12.50 %, 0.00 %, 9.40 %, 0.00 %, 3.10 %, 0.00 %, 12.50 %, 0.00 % | 'percent_0'=12.50%;85;95; 'percent_1'=0.00%;85;95; 'percent_2'=9.40%;85;95; 'percent_3'=0.00%;85;95; 'percent_4'=3.10%;85;95; 'percent_5'=0.00%;85;95; 'percent_6'=12.50%;85;95; 'percent_7'=0.00%;85;95;

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'mytoken' -P 5693 -M cpu/percent -w 95: -c 85:
CRITICAL: Percent was 9.10 %, 0.00 %, 6.30 %, 0.00 %, 0.00 %, 0.00 %, 0.00 %, 0.00 % | 'percent_0'=9.10%;95:;85:; 'percent_1'=0.00%;95:;85:; 'percent_2'=6.30%;95:;85:; 'percent_3'=0.00%;95:;85:; 'percent_4'=0.00%;95:;85:; 'percent_5'=0.00%;95:;85:; 'percent_6'=0.00%;95:;85:; 'percent_7'=0.00%;95:;85:;
Be sure to check out our Knowledgebase for helpful articles and solutions!
rferebee
Posts: 733
Joined: Wed Jul 11, 2018 11:37 am

Re: CPU threshold service check

Post by rferebee »

This can be locked, thank you.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: CPU threshold service check

Post by lmiltchev »

I am locking the topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked