Normally the mail binary takes the hostname into account. <br>Verify the following files if you correctly have set up the hostname: <br>/etc/hosts<br>/etc/HOSTNAME<br><br>You might also want to take a look at .mailrc if the hostname is still not shown.<br>
<br><div class="gmail_quote">On Mon, Nov 21, 2011 at 10:17 PM, Kaplan, Andrew H. <span dir="ltr"><<a href="mailto:AHKAPLAN@partners.org">AHKAPLAN@partners.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Hi there --</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I checked the nagios.log file, and the problem was due to the
mail binary not being at the /bin folder. I created a symbolic
link</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">at that location to point to the /usr/bin/mail binary. Once
that was done, notifications were sent to the recipient. </font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">As a follow-up, the address of the Nagios server is shown to
be <a href="mailto:nagios@localdomain" target="_blank">nagios@localdomain</a>. I would like to
change that to reflect the</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">name of the server. What file(s) do I need to modify in order
to make that happen?</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Thanks. </font></span></div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> Claudio Kuenzler
[mailto:<a href="mailto:ck@claudiokuenzler.com" target="_blank">ck@claudiokuenzler.com</a>] <br><b>Sent:</b> Monday, November 21, 2011 3:25
PM<br><b>To:</b> Nagios Users List<br><b>Subject:</b> Re: [Nagios-users] e-mail
notifications not being sent<br></font><br></div><div><div></div><div class="h5">
<div></div>Maybe you have to replace the mail program by something on your
system, e.g. /usr/bin/mailx.<br>That's always one of the first things I change
in a new Nagios installation.<br>What OS are you using? Try to install the
required programs (mail/mailx...) if they can't be found in your system.<br><br>
<div class="gmail_quote">On Mon, Nov 21, 2011 at 8:25 PM, Kaplan, Andrew H. <span dir="ltr"><<a href="mailto:AHKAPLAN@partners.org" target="_blank">AHKAPLAN@partners.org</a>></span>
wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"><u></u>
<div>
<p><font face="Arial" size="2">Hi there --</font> </p>
<p><font face="Arial" size="2">I completed the installation of Nagios 3.3.1, and I
am going through the testing process. The server is able to successfully
monitor</font></p>
<p><font face="Arial" size="2">our various clients, but e-mail notifications for
critical conditions are not being sent to the intended recipient. The e-mail
server that</font></p>
<p><font face="Arial" size="2">is on the Nagios server is the Postfix message
transfer agent. </font></p>
<p><font face="Arial" size="2">The troubleshooting steps that I have taken so far
are the following:</font> </p>
<p><font face="Arial" size="2">1. I have been able to send a test e-mail from the
Nagios server to the intended recipient using two different mail commands. The
test </font></p>
<p><font face="Arial" size="2"> e-mail was done from the command
line using the mail and mailx commands using the command syntax:</font> </p>
<p><font face="Arial" size="2">mail <e-mail address> < /etc/fstab
</font><br><font face="Arial" size="2">mailx -s "test" <e-mail address> <
/etc/fstab</font> </p>
<p><font face="Arial" size="2">2. I checked the contacts.cfg file, and confirmed
the intended recipient is listed with the correct address.</font> </p>
<p><font face="Arial" size="2">3. I checked the nagios.log, and there were entries
that were similar to the following:</font> </p>
<p><font face="Arial" size="2">[1321385615] Warning: Attempting to execute the
command "/usr/bin/printf "%b" "***** Nagios 2.6 *****\n\nNotification Type:
PROBLEM\nHost: ... Date/Time: Tue Nov 15 14:33:35 EST 2011\n" | </font></p>
<p><font face="Arial" size="2">/bin/mail -…<e-mail address>" resulted in a
return code of 127. Make sure the script or binary you are trying to
execute actually exists…</font></p>
<p><font face="Arial" size="2">I did a search for the mail binary, and there was
none at that location. To correct the problem, I created a symbolic that
pointed to the actual </font></p>
<p><font face="Arial" size="2">location of the mail binary which was located at
the /usr/bin/ folder.</font> </p>
<p><font face="Arial" size="2">4. As far as I can tell, all hosts have e-mail
notifications enabled on them.</font> </p>
<p><font face="Arial" size="2">What other steps do I need to take in order to get
e-mail notifications to work here?</font> </p>
<p><font face="Arial" size="2">Thanks. </font></p><br><font face="monospace"><br><br>The information in this e-mail is intended only for the
person to whom it is<br>addressed. If you believe this e-mail was sent to you
in error and the e-mail<br>contains patient information, please contact the
Partners Compliance HelpLine at<br><a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was
sent to you in error<br>but does not contain patient information, please
contact the sender and properly<br>dispose of the
e-mail.</font></div><br>------------------------------------------------------------------------------<br>All
the data continuously generated in your IT infrastructure<br>contains a
definitive record of customers, application performance,<br>security threats,
fraudulent activity, and more. Splunk takes this<br>data and makes sense of
it. IT sense. And common sense.<br><a href="http://p.sf.net/sfu/splunk-novd2d" target="_blank">http://p.sf.net/sfu/splunk-novd2d</a><br>_______________________________________________<br>Nagios-users
mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
:::
Please include Nagios version, plugin version (-v) and OS when reporting any
issue.<br>::: Messages without supporting info will risk being sent to
/dev/null<br></blockquote></div><br></div></div></div>
<br>------------------------------------------------------------------------------<br>
All the data continuously generated in your IT infrastructure<br>
contains a definitive record of customers, application performance,<br>
security threats, fraudulent activity, and more. Splunk takes this<br>
data and makes sense of it. IT sense. And common sense.<br>
<a href="http://p.sf.net/sfu/splunk-novd2d" target="_blank">http://p.sf.net/sfu/splunk-novd2d</a><br>_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br></blockquote></div><br>