Page 1 of 1

check_interval minimum value

Posted: Wed Oct 25, 2017 10:05 am
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

Re: check_interval minimum value

Posted: Wed Oct 25, 2017 10:37 am
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 2385 times
check_2.png
check_2.png (3.82 KiB) Viewed 2385 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 ;)

Re: check_interval minimum value

Posted: Wed Oct 25, 2017 12:07 pm
by dwasswa
Thanks @ mcapra,

@neworderfac33, let us know if you have any questions.

Re: check_interval minimum value

Posted: Thu Dec 21, 2017 9:59 am
by neworderfac33
I've just come back to this and it answers my question, so the thread can be closed. Thank you!

Re: check_interval minimum value

Posted: Thu Dec 21, 2017 10:07 am
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!