check_interval minimum value

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

check_interval minimum value

Post by neworderfac33 »

Good afternoon,

I would like to be able to set the check_interval in generic-service in templates.cfg to 0.25 (that is 15 seconds) to match (refresh_rate=15) in /usr/local/nagios/etc/cgi.cfg

Although this doesn't result in any errors when I verify, I just wanted to check that this was a valid value to use.

Thanks in advance

Pete
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_interval minimum value

Post by mcapra »

+1 for an update to this documentation pretty please :)
https://assets.nagios.com/downloads/nag ... uling.html

To my knowledge, as long as the interval is >= 0, you should be fine. Granted an interval of exactly 0 means the check is never executed, it's a totally valid configuration.

It's worth mentioning that, for the current tests written for Nagios Core, an interval between 0 and 1 is never actually used. Might be room for improvement there. Ref:
https://github.com/NagiosEnterprises/na ... t_events.c
https://github.com/NagiosEnterprises/na ... t_checks.c

Though in the code itself, the struct for both services and hosts type check_interval as a double:
https://github.com/NagiosEnterprises/na ... /objects.h

Which means there shouldn't ever be a configuration issue for values between 0 and 1.

A worker itself is allowed to be created (eg a check is allowed to be executed) when the last_check time plus the object's check_interval is greater than the current time:
https://github.com/NagiosEnterprises/na ... ers.c#L138

TL;DR Yeah that should work fine. Seems to work exactly how you'd expect it to on my 4.3.2 machine:
check_1.png
check_1.png (3.82 KiB) Viewed 2345 times
check_2.png
check_2.png (3.82 KiB) Viewed 2345 times
Might be worth having a dev/tech chime in though because I haven't seen those parts of the code before today and can't find supporting documentation ;)
Former Nagios employee
https://www.mcapra.com/
dwasswa

Re: check_interval minimum value

Post by dwasswa »

Thanks @ mcapra,

@neworderfac33, let us know if you have any questions.
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: check_interval minimum value

Post by neworderfac33 »

I've just come back to this and it answers my question, so the thread can be closed. Thank you!
kyang

Re: check_interval minimum value

Post by kyang »

Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!
Locked