Notifications interval

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.
Post Reply
filips
Posts: 6
Joined: Tue Jul 14, 2020 8:02 am

Notifications interval

Post 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!
}
kg2857
Posts: 233
Joined: Wed Apr 12, 2023 5:48 pm

Re: Notifications interval

Post by kg2857 »

What does spam on every 10 second mean?
filips
Posts: 6
Joined: Tue Jul 14, 2020 8:02 am

Re: Notifications interval

Post 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
kg2857
Posts: 233
Joined: Wed Apr 12, 2023 5:48 pm

Re: Notifications interval

Post 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.
filips
Posts: 6
Joined: Tue Jul 14, 2020 8:02 am

Re: Notifications interval

Post by filips »

notification_interval changed to 60000, no luck, email on every 10 seconds, what's wrong with it ?
kg2857
Posts: 233
Joined: Wed Apr 12, 2023 5:48 pm

Re: Notifications interval

Post by kg2857 »

Change the original valur back to 60 and start over.
celinedion
Posts: 1
Joined: Tue Jun 06, 2023 11:55 pm

Re: Notifications interval

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