Page 1 of 1

Nagios Timing

Posted: Wed Jan 22, 2020 3:02 pm
by nickanderson1982
I am confused on the timing involved on my checks:
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contact_groups admins communication
notification_interval 60
notification_period 24x7
notifications_enabled 1
icon_image ncpa.png
statusmap_image ncpa.png
register 1

How does the timing break down for max_check_attempts, check_interval, retry_interval? Is it by minutes? If so how would I change it to something that has a shorter response time?

Re: Nagios Timing

Posted: Wed Jan 22, 2020 7:57 pm
by Box293
Everything is based off minutes, this is the default timing in Nagios. I can be changed in a global config but not recommended.

check_interval is when everything is running OK. In your case checks occur every 5 minutes.

When a check returns a non-ok status it enters a SOFT state and checks from this point will occur at the retry_interval period, in your case this is every 1 minute.

max_check_attempts is how many times a check will be scheduled based on the retry_interval before it enters a HARD state and notifications are sent. Your max_check_attempts is set to 5, so there are 4 more remaining. So another 4 minutes will pass.

When the 5th max_check_attempts is reached and it enters a HARD state then the check will resume checking at the check_interval period.

To get a shorter response time reduce the number of max_check_attempts.

Also keep in mind that your check may return an OK status and 10 seconds later it actually fails, but it's another 4m50s before Nagios actually checks the service again and with max_check_attempts it could be up to 10 minutes before a notification is sent.

Re: Nagios Timing

Posted: Wed Jan 29, 2020 12:17 pm
by nickanderson1982
How would I change it so that I'm checking every 30 seconds instead of every 1 minute.

My current setup is:
max_check_attempts 5
check_interval 5
retry_interval 1

Re: Nagios Timing

Posted: Wed Jan 29, 2020 5:30 pm
by Box293
https://assets.nagios.com/downloads/nag ... gmain.html

Timing Interval Length
Format: interval_length=<seconds>

This is not something I would recommend, simply accept that Nagios is based on 1 minute intervals otherwise it's going to get very confusing very fast.