Icinga

5.12. Notifications: Examples and troubleshooting

5.12.1. Introduction
5.12.2. Some examples
5.12.3. Troubleshooting

5.12.1. Introduction

Object definitions of hosts, services, and contacts / contact groups were shown in the chapter "Configuring Icinga", the several checks being made to determine whether a notification will be sent or not were described in the section "Notifications".

Despite all the explanations it seems that there is still some level of uncertainty so we'll try to show an example using mail as one way of communication.

[Important] Important

Icinga does not provide any method to notify any contact you define so setting up mail, sms, pager, or whichever way you may choose is entirely up to you and not part of this documentation. Regarding mail you have to install a mail program (postfix, sendmail, or any other MTA you feel comfortable with), set up relaying on the Icinga server (postfix: /etc/postfix/main.cf, directive "relayhost"; sendmail: /etc/mail/sendmail.cf, directive "DS"), allow relaying on your central mail server for mails coming from your Icinga server and verify that you can send mails from your Icinga server using the user running Icinga.

If you cannot send messages from the command line on your Icinga server then there is no sense in reading on.

Prerequisites

5.12.2. Some examples

We will define some services containing only some directives assuming that the other (required) things were defined using a template and show some things to look for:

 define service {
        use                      service_template
        host_name                san_host
        service_description      spare_disks
        notification_period      24x7
        notification_interval    60
        notification_options     c,w,r
        check_command            check_spare!2!1
        contacts                 jdoe
        contact_groups           admins
        }

 define service {
        use                      service_template
        host_name                login_host
        service_description      users
        notification_period      workhours
        notification_interval    0
        notification_options     c,r
        check_command            check_user!20!50
        contacts                 jdoe
        }        
       
 define service {
        use                      service_template
        host_name                app_host
        service_description      memory
        notification_period      workhours
        notification_interval    10
        notification_options     c,w,r,s,r,f,n
        check_command            check_memory!90%!95%
        contacts                 admins
        }

5.12.3. Troubleshooting

If notifications don't seem to work there are several things to check: