Reduce time between Last Check Time and Next Scheduled Check

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
l_freez
Posts: 13
Joined: Sat Oct 25, 2014 3:06 pm

Reduce time between Last Check Time and Next Scheduled Check

Post 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-)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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.
Former Nagios employee
l_freez
Posts: 13
Joined: Sat Oct 25, 2014 3:06 pm

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

Post 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 ;)
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

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

Post 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.

:-)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

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

Post by eloyd »

True, but I like being painstakingly accurate. :-)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
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
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

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

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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).
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.
Locked