no newlines in notification emails ?

SCHAER Frederic frederic.schaer at cea.fr
Wed Oct 31 14:42:42 CET 2007


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20071031/1122200f/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at 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


More information about the Users mailing list