[SOLVED] first_notification_delay doesn't work

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
falken
Posts: 6
Joined: Thu May 15, 2014 5:56 am

[SOLVED] first_notification_delay doesn't work

Post by falken »

Hello everyone,

I am running nagios core 3.5.1 on centos 6.5 x64 installed from epel repo.

I'm a bit confused that option 'first_notification_delay' doesn't work for me.
I tried to setup different time period, but none of it worked except for 0 which is default according to documentation

Here is my service config:

Code: Select all

define service{
        use                             generic-service
        host_name                       server.hostname
        service_description             pure-ftpd_procs
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           5
        retry_check_interval            1
        contact_groups                  admins
        first_notification_delay        3
        notification_interval           120
        notification_period             24x7
        notification_options            u,c
        check_command               check_nrpe!check_proc_ftp
        }
My time_unit is default, which is 60.

I didn't found anything about it here, google doesn't know anything except for old bugs.

Can anyone please explain how to set this right?

Best regards.
Last edited by falken on Wed May 21, 2014 4:29 am, edited 1 time in total.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: first_notification_delay doesn't work

Post by sreinhardt »

The notification delay, is simply a number of minutes(generally) that notifications wait from the last OK state before they will send, not waiting after the hard warn\critical. If your retry interval X check attempts is larger than the delay interval it will never be noticed as we would already be past that time period.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
falken
Posts: 6
Joined: Thu May 15, 2014 5:56 am

Re: first_notification_delay doesn't work

Post by falken »

Hello,

Thanks for explaining.

Just to be clear, i'll provide an example:

1 service(status ok), time 10:00 -> first_notification_delay 10(minutes)->service(critical), time 10:10-> no notification?
and working scheme:
1 service(status ok), time 10:00 -> first_notification_delay 20(minutes)->service(critical), time 10:10-> receive notification after 10 minutes of critical state?

Best regards,
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: first_notification_delay doesn't work

Post by lmiltchev »

You haven't changed the interval_length's value from the default of 60, have you?

Code: Select all

grep interval_length /usr/local/nagios/etc/nagios.cfg
Be sure to check out our Knowledgebase for helpful articles and solutions!
falken
Posts: 6
Joined: Thu May 15, 2014 5:56 am

Re: first_notification_delay doesn't work

Post by falken »

Nope, i didn't. It's 60
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: first_notification_delay doesn't work

Post by scottwilkerson »

falken wrote:Hello,

Thanks for explaining.

Just to be clear, i'll provide an example:

1 service(status ok), time 10:00 -> first_notification_delay 10(minutes)->service(critical), time 10:10-> no notification?
and working scheme:
1 service(status ok), time 10:00 -> first_notification_delay 20(minutes)->service(critical), time 10:10-> receive notification after 10 minutes of critical state?

Best regards,

I think this post will show explain your situation
The time for "first notification delay" is timed based on the last known OK state

not from the first failure

So if you normally check on 5 minute intervals the service would reach a HARD state at

Code: Select all

5 + 3 + 3 + 3 = 14
Being you have your "first notification delay" set to 13 it would be sent immediately.

If you want the notification to go out 13 minutes after it goes into a hard state, set it to 27.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
falken
Posts: 6
Joined: Thu May 15, 2014 5:56 am

Re: first_notification_delay doesn't work

Post by falken »

Hello,

Thank you for the advice. I solved my issue, but i used a bit different scheme.
For anyone who will need, here is my service config:

Code: Select all

define service{
        use                             generic-service
        host_name                       hostname
        service_description             My service
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           5
        retry_check_interval            1
        first_notification_delay        15
        contact_groups                  mygroup
        notification_interval           30
        notification_period             24x7
        notification_options            u,c
        check_command                   check_service
        }
Note that i have set: normal_check_interval to 5, retry_check_interval to 1, and first_notification_delay to 15.

So for now i receive notification after 10 minutes for CRITICAL state, as i figured, this is the logic:
After expiration of max_check_attempts and normal_check_interval there are only 10 minutes left till the notification will be sent.

Marking this thread as solved, thank you very much guys. Couldn't do it without your support :)

Best regards.
Locked