<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:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @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:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.StileMessaggioDiPostaElettronica18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
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=IT link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Thank you very mach,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>so for “notify-by-email”
I sould add<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>|  /usr/bin/mail -s
"Service $HOSTALIAS$ alert for $SERVICEDESC$!" $CONTACTEMAIL$<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Right ?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>Tnx<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>Da:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Toto Capuccino
[mailto:shoktai@gmail.com] <br>
<b><span style='font-weight:bold'>Inviato:</span></b> venerd́ 27 gennaio 2006
11.23<br>
<b><span style='font-weight:bold'>A:</span></b> <st1:PersonName
ProductID="Nicola Agnelli" w:st="on">Nicola Agnelli</st1:PersonName><br>
<b><span style='font-weight:bold'>Cc:</span></b> Arno Lehmann; nagios-users@lists.sourceforge.net<br>
<b><span style='font-weight:bold'>Oggetto:</span></b> Re: R: R: [Nagios-users]
email notification problem</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>You should use the
variables to get more info :<br>
# 'host-notify-by-email' command definition<br>
define command{<br>
        command_name   
host-notify-by-email<br>
        command_line   
/usr/bin/printf "%b" "***** Nagios  *****\n\nNotification
Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
$HOSTADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /usr/bin/mail
-s <b><span style='font-weight:bold'>"Host $HOSTSTATE$ alert for
$HOSTNAME$!" $CONTACTEMAIL$</span></b><br>
        }<br>
<br>
<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>2006/1/27, <st1:PersonName ProductID="Nicola Agnelli"
w:st="on">Nicola Agnelli</st1:PersonName> <<a
href="mailto:nicola.agnelli@spiderwall.com"> nicola.agnelli@spiderwall.com</a>>:</span></font></span><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Thank you for answer,<br>
so the correct command should be: <br>
<br>
define command{<br>
>        
command_name    notify-by-email<br>
>        
command_line    /usr/bin/printf "%b" "*****
Nagios<br>
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:<br>
> $SERVICEDESC$\nHost: $HOSTALIAS$\nAdd$ | mail -s Notification<br>
>         }<br>
<br>
And<br>
<br>
define command{<br>
>        
command_name    host-notify-by-email<br>
>        
command_line    /usr/bin/printf "%b" "*****
Nagios <br>
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:<br>
> $HOSTSTATE$\nAddress: $$ | mail -s Notification<br>
>         }<br>
<br>
<br>
?<br>
<br>
Sorry for my questions but I'm new to nagios .. <br>
<br>
Nicola<br>
<br>
<br>
-----Messaggio originale-----<br>
Da: <a href="mailto:nagios-users-admin@lists.sourceforge.net">nagios-users-admin@lists.sourceforge.net</a><br>
[mailto:<a href="mailto:nagios-users-admin@lists.sourceforge.net">
nagios-users-admin@lists.sourceforge.net</a>] Per conto di Arno Lehmann<br>
Inviato: venerd́ 27 gennaio 2006 10.50<br>
A: <a href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</a><br>
Oggetto: Re: R: [Nagios-users] email notification problem <br>
<br>
Hello,<br>
<br>
On 1/27/2006 10:23 AM, <st1:PersonName ProductID="Nicola Agnelli" w:st="on">Nicola
 Agnelli</st1:PersonName> wrote:<br>
