1

The notifications I'm getting and not getting from Icinga don't seem to be making sense and I'm hoping someone here can help me out. It's Icinga 1.10.1 running on Ubuntu 12.04.3 LTS

When the host moves from up to down it checks it 5 times and then moves to a hard state. The log shows that the host notification process is triggered and it tries to send an email by notify-host-by-email. But nothing ever comes through.

The ping, uptime and uplink services move to hard critical and unknown states straight away and doesn't trigger the notify-service-by-email event.

If the uplink service has one link removed it moves into a warning state, check 5 times then successfully issues a notification email.

Hopefully it isn't something obvious I've missed.

My generic service, host & contact templates are below as well as the host and service definitions for the device in question.

# generic service template definition
define service{
    name                            generic-service ; The 'name' of this service template
    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
    failure_prediction_enabled      1       ; Failure prediction 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
    max_check_attempts              5
    check_interval                  1
    retry_interval                  1
    check_period                    24x7
    notification_interval           30
    notification_period             24x7
    notification_options            w,u,c,r
    contact_groups                  sys-admins
    register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
    }

#service definitions in localhost_icinga.cfg

#check uptime 

define service{
use                     generic-service
host_name               1.switch.foo.com
service_description     Uptime Test
check_command           check_snmp!public!sysUpTime.0
}

#check ping for AS5 for test notifications
define service{
use                     generic-service
host_name               1.switch.foo.com
service_description     Ping Test
check_command           check_ping!200.0,20%!600.0,60%
}

define service{
    use                     generic-service
    host_name               1.switch.foo.com
    service_description     Uplink Ports Check
    check_command           check_multi_snmp!/etc/icinga/objects/switches/1s_uplink.cmd!15
}

.

# Generic host definition template - This is NOT a real host, just a template!

define host{
    name                            generic-host    ; The name of this host template
    notifications_enabled           1       ; Host notifications are enabled
    event_handler_enabled           1       ; Host event handler is enabled
    flap_detection_enabled          1       ; Flap detection is enabled
    failure_prediction_enabled      1       ; Failure prediction 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
            check_command                   check-host-alive
            check_interval                  1
            retry_interval                  1
            max_check_attempts              5
            check_period                    24x7
            contact_groups                  sys-admins
            notification_interval           30
            notification_period             24x7
            notification_options            d,u,r
    register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A  REAL HOST, JUST A TEMPLATE!
    }

# Define a template for switches that we can reuse
define host{
   name         generic-switch   ; The name of this host template
   use          generic-host   ; Inherit default values from the generic-host template
   register     0      ; DONT REGISTER THIS - ITS JUST A TEMPLATE
   }

#Host definition in localhost_icinga.cfg

define host{
    use             generic-switch      ; Inherit default values from a template
    host_name       1.switch.foo.com      ; The name we're giving to this switch
    alias           S1 - HP Pro-Curve 1800-24G J9028B   ; A longer name associated with the switch
    address         10.1.1.242       ; IP address of the switch
    hostgroups      switches      ; Host groups this switch is associated with
}

.

#Define a generic contact for Icinga

define contact{
    name                            generic-contact
    service_notification_period     24x7
    host_notification_period        24x7
    service_notification_options    w,u,c,r,f,s
    host_notification_options       d,u,r,f,s
    service_notification_commands   notify-service-by-email
    host_notification_commands      notify-host-by-email
    register                        0
    }

#icinga_contacts.cfg
define contact{
    contact_name                    bob
    use                             generic-contact
    alias                           bob (Sysadmin)
    email                           bob@foo.com
    }

define contactgroup{
    contactgroup_name          sys-admins
    alias                      System Administrator
    members                    bob
}
Stanzor
  • 11
  • 1

0 Answers0