Setting up Nagios Email Alerts

Nagios is an open source system and network monitoring application that watches specified hosts and services and alerts you when a monitored service changes state from normal to having an issue and when that issue is resolved. Click here (link opens an external website in a new browser tab/window) for more information about Nagios.

NOTE You may also configure Nagios email and/or SNMP alerts using the HPE Ezmeral Runtime Enterprise interface, as described in The Notification Settings Screen.

You may access the Nagios interface by navigating to http://<controller_ip>:8085/nagios/, where <controller_ip> is the IP address of the Controller host.

NOTE The default password may be changed as described in Updating External Service Passwords.

The default login credentials are:

  • Username: nagiosadmin
  • Password: nagiosadmin

To configure Nagios to send email alerts:

  1. SSH into the Controller host and then execute the command docker ps to list the containers running on the Controller host.

    This command returns a tabulated list of all of the containers that are running on the Controller host.

  2. Search the IMAGE column of the tabulated list for the entry that includes the word nagios, and make note of the CONTAINER ID for that container.
  3. Execute the command docker exec -it <container_id> /bin/bash, where <container_id> is the alphanumeric string listed in the CONTAINER ID column for the nagios container.
  4. The contacts.cfg file contains the information needed to send Nagios alerts to groups and/or individual users. Edit this file by executing the command vi /etc/nagios/objects/contacts.cfg. In this file:
    • The CONTACTS section lists individual users who will receive email alerts. Within this section, each define contact block defines an individual user.
    • The GROUPS sections lists user groups who will receive email alerts.
  5. Either:
    • Add a new define contact block to add a new user who will receive Nagios email alerts. See The Define Contact Block, below.
    • Modify an existing define contact block to change an existing user who currently received Nagios email alerts. See The Define Contact Block, below.
  6. Execute the command :x to save your changes and exit the text editor.
  7. Execute the command supervisorctl restart nagios to update Nagios with the changes you just made.
  8. If needed, configure your email server to work with Nagios as described here (link opens an external website in a new browser tab/window).

This procedure updates the Nagios email configuration, and the specified user(s) will start receiving email alerts.

You may also see the Other Resources, below, for additional help configuring Nagios email alerts.

The Define Contact Block

Each defined contact block in the contacts.cfg file appears as follows:

define contact {
          contact_name <username> ;
          use generic-contact ;
          alias <full name of user> ;
          email <email_address> ;

For example, if you have a user named Jane Doe, the defined contact block for her may look like this:

define contact {
          contact_name Jane ;
          use generic-contact ;
          alias Jane Doe ;
          email ;

Other Resources

You may also view these external resources for additional information, if desired (links open external websites in anew browser tabs/windows):