Mail problem


#1

Hey all - this is a quirky problem I’ve noticed - Nagios 3.0.6 on Solaris 10, previously on Suse 10 - keep getting e-mails being sent to $@whatever.com - all info in e-mail is blank as well - see mail log below. Any ideas? All config files are clean, and all hosts use valid contact groups, all contact groups have valid users etc.

From MAILER-DAEMON Mon Jan 11 10:57:13 2010
Return-Path: <>
Received: from myhost.xyz.com (localhost [127.0.0.1])
by myhost.xyz.com (8.13.8+Sun/8.13.8) with ESMTP id o0BIvDxY015554
for nagios@myhost.xyz.com; Mon, 11 Jan 2010 10:57:13 -0800 (PST)
Received: from localhost (localhost)
by myhost,xyz.com (8.13.8+Sun/8.13.8/Submit) id o0BIvDY6015553;
Mon, 11 Jan 2010 10:57:13 -0800 (PST)
Date: Mon, 11 Jan 2010 10:57:13 -0800 (PST)
From: Mail Delivery Subsystem MAILER-DAEMON@myhost.xyz.com
Message-Id: 201001111857.o0BIvDY6015553@myhost.xyz.com
To: nagios@myhost.xyz.com
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="o0BIvDY6015553.1263236233/myhost.xyz.com"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
Content-Length: 1579

This is a MIME-encapsulated message

–o0BIvDY6015553.1263236233/myhost.xyz.ray.com

The original message was received at Mon, 11 Jan 2010 10:57:13 -0800 (PST)
from nagios@localhost

** ----- The following addresses had permanent fatal errors -----
$
(reason: 550 5.1.1 $@myhost.xyz.com… User unknown)
(expanded from: $)**

----- Transcript of session follows -----
… while talking to [127.0.0.1]:

DATA
<<< 550 5.1.1 $@myhost.xyz.com… User unknown
550 5.1.1 $… User unknown
<<< 503 5.0.0 Need RCPT (recipient)

–o0BIvDY6015553.1263236233/myhost.xyz.com
Content-Type: message/delivery-status

Reporting-MTA: dns; myhost.xyz.com
Arrival-Date: Mon, 11 Jan 2010 10:57:13 -0800 (PST)

Final-Recipient: RFC822; $@myhost.xyz.com
Action: failed
Status: 5.1.1
Remote-MTA: DNS; [127.0.0.1]
Diagnostic-Code: SMTP; 550 5.1.1 $@myhost.xyz.com… User unknown
Last-Attempt-Date: Mon, 11 Jan 2010 10:57:13 -0800 (PST)

–o0BIvDY6015553.1263236233/myhost.xyz.com
Content-Type: message/rfc822

Return-Path:
***Received: (from nagios@localhost)
by myhost.xyz.com (8.13.8+Sun/8.13.8/Submit) id o0BIvDY5015553
for $; Mon, 11 Jan 2010 10:57:13 -0800 (PST)
Date: Mon, 11 Jan 2010 10:57:13 -0800 (PST)
From: nagios
Message-Id: <201001111857.o0BIvDY5015553@myhost@xyz.com>
MIME-Version: 1.0
Content-Type: text/plain

***** Nagios *****

Notification Type: RECOVERY
Host: :HOSTNAME$
State: $
Address: $
Info: $

Date/Time: $***

–o0BIvDY6015553.1263236233/myhost.xyz.com–


#2

i’d say the mail command in command.cfg is configured wrongly. looks like some macro is misinterpreted whan expanding the contacts… either this or the local postfix has problems rewriting some alias…
Looks like some “trial and error” is required :slight_smile:


#3

There are no breaks in the lines (although it looks like it when I paste the text here)

[size=85]define command{
command_name notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s " $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
}[/size]


#4

check the local mail log to see if nagios uses the correct mail address whan it gives the mail over to the local mail agent or not.