> Hello all,<br>
> i've the same problem, i've installed nagios 2.0 and all works good, but<br>
the<br>
> email notifications can't be send..<br>
<br>
The first step could be to modify your command_line to actually send a<br>
message. Usually, you use printf to create and format the output AND<br>
THEN pipe that output to your mail program.<br>
<br>
Like 'printf "somethning" | mail -s Notification ... <br>
<br>
Arno<br>
<br>
> my command is the default command:<br>
><br>
> define command{<br>
>        
command_name    notify-by-email<br>
>        
command_line    /usr/bin/printf "%b" "*****
Nagios <br>
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:<br>
> $SERVICEDESC$\nHost: $HOSTALIAS$\nAdd$<br>
>         }<br>
> And:<br>
> define command{<br>
>        
command_name    host-notify-by-email <br>
>        
command_line    /usr/bin/printf "%b" "*****
Nagios<br>
> *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:<br>
> $HOSTSTATE$\nAddress: $$<br>
>         }<br>
> <br>
> But I can't receive notifications mails..<br>
> Here are the nagios.log:<br>
><br>
> ....<br>
> [1138352948] HOST ALERT: w2k3-server;DOWN;SOFT;9;CRITICAL - Host<br>
Unreachable<br>
> (<a href="http://10.0.0.222"> 10.0.0.222</a>)<br>
> [1138352951] HOST ALERT: w2k3-server;DOWN;HARD;10;CRITICAL - Host<br>
> Unreachable (<a href="http://10.0.0.222">10.0.0.222</a>)<br>
> [1138352951] HOST NOTIFICATION:<br>
> nagios-admin;w2k3-server;DOWN;host-notify-by-email;CRITICAL - Host <br>
> Unreachable (<a href="http://10.0.0.222">10.0.0.222</a>)<br>
> ....<br>
><br>
> How can I resolve ?<br>
><br>
> Tnx all<br>
><br>
> nicola<br>
><br>
><br>
> -----Messaggio originale-----<br>
> Da: <a href="mailto:nagios-users-admin@lists.sourceforge.net">nagios-users-admin@lists.sourceforge.net</a><br>
> [mailto:<a href="mailto:nagios-users-admin@lists.sourceforge.net">nagios-users-admin@lists.sourceforge.net</a>
] Per conto di Arno<br>
Lehmann<br>
> Inviato: venerd́ 27 gennaio 2006 10.02<br>
> A: <a href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</a><br>
> Oggetto: Re: [Nagios-users] email notification problem <br>
><br>
> Hello,<br>
><br>
> On 1/27/2006 3:44 AM, test 123king wrote:<br>
><br>
>>I have set up nagios nagios-1.3-14.fc4 in my FC4 server, the only<br>
>>problem now is the email notification can't be send out. <br>
>>The original notify-by-email in misccommands.cfg file is like below:<br>
>># 'notify-by-email' command definition<br>
>>define command{<br>
>>command_name notify-by-email<br>
>>command_line /usr/bin/printf "%b" "***** Nagios
*****nnNotification <br>
>>Type: $NOTIFICATIONTYPE$nnService: $SERVIC<br>
>>EDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState:<br>
>>$SERVICESTATE$nnDate/Time: $DATETIME$nnAdditional Info:n<br>
>>n$OUTPUT$" | -s "** $NOTIFICATIONTYPE$ alert -
$HOSTALIAS$/$SERVICEDESC$ <br>
>>is $SERVICESTATE$ **" $CONTACTEMAIL$<br>
>>}<br>
>><br>
>>I changed it to :<br>
>># 'notify-by-email' command definition<br>
>>define command{<br>
>>command_name notify-by-email <br>
>>command_line /bin/mail "%b" "***** Nagios
*****nnNotification Type:<br>
>>$NOTIFICATIONTYPE$nnService: $SERVIC<br>
>>EDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState:<br>
>>$SERVICESTATE$nnDate/Time: $DATETIME$nnAddi tional Info:n <br>
>>n$OUTPUT$" | -s "** $NOTIFICATIONTYPE$ alert -
$HOSTALIAS$/$SERVICEDESC$<br>
>>is $SERVICESTATE$ **" $CONTACTEMAIL$<br>
>>}<br>
>><br>
>>Basically I replaced /usr/bin/printf with /bin/mail. <br>
><br>
><br>
> And you don't have a valid command line left: after the pipe, there<br>
> should be a program to read the output from mail. And your invocation of<br>
> mail looks a little... non-standard to me. <br>
><br>
><br>
>>In the /var/log/messages log I see the following error:<br>
>><br>
>><br>
>>Warning: Attempting to execute the command "/bin/mail
"%b" "***** Nagios<br>
>>*****nnNotification Type: RECOVERYnHost: Server-1nState: UPnAddress: <br>
>>10.100.1.79nInfo: PING OK - Packet loss = 0%, RTA = 0.76 msnnDate/Time:<br>
>>Thu Jan 26 17:48:21 EST 2006n" | -s "Host UP alert for
Server-OTM!"<br>
>><a href="mailto:sysadmin@www.com"> sysadmin@www.com</a> <mailto:<a
href="mailto:sysadmin@www.com">sysadmin@www.com</a>>" resulted in a
return code of<br>
>>127. Make sure the scri//pt or binary you are trying to execute
actually<br>
>>exists... <br>
><br>
><br>
> It's all there: the output from mail is piped to '-s' which, most<br>
> probably, is not installed on your system as an executable program in<br>
> the path.<br>
><br>
><br>
>>Any kind help is highly appreciated!! <br>
>><br>
><br>
><br>
> Why don't you try the original notification script and simply insert<br>
> your mail command between pipe and '-s'? The reason why it's missing, by<br>
> the way, is probably that configure couldn't identify your mailer. <br>
><br>
> Arno<br>
><br>
<br>
--<br>
IT-Service
Lehmann                    <a
href="mailto:al@its-lehmann.de">al@its-lehmann.de</a><br>
Arno
Lehmann                  <a
href="http://www.its-lehmann.de">http://www.its-lehmann.de </a><br>
<br>
<br>
<br>
-------------------------------------------------------<br>
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files<br>
for problems?  Stop!  Download the new AJAX search engine
that makes <br>
searching your log files as easy as surfing
the  web.  DOWNLOAD SPLUNK!<br>
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid%103432&bid#0486&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
</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">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting<br>
any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null <br>
<br>
__________ NOD32 1.1382 (20060127) Information __________<br>
<br>
This message was checked by NOD32 antivirus system.<br>
<a href="http://www.eset.com">http://www.eset.com</a><br>
<br>
<br>
<br>
<br>
------------------------------------------------------- <br>
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files<br>
for problems?  Stop!  Download the new AJAX search engine
that makes<br>
searching your log files as easy as surfing
the  web.  DOWNLOAD SPLUNK! <br>
<a href="http://sel.as-us.falkag.net/sel?cmdlnk&kid%103432&bid#0486&dat1642">http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642</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">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></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>