sendEmail perl script problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sandyspatil
Posts: 15
Joined: Tue Dec 07, 2010 6:31 am

sendEmail perl script problem

Post by sandyspatil »

Hi All,
I am using sendEmail.pl as a mail sender. I defined following commands for notification handler in commands.cfg ->
define command nd {
command_name notify-host-by-email
command_line /usr/local/bin/sendEmail -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n"
}

define command {
command_name notify-service-by-email
command_line /usr/local/bin/sendEmail -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$"
}

But the problem is I am not getting line breaks in my Emails. Instead of getting new line I got "n" in my mails. Can U help me in this so I will get well formatted Emails with line breaks.
Locked