Page 1 of 1

Email alerts have no subject (solved)

Posted: Tue Jun 05, 2012 12:08 pm
by mehetmet
Hello,

I just upgraded to Nagios 3.4.1 from 3.2.3 and got up and running pretty much without issue. However, all of the notifications being sent no longer have subjects in the emails. here are the commands in my commands.cfg file:

Code: Select all

# 'notify-host-by-email' command definition
define command{
        command_name    notify-host-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/sbin/sendmail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
        }

# 'notify-service-by-email' command definition
define command{
        command_name    notify-service-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/sbin/sendmail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
        }
Anything wrong here? Any ideas?

Re: Email alerts have no subject

Posted: Tue Jun 05, 2012 12:09 pm
by mehetmet
Forgot to include, running Debian 6.0.5 (squeeze)

Re: Email alerts have no subject

Posted: Tue Jun 05, 2012 12:36 pm
by mehetmet
Nevermind, i got it ---stupid stupid!

we also swtiched from fedora to debian (as noted above), but did not have mailutils and was using /usr/bin/sendmail instead of /usr/bin/mail because of this.


an "apt-get install mailutils" later and a change in the commands script and we are all good!