Page 1 of 1

Notifications interval

Posted: Fri May 19, 2023 9:56 am
by filips
Hello, I I trying to set the notifications work as we need but no luck

1. Firstly, we have to check some services every 10 seconds, so I change

Code: Select all

interval_length=10 
in nagios.cfg
2. Next, if state will change to warn/critical we wannt to get first notifications immediately, the next one can be in 1 hour for example, but the service should be checked every 10 second all the time, if state will back to normal we wannt the notifications ASAP.
3. Now, we have working 10 second interval check, notifications start immediately but we have spam on every 10 second...
What should we must to change to get it work ?

Code: Select all

define service {

    name                                router-service         ; The 'name' of this service template
    use>				    service-pnp              ;
    active_checks_enabled           1                       ; Active service checks are enabled
    passive_checks_enabled          1                       ; Passive service checks are enabled/accepted
    parallelize_check               1                       ; Active service checks should be parallelized (disabling this can lead to major performance problems)
    obsess_over_service             1                       ; We should obsess over this service (if necessary)
    check_freshness                 0                       ; Default is to NOT check service 'freshness'
    notifications_enabled           1                       ; Service notifications are enabled
    event_handler_enabled           1                       ; Service event handler is enabled
    flap_detection_enabled          1                       ; Flap detection is enabled
    process_perf_data               1                       ; Process performance data
    retain_status_information       1                       ; Retain status information across program restarts
    retain_nonstatus_information    1                       ; Retain non-status information across program restarts
    is_volatile                     1                       ; The service is not volatile
    check_period                    24x7                    ; The service can be checked at any time of the day
    max_check_attempts              1                      ; Re-check the service up to 3 times in order to determine its final (hard) state
    check_interval                  1                    ; Check the service every 10 minutes under normal conditions
    normal_check_interval           1                  ;
    retry_interval                  1                  ; Re-check the service every two minutes until a hard state can be determined
    contact_groups                  fs24-admin                  ; Notifications get sent out to everyone in the 'admins' group
    notification_options            w,u,c,r                 ; Send notifications about warning, unknown, critical, and recovery events
    first_notification_delay        0                       ;
    notification_interval           600                 ; Re-notify about service problems every hour
    notification_period             24x7                    ; Notifications can be sent out at any time
    register                        0                       ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

Re: Notifications interval

Posted: Fri May 19, 2023 2:26 pm
by kg2857
What does spam on every 10 second mean?

Re: Notifications interval

Posted: Sat May 20, 2023 2:12 pm
by filips
It means email with critical status on every 10 seconds. We need only first notification asap, then the second in 1 hour for example with the same status

Re: Notifications interval

Posted: Sat May 20, 2023 7:11 pm
by kg2857
Your settings seem like they should do what you want.
Maybe try setting notification_interval to 6000 and see what happens.
first_notification_delay 0 should be fine for the initial notification.

Re: Notifications interval

Posted: Thu May 25, 2023 3:24 am
by filips
notification_interval changed to 60000, no luck, email on every 10 seconds, what's wrong with it ?

Re: Notifications interval

Posted: Thu May 25, 2023 11:13 pm
by kg2857
Change the original valur back to 60 and start over.

Re: Notifications interval

Posted: Wed Jun 07, 2023 12:04 am
by celinedion
By setting notification_interval to 3600 (1 hour) and first_notification_delay to 0, you ensure that the first notification is sent immediately when the state changes to warn/critical.

mapquest driving directions