Page 1 of 1

Linux check_load invert or range check

Posted: Thu May 20, 2021 4:17 am
by WillemDH
Hello,

I need to check CPU Load on a host and alert when CPU load is lower then x, so I tried using the ':' and range 'x:x' warning and critical thresholds, but that does not appear to work?

At first it seemd to work:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H myserver -t 120 -c check_load -a '-w 16.0:,14.0:,12.0: -c 24.0:,22.0:,20.0:'
CRITICAL - load average: 6.79, 6.39, 6.24|load1=6.790;16.000;24.000;0; load5=6.390;0.000;0.000;0; load15=6.240;0.000;0.000;0;
But it seems like using a ':' always throws a critical.. :(

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H myserver  -t 120 -c check_load -a '-w 3.0:,2.0:,1.0: -c 4.0:,3.0:,2.0:'
CRITICAL - load average: 6.57, 6.35, 6.23|load1=6.570;3.000;4.000;0; load5=6.350;0.000;0.000;0; load15=6.230;0.000;0.000;0;
Someone has a suggestion how to do this?

Grtz

Willem

Re: Linux check_load invert or range check

Posted: Thu May 20, 2021 1:13 pm
by ssax
Looking at the code I don't think that it currently supports using : or ranges which is why it's not working properly.

https://github.com/nagios-plugins/nagio ... eck_load.c

I'm having trouble finding an alternative plugin that does support the thresholds/ranges.

Re: Linux check_load invert or range check

Posted: Fri May 28, 2021 8:06 am
by WillemDH
Thanks for confirming Sean,

Created https://github.com/nagios-plugins/nagio ... issues/608

Re: Linux check_load invert or range check

Posted: Fri May 28, 2021 5:21 pm
by ssax
Thank you for creating that!