How to Set Up Email Alerts in Nagios XI

Picture of Joe Johnson
Joe Johnson
IT Specialist
Nagios XI email alerts

Configure Notifications for System Failures and Downtime.

Introduction

Setting up email alerts in Nagios XI is essential for proactive monitoring of critical systems. When a server, application, or network device experiences an issue, Nagios XI can send email notifications to alert administrators in real time. This ensures IT teams respond quickly to failures, minimizing downtime, and improving system reliability.

This guide will walk you through configuring email alerts in Nagios XI, covering SMTP settings, user notifications, and troubleshooting tips.


1. Configuring Mail Settings in Nagios XI

Before setting up alerts, Nagios XI must be configured to send emails via SMTP (Simple Mail Transfer Protocol).

A. Access Mail Settings

  • Log in to Nagios XI
  • Navigate to Admin > System Config > Mail Settings

B. Choose Mail Transfer Method

Under the Mail Settings tab, choose one of the following methods:

  • Sendmail (default, for local mail relay)
  • SMTP Server (recommended for external email providers like Gmail, Office 365, or custom SMTP servers)

C. Configure SMTP Settings (Recommended)

  1. Set the SMTP server (e.g., smtp.gmail.com for Gmail, smtp.office365.com for Outlook)
  2. Enable authentication if required
  3. Enter SMTP credentials (username and password for authentication)
  4. Set the sender email address (e.g., nagios@yourdomain.com)
  5. Save changes and test email delivery by sending a test message

2. Configuring User Notifications

Once email settings are configured, you need to enable notifications for users to receive alerts.

A. Enable Email Notifications for a User

  1. Go to Admin > Manage Users
  2. Select the user who should receive alerts
  3. Click the Notification Preferences tab
  4. Enable Email Notifications
  5. Choose the types of alerts the user should receive:
    • Host Down/Recovery Alerts
    • Service Failure Alerts
    • Acknowledged Problems
  6. Save changes

3. Configuring Notification Settings for Hosts and Services

To ensure email alerts are triggered when a system issue occurs, hosts and services must have notification settings enabled.

A. Enable Notifications for Hosts

  1. Navigate to Configure > Core Config Manager
  2. Go to Hosts > Select a Host
  3. Click the Alert Settings tab
  4. Ensure Notifications Enabled is set to On
  5. Select Notification Contacts (users to receive alerts)
  6. Click Apply Configuration to save changes

B. Enable Notifications for Services

  1. Navigate to Configure > Core Config Manager > Services
  2. Select a monitored service (e.g., CPU Load, Disk Space)
  3. Go to the Alert Settings tab
  4. Enable notifications and set a contact group
  5. Save and apply the configuration

4. Testing Email Alerts in Nagios XI

Once notifications are set up, test the alert system:

  1. Trigger a failure: Manually stop a monitored service (e.g., Apache) to generate an alert: sudo systemctl stop httpd
  2. Check if Nagios XI sends an email notification when the service goes down
  3. Restart the service and verify that a recovery alert is sent: sudo systemctl start httpd

5. Troubleshooting Email Notification Issues

If emails are not being sent, try the following fixes:

A. Check Nagios XI Mail Logs

Run the following command to check mail logs for errors:

tail -f /var/log/maillog

Look for SMTP authentication failures or connection issues.

B. Verify Firewall and Port Settings

Ensure outbound SMTP traffic is not blocked:

sudo firewall-cmd --add-port=587/tcp --permanent
sudo firewall-cmd --reload

(Replace 587 with 465 or 25 based on your SMTP provider).

C. Check Email Sending Permissions

Ensure Nagios XI has permission to send emails by testing with:

echo "Test Email" | mail -s "Nagios Test" user@example.com

If this fails, review SMTP credentials and authentication settings.


Conclusion

Setting up email alerts in Nagios XI is crucial for real-time monitoring and quick incident response. By configuring SMTP settings, enabling notifications for users, and testing alerts, IT teams can ensure they receive critical alerts when servers, applications, or network devices fail. Regular testing and troubleshooting will keep your alert system running smoothly.

Learn more about Nagios XI by visiting our Nagios XI Resource page.

Share: