How to configure Nagios contacts

REDIRECT: This URL has changed to https://support8.gwos.com/gw/gw8/latest/notifications-and-downtime/nagios-notifications
Click the link above if you are not automatically redirected in 10 seconds.

Contact Templates, Contacts, Contact Groups

Contacts are use for Nagios notifications and escalations. A contact definition is used to identify someone who should be contacted in the event of a problem on your network.

When creating contacts you'll want to use a contact template which consists of host and service notification time periods, specific host and service notification options (states for which notifications can be sent out), and host and service notification commands used to notify of a host or service problem or recovery. These templates aid in creating contacts by conveniently applying commonly used directives so if something changes you have the advantage of updating the templates which then changes associated contacts using that template.

After you have completed defining contact templates, you'll then want to continue with creating contacts. Contact directives consist of contact properties: name, alias, email, pager, and a required contact template. Individual template directives can be selected for the contact definition, or the applied contact template's properties can be inherited.

Next, a Contact Group is a grouping of contacts. A contact group's directives consist of name, alias, and the selected contacts. After creating contact groups, you will be ready to associate these groups with host and service templates, hosts, services, and host groups definitions.

Creating contact templates

  1. Select Configuration > Nagios Monitoring > Contacts, select the Contact Templates option, and New to create a new template, or you can copy or modify an existing template.
  2. In the Contact Template Properties screen, enter a required contact template Name.
  3. Next, enter the various host and service contact template properties which will be used for all contacts that use this contact template:
    • Host notification period - [required] This directive is used to specify the name of the time period during which the contact can be notified about host problems or recoveries.
    • Host notification options - [required] This directive is used to define the host states for which notifications can be sent out to this contact.
    • Host notification commands - [optional] This directive is used to define a list of names of the commands used to notify the contact of a host problem or recovery. All notification commands are executed when the contact needs to be notified.
    • Service notification period - [required] This directive is used to specify the name of the time period during which the contact can be notified about service problems or recoveries.
    • Service notification options - [required] This directive is used to define the service states for which notifications can be sent out to this contact.
    • Service notification commands - [optional] This directive is used to define a list of names of the commands used to notify the contact of a service problem or recovery. All notification commands are executed when the contact needs to be notified.
  4. Contact templates also enable you to define and manage optional custom object variables. This section is used to define macros which are ultimately associated with contacts. These macros may be referenced when you invoke notification commands.
  5. Select Add to save the template. You can now use this template when creating new contacts.

    contact template properties

Creating contacts

  1. Select Configuration > Nagios Monitoring > Contacts, Contacts, and New to create a new contact (or you can copy or modify an existing contact).
  2. In the Contact Properties screen, if a new contact, enter a contact Name, and an Alias as a description used to identify the contact. Optionally enter an email address or pager number.
    • Name - [required] This directive is the name used to identify the contact.
    • Alias - [required] This directive is used to define the name or description for the contact. Under the right circumstances, the $CONTACTALIAS$ macro will contain this value.
    • Email - [optional] This directive is used to define an email address for the contact. Depending on how you configure your notification commands, it can be used to send out an alert email to the contact. Under the right circumstances, the $CONTACTEMAIL$ macro will contain this value.
    • Pager - [optional] This directive is used to define a pager number for the contact. It can also be an email address to a pager gateway (e.g., pagejoe@pagenet.com). Depending on how you configure your notification commands, it can be used to send out an alert page to the contact. Under the right circumstances, the $CONTACTPAGER$ macro will contain this value.
  3. Next, enter a required Contact Template most suitable for this contact. By default, many of the selected template directives are checked to be used in the new contact definition. You can uncheck any of the Inherit boxes on the left to overide the selected template values. Clicking the Set Full Inheritance button will recheck all values and enable the contact definition to inherit all values from the template.
  4. You can adjust any custom object variable values that appear in the controlling contact template, and add new custom object variables that are specific to this one contact. Under the right circumstances, these will appear as special macros that you can refer to in notification command definitions. See the Nagios documentation for details.
  5. Finally, you may optionally select Contact Groups which are used to identify the name(s) of the contact groups that the contact belongs to. This directive may be used as an alternative to (or in addition to) using the contacts directive in the contact groups definition.
  6. When finished, select Save.

    contact properties

Creating contact groups

  1. Select Configuration > Nagios Monitoring > Contacts, Contact Groups, and New to create a new contact group, or you can copy or modify an existing definition.
  2. In the Contact Group Properties screen, enter a contact group Name, and an Alias as a description used to identify the contact group.
  3. Next, using the Add and Remove buttons, select which contacts are to be part of the contact group.
  4. When finished with your choices, click Save

    contact group properties
  5.  You can now associate these contact groups with contacts, host and service templates, hosts, services, and host groups definitions. Contact groups can be applied to escalation trees to be used in setting up notifications for hosts and services.

Related articles