<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>[root@mail4 ~]# echo "Hello world" | /bin/mail -s
"Test Email" root@localhost<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>[root@mail4 ~]# /etc/mail/sendmail.cf: line 0: cannot open: No
such file or directory<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>[root@mail4 ~]#<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I’m running postfix – not sure why it’s looking for sendmail.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Martin Melin
[mailto:mmelin@gmail.com] <br>
<b>Sent:</b> Thursday, October 01, 2009 11:01 AM<br>
<b>To:</b> nagios-users@lists.sourceforge.net<br>
<b>Subject:</b> Re: [Nagios-users] FW: Not sending e-mails<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>Try simply copying the
command_line for notify-service-by-email and running it in a shell yourself. Or
just do:<br>
# echo "Hello world" | /bin/mail -s "Test Email"
root@localhost<o:p></o:p></p>

<div>

<p class=MsoNormal>On Thu, Oct 1, 2009 at 8:28 PM, Scott Miller <<a
href="mailto:srmiller@interbel.net">srmiller@interbel.net</a>> wrote:<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
Scott Miller wrote:<br>
>> I know this has been hit over and over, and I've read literally<br>
everything I<br>
>> could find, but to no avail.  I have a newly install of Nagios
3.2.0 on a<br>
>> Fedora Core 8 with Postfix/Dovecot.  I have a modified script
(postfix<br>
mail<br>
>> queue monitor I shared a week or so ago).  The only thing Nagios
is doing<br>
on<br>
>> this box is looking at local services.  When I change any
threshold so I<br>
>> will go into alarm, it does, but no e-mails get sent out.<br>
>><br>
>> I can see in my logs the following when something comes into alarm:<br>
>><br>
>> [1254408621] SERVICE ALERT: localhost;Postfix Mail<br>
>> Queue;CRITICAL;SOFT;1;CRITICAL: Postfix mailq has 14 messages queued
for<br>
a<br>
>> total of 12492 Kbytes.<br>
>> [1254408651] SERVICE ALERT: localhost;Current Load;OK;SOFT;2;OK - load<br>
>> average: 4.87, 2.73, 1.43<br>
>> [1254408681] SERVICE ALERT: localhost;Postfix Mail<br>
>> Queue;CRITICAL;SOFT;2;CRITICAL: Postfix mailq has 16 messages queued
for<br>
a<br>
>> total of 12497 Kbytes.<br>
>> [1254408741] SERVICE ALERT: localhost;Postfix Mail<br>
>> Queue;CRITICAL;SOFT;3;CRITICAL: Postfix mailq has 16 messages queued
for<br>
a<br>
>> total of 12689 Kbytes.<br>
>> [1254408801] SERVICE ALERT: localhost;Postfix Mail<br>
>> Queue;CRITICAL;HARD;4;CRITICAL: Postfix mailq has 15 messages queued
for<br>
a<br>
>> total of 12494 Kbytes.<br>
>> [1254408801] SERVICE NOTIFICATION: nagiosadmin2;localhost;Postfix Mail<br>
>> Queue;CRITICAL;notify-service-by-email;CRITICAL: Postfix mailq has 15<br>
>> messages queued for a total of 12494 Kbytes.<br>
>> [1254408801] SERVICE NOTIFICATION: nagiosadmin;localhost;Postfix Mail<br>
>> Queue;CRITICAL;notify-service-by-email;CRITICAL: Postfix mailq has 15<br>
>> messages queued for a total of 12494 Kbytes.<br>
>><br>
>> Wondering if anyone could double check the pertinent parts of my
config?<br>
>><br>
>> Thanks in advance.<br>
>><br>
>> Scott Miller<br>
><br>
> What's in your mail log?  Nagios is trying to send notifications
using<br>
> the command you've defined, according to the logs. You haven't provided<br>
> the definition for that command (notify-service-by-email), but I assume<br>
> it's trying to send an email.<br>
><br>
> If you're using anything like the example commands that come with<br>
> Nagios, it is probably using something like "/bin/mail" to send
the<br>
> message, and your mail log would be a good place to look for why it's<br>
> not being delivered.<o:p></o:p></p>

</div>

</div>

<p class=MsoNormal>Sorry - didn't include that from the commands.cfg - Here's
what I have.<br>
<br>
commands.cfg<br>
============<br>
# 'notify-host-by-email' command definition<br>
define command{<br>
       command_name    notify-host-by-email<br>
       command_line    /usr/bin/printf
"%b" "***** Nagios<br>
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:<br>
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:<br>
$LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert:<br>
$HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$<br>
       }<br>
<br>
# 'notify-service-by-email' command definition<br>
define command{<br>
       command_name    notify-service-by-email<br>
       command_line    /usr/bin/printf
"%b" "***** Nagios<br>
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:<br>
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:<br>
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional<br>
Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$
Service<br>
Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$<br>
       }<br>
<br>
This is the exact same way I have it on another machine running checks for<br>
multiple boxes and devices.  The only difference, is this server is
running<br>
Postfix, the other (working) is running Sendmail.<br>
<br>
In my logs:<br>
/var/log/maillog - grep for nagios - there's nothing<br>
/var/log/messages shows<br>
Oct  1 10:53:20 mail4 nagios: SERVICE NOTIFICATION:<br>
nagiosadmin2;localhost;Postfix Mail<br>
Queue;CRITICAL;notify-service-by-email;CRITICAL: Postfix mailq has 13<br>
messages queued for a total of 3326 Kbytes.<br>
Oct  1 10:53:20 mail4 nagios: SERVICE NOTIFICATION:<br>
nagiosadmin;localhost;Postfix Mail<br>
Queue;CRITICAL;notify-service-by-email;CRITICAL: Postfix mailq has 13<br>
messages queued for a total of 3326 Kbytes.<br>
<br>
Looks like it's trying - maybe something in Postfix stoping it?  I'll have<br>
to do a bit more digging and testing.<br>
<span style='color:#888888'><br>
Scott Miller</span><o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><br>
<br>
<br>
------------------------------------------------------------------------------<br>
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA<br>
is the only developer event you need to attend this year. Jumpstart your<br>
developing skills, take BlackBerry mobile applications to market and stay<br>
ahead of the curve. Join us from November 9&#45;12, 2009. Register
now&#33;<br>
<a href="http://p.sf.net/sfu/devconf" target="_blank">http://p.sf.net/sfu/devconf</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<o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</body>

</html>