[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nagios-users
Subject:    [Nagios-users] no newlines in notification emails ?
From:       "SCHAER Frederic" <frederic.schaer () cea ! fr>
Date:       2007-10-31 13:42:42
Message-ID: EA04FF699CD5274E9EC52CB5EC05087096349B () DIODON ! extra ! cea ! fr
[Download RAW message or body]

--===============1655847500==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C81BC3.E8F01E63"

This is a multi-part message in MIME format.


Hi,

 

Using nagios 3.0b5, I have the following notification command defined :

 

define command{

        command_name    notify-by-email

        command_line    /usr/bin/printf "check went wrong on host
$HOSTALIAS$\nService : $SERVICEDESC$\nCheck Command
:$SERVICECHECKCOMMAND$\nOutput summary : $

SERVICEOUTPUT$\nLong output : $LONGSERVICEOUTPUT$\n" | /bin/mail -s
'$SERVICESTATE$ alert for $HOSTALIAS$/$SERVICEDESC$' $CONTACTEMAIL$

        }

 

When I receive an email, This is what I get :

check went wrong on host xxx Service : firewall Check Command
:check_nrpe_firewall Output summary : Connection refused by host Long
output :

 

Is it me or are the \n stripped ? Are you also facing this with 3.0b5 ?

trying the same kind of printf | mail command on the nagios host sends
me a mail with newlines, so I doubt it's the host software that's having
a problem here...

 

Regards

Frederic


[Attachment #3 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
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 11 (filtered medium)">
<style>
<!--
 /* 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:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal;
	font-family:Arial;
	color:windowtext;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=FR link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Using nagios 3.0b5, I have the following notification
command defined&nbsp;:<o:p></o:p></span></font></p>

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

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

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
command_name&nbsp;&nbsp;&nbsp; notify-by-email<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
command_line&nbsp;&nbsp;&nbsp; /usr/bin/printf &quot;check went wrong on host
$HOSTALIAS$\nService : $SERVICEDESC$\nCheck Command
> $SERVICECHECKCOMMAND$\nOutput summary : $<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>SERVICEOUTPUT$\nLong output :
$LONGSERVICEOUTPUT$\n&quot; | /bin/mail -s '$SERVICESTATE$ alert for
$HOSTALIAS$/$SERVICEDESC$' $CONTACTEMAIL$<o:p></o:p></span></font></p>

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

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

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>When I receive an email, This is what I get \
:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New"'>check went wrong on host xxx
Service : firewall Check Command :check_nrpe_firewall Output summary :
Connection refused by host Long output :</span></font><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></font></p>

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

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Is it me or are the \n stripped ? Are you also facing
this with 3.0b5 ?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>trying the same kind of printf | mail command on the
nagios host sends me a mail with newlines, so I doubt it&#8217;s the host
software that&#8217;s having a problem here&#8230;<o:p></o:p></span></font></p>

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

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

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

</div>

</body>

</html>


[Attachment #4 (--===============1655847500==)]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic