Email Notification


I was wondering if there was a way for Nagios to get ahold of an email from a device, then send out an alert based on whats inside that email? Im trying to figure out the best way to monitor like five servers raid cards, apc’s,etc and there all at remote locations…



SNMP or small nagios installs at remote locations which only send the data to your main nagios server are an option.
Parsing an email isn’t impossible but you’ll need to create the script by yourself, read the mail content and inject in the command file the right strings so nagios knows what to do.



Hello! I have a Nagios 3.0.6 on CentOS 5.3 and some monitoring linux servers via nrpe plugin.
I need your help with notification.
I attached returned mail:

“/var/spool/mail/nagios”: 1 message 1 new

N 1 MAILER-DAEMON@localh Wed Jun 17 15:24 79/2814 “Returned mail: see transcript for details”
& 1
Message 1:
From MAILER-DAEMON@localhost.localdomain Wed Jun 17 15:24:32 2009
Date: Wed, 17 Jun 2009 15:24:32 +0400
From: Mail Delivery Subsystem MAILER-DAEMON@localhost.localdomain
To: nagios@localhost.localdomain
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message


The original message was received at Wed, 17 Jun 2009 15:24:32 +0400
from localhost.localdomain []

----- The following addresses had permanent fatal errors -----
(reason: 550 We do not accept mail from dynamic IPs ( Please contact

----- Transcript of session follows -----
… while talking to

<<< 550 We do not accept mail from dynamic IPs ( Please contact
550 5.1.1… User unknown

Content-Type: message/delivery-status

Reporting-MTA: dns; localhost.localdomain
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Wed, 17 Jun 2009 15:24:32 +0400

Final-Recipient: RFC822;
Action: failed
Status: 5.1.1
Remote-MTA: DNS;
Diagnostic-Code: SMTP; 550 We do not accept mail from dynamic IPs ( Please contact
Last-Attempt-Date: Wed, 17 Jun 2009 15:24:32 +0400

Content-Type: message/rfc822

Return-Path: nagios@localhost.localdomain
Received: from localhost.localdomain (localhost.localdomain [])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id n5HBOW8b028032
for; Wed, 17 Jun 2009 15:24:32 +0400
Received: (from nagios@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id n5HBOW1n028031
for; Wed, 17 Jun 2009 15:24:32 +0400
Date: Wed, 17 Jun 2009 15:24:32 +0400
From: nagios@localhost.localdomain
Message-Id: 200906171124.n5HBOW1n028031@localhost.localdomain
Subject: ** PROBLEM Service Alert: Server_NAGIOS/Total Processes is WARNING **

***** Nagios *****

Notification Type: PROBLEM

Service: Total Processes
Host: Server_NAGIOS

Date/Time: Wed Jun 17 15:24:32 MSD 2009

Additional Info:

PROCS WARNING: 158 processes



Here is my configs:
the part from commands.cfg

‘notify-host-by-email’ command definition

define command{
command_name notify-host-by-email
command_line /usr/bin/printf “%b” “***** Nagios ***\n\nNotification
DDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "

‘notify-service-by-email’ command definition

define command{
command_name notify-service-by-email
command_line /usr/bin/printf “%b” “***** Nagios ***\n\nNotification
$HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "

from contacts.cfg

define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user

    email                           [](         ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******



why didn’t you open a new thread? :frowning:

anyway your problem is here: (reason: 550 We do not accept mail from dynamic IPs ( Please contact
not much to help.


Thanks! It works with another mail server! :stuck_out_tongue: - Don’t work - work correctly, I have recieved many messages from nagios! :stuck_out_tongue: