Check_CPU 0.4.3.88

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Check_CPU 0.4.3.88

Post by WillemDH »

Hello,

I'm putting this on the Nagios forum too, as Nsclient forum is not very active sometimes and I would need an answer to this: (http://www.nsclient.org/forums/topic/check_cpu/

Is there a way to use check_CPU on NSClient 0.4.3.88 to get information about all cores, but only alert when warning or critical threshold for total cpu is exceeded?

So I have now:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H windows_server -t 30 -c Check_CPU -a filter=none time=1 time=5 time=15 “warn=load > 65″ “crit=load > 75″ ‘top-syntax=%(status): CPU Stats {%(list)}’ ‘detail-syntax={%(core), avg %(time)m: %(load)%}’

WARNING: CPU Stats {{core 0, avg 1m: 66%}, {core 1, avg 1m: 35%}, {total, avg 1m: 50%}, {core 0, avg 5m: 64%}, {core 1, avg 5m: 36%}, {total, avg 5m: 50%}, {core 0, avg 15m: 67%}, {core 1, avg 15m: 34%}, {total, avg 15m: 50%}}|’core 0 1’=66%;65;75 ‘core 1 1’=35%;65;75 ‘total 1’=50%;65;75 ‘core 0 5’=64%;65;75 ‘core 1 5’=36%;65;75 ‘total 5’=50%;65;75 ‘core 0 15’=67%;65;75 ‘core 1 15’=34%;65;75 ‘total 15’=50%;65;75
I’m usin CPUStress.exe to stress one core. As you can see core 0 has a load that exceeds the load warning threshold. The total CPU Load never exceeds the warning or critical thresholds, but the status of the check is WARNING. Is it possible to retrieve all CPU cores, but only alert when total load exceeds the thresholds?

I’ve tried several combinations, but none seem to work. For example:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H windws_server -t 30 -c Check_CPU -a filter=none time=1 time=5 time=15 “warn=core = total and load > 40″ “crit=core=total and load > 75″ ‘top-syntax=%(status): CPU Stats {%(list)}’ ‘detail-syntax={%(core), avg %(time)m: %(load)%}’

OK: CPU Stats {{core 0, avg 1m: 66%}, {core 1, avg 1m: 40%}, {total, avg 1m: 53%}, {core 0, avg 5m: 68%}, {core 1, avg 5m: 37%}, {total, avg 5m: 53%}, {core 0, avg 15m: 66%}, {core 1, avg 15m: 42%}, {total, avg 15m: 54%}}|’core 0 1’=66%;40;75 ‘core 1 1’=40%;40;75 ‘total 1’=53%;40;75 ‘core 0 5’=68%;40;75 ‘core 1 5’=37%;40;75 ‘total 5’=53%;40;75 ‘core 0 15’=66%;40;75 ‘core 1 15’=42%;40;75 ‘total 15’=54%;40;75
Where I tried “warn=core = total and load > 40″ but as you can see total core is {total, avg 1m: 53%} which should have exceeded the threshold, but did not result in a WARNING status.

Thanks for any help.

Willem
Nagios XI 5.8.1
https://outsideit.net
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check_CPU 0.4.3.88

Post by tmcdonald »

According to this page:

http://docs.nsclient.org/tutorial/check/index.html

you might need a filter:

Code: Select all

check_cpu "filter=core = 'total'" "top-syntax=${list}"
L     client OK: total>8%, total>8%, total>8%
L     client  Performance data: 'total 5m'=8%;80;90 'total 1m'=8%;80;90 'total 5s'=8%;80;90
Former Nagios employee
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Check_CPU 0.4.3.88

Post by WillemDH »

Trevor,

I saw that, but as said, I would like to monitor all cpu cores, but only alert when total cpu utilisation is above the warn / crit threshold. it might just not be possible what I'm asking, I'm not sure.

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Check_CPU 0.4.3.88

Post by abrist »

I am curious if Trevor's suggestion would still work as his code only assumes "core" without the optional? integer.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Check_CPU 0.4.3.88

Post by WillemDH »

Hello,

I'm not sure hat you mean Andy, but I tried Trevor's code:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H windows_server -t 30 -c Check_CPU -a "filter=core = 'total'" time=1 time=5 time=15 "warn=load > 65" "crit=load > 75" 'top-syntax=%(status): CPU Stats {%(list)}' 'detail-syntax={%(core), avg %(time)m: %(load)%}'
OK: CPU Stats {{total, avg 1m: 0%}, {total, avg 5m: 0%}, {total, avg 15m: 0%}}|'total 1'=0%;65;75 'total 5'=0%;65;75 'total 15'=0%;65;75
"filter=core = 'total'" => Only results in total cpu returned, as expected.

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check_CPU 0.4.3.88

Post by lmiltchev »

"filter=core = 'total'" => Only results in total cpu returned, as expected.
Willem, let us know if it is safe to lock the topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Check_CPU 0.4.3.88

Post by WillemDH »

Ludmill, I meant with "as expected" that it is not an answer to my question.

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Check_CPU 0.4.3.88

Post by abrist »

Ahhh, I think I understand now. You are looking for performance data for each individual core, but you only want to set thresholds for the total, is that correct?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Check_CPU 0.4.3.88

Post by WillemDH »

Correct Andy. I'm not really sure if it is possible. Still no answer on the NSClient forums either.
Nagios XI 5.8.1
https://outsideit.net
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check_CPU 0.4.3.88

Post by lmiltchev »

I am curious to see if this can work "natively". If it doesn't, you could probably come up with a custom script that would do the job for you. Place it in the "scripts" directory and call it with NSClient++.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked