Page 1 of 1

Reduce time between Last Check Time and Next Scheduled Check

Posted: Sat Oct 25, 2014 3:19 pm
by l_freez
Can anyone let me know how I would reduce time between Last Check Time and Next Scheduled Check on a particular services.

I need this to be 30 second if it not possible at least 1 minutes. :roll: :roll: :roll:

can someone tell me which files need to configure and which values need to set. 8-)

Re: Reduce time between Last Check Time and Next Scheduled C

Posted: Mon Oct 27, 2014 9:46 am
by tmcdonald
That would be the check_interval config option for hosts/services that are not in a problem state, and retry_interval for those that are. The value is in minutes, so "check_interval 1" would check every minute.

Re: Reduce time between Last Check Time and Next Scheduled C

Posted: Mon Oct 27, 2014 12:50 pm
by l_freez
tmcdonald wrote:That would be the check_interval config option for hosts/services that are not in a problem state, and retry_interval for those that are. The value is in minutes, so "check_interval 1" would check every minute.
thanks..I'll check it again ;)

Re: Reduce time between Last Check Time and Next Scheduled C

Posted: Mon Oct 27, 2014 12:56 pm
by eloyd
I hate contradicting Nagios staff, but the check_interval (and retry_interval) is not technically in minutes, it is in interval_length intervals.

interval_length is defined in /usr/local/nagios/etc/nagios.cfg and by default, it is set to 60 seconds. So interval_length x check_interval = number of seconds between service checks for checks not in a problem state. Since interval_length defaults to 60 seconds, check_interval (and retry_interval) is in minutes. But if you changed interval_length to be 15, for instance, then check_interval (and retry_interval )becomes 1/4 minute intervals.

:-)

Re: Reduce time between Last Check Time and Next Scheduled C

Posted: Mon Oct 27, 2014 1:12 pm
by tmcdonald
eloyd wrote:I hate contradicting Nagios staff
I like being contradicted when I leave out vital information :)

It was somewhat intentional though, since all other checks will need to be modified if OP goes that route.

Re: Reduce time between Last Check Time and Next Scheduled C

Posted: Mon Oct 27, 2014 1:16 pm
by eloyd
True, but I like being painstakingly accurate. :-)

Re: Reduce time between Last Check Time and Next Scheduled C

Posted: Mon Oct 27, 2014 2:39 pm
by abrist
Just an FYI: Changing interval_length may have odd consequences with the scheduler. All we can do is suggest you try it out. Your mileage may vary.

Re: Reduce time between Last Check Time and Next Scheduled C

Posted: Mon Oct 27, 2014 2:46 pm
by eloyd
The original question was setting things to check every 30 seconds. To do this, you need to change interval_length from 60 to 30 and then ensure that all of your *_interval config parameters are now calculated based on 30 second intervals instead of 60 second intervals. So anything that you want to have checked every minute needs to be doubled to 2 while everything you want to be checked at 30 seconds needs to be 1.

I've never seen a case of changing the interval_length changing the scheduler. I do see some places in the 4.0.7 code that check_interval is used where I believe (check_interval * interval_Length) should be used, but it looks to be in special cases that probably won't matter (but should still be fixed).

If I get excited over the next few days, I'll take a closer look. But - again, your mileage may vary - I've never had a problem lowering interval_length to 30 seconds.

Re: Reduce time between Last Check Time and Next Scheduled C

Posted: Mon Oct 27, 2014 5:00 pm
by abrist
eloyd wrote:I've never seen a case of changing the interval_length changing the scheduler.
It is more about the potential issues of the auto_rescheduling_window and sub one minute checks. Make sure that your auto_rescheduling_window directive in nagios.cfg is set to less than your shortest possible check interval (which is derived from interval_length * check_interval).