Send notifications to different contact at different times

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
SimpleNiko
Posts: 6
Joined: Wed Jan 22, 2020 6:32 pm

Send notifications to different contact at different times

Post by SimpleNiko »

Hello everybody,
My client has these demands for this monitoring :
1. Each service monitored needs checked , and a notification will be sent to the support team email if the alert has been up for more than 2 minutes.
2.For each service, in addition to the notification sent to the contacts in #1, a notification needs to be sent after 15 minutes of active alert to the client email.

In short:
Service error -> after 2 minutes : notification sent to support team > after 15 minutes : a notification sent both to the support team and the client.

Here is my configuration:

Code: Select all

define service {

    name                            generic-service        
    active_checks_enabled           1                      
    passive_checks_enabled          1                      
    parallelize_check               1                      
    obsess_over_service             1                       
    check_freshness                 0                      
    notifications_enabled           1                      
    event_handler_enabled           1                       
    flap_detection_enabled          1                       
    process_perf_data               1                       
    retain_status_information       1                       
    retain_nonstatus_information    1                      
    is_volatile                     0                      
    check_period                    24x7                   
    max_check_attempts              1                       
    check_interval                  1                      
    retry_interval                  2                       
    contact_groups                  support                  
    notification_options            w,c,r                  
    notification_interval           1                      
    notification_period             24x7                  
    register                        0                      

}

Code: Select all

define service {
    name                            generic-service-tier2       
    active_checks_enabled           1                    
    passive_checks_enabled          1                     
    parallelize_check               1                       
    obsess_over_service             1                       
    check_freshness                 0                    
    notifications_enabled           1                      
    event_handler_enabled           1                  
    flap_detection_enabled          1                    
    process_perf_data               1                     
    retain_status_information       1                       
    retain_nonstatus_information    1                     
    is_volatile                     0                      
    check_period                    24x7                   
    max_check_attempts              16                     
    check_interval                  1                     
    retry_interval                  1                       
    contacts                        client1,client2
    notification_options            c,r                 
    notification_interval           1                    
    notification_period             24x7                
    register                        0                      
}


Code: Select all

define service{
        use                             generic-service,generic-service-tier2,srv-pnp
        hostgroup_name                  DR-Distribution-Servers
        service_description             Couchbase Replication Status
        check_command                   check_http_string_couchbase_replication!/pools/default/tasks!"running"
}

As you can see, I used both generic-service and generic-service-tier2 in the use label at the service define.
However, looks like this doesn't answer my needs.
The notifications are sent at the same time, basically, the support contact group, client1 and client 2 are getting the notifcations at the same time, insted of client1 and client2 receiving them 15 minutes later.
Not sure what I missed here..
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Send notifications to different contact at different tim

Post by scottwilkerson »

This is not possible how you have it setup, adding multiple templates will override setting from the other templates
See how the templating works here (specifically the "Multiple Inheritance Sources" section tward the bottom)
https://assets.nagios.com/downloads/nag ... tance.html

The only way to really do this would be duplicate services OR escalations
https://assets.nagios.com/downloads/nag ... tions.html
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked