Email alerts have no subject (solved)

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
mehetmet
Posts: 11
Joined: Thu Dec 01, 2011 2:11 pm

Email alerts have no subject (solved)

Post 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?
Last edited by mehetmet on Wed Jun 06, 2012 7:15 am, edited 2 times in total.
mehetmet
Posts: 11
Joined: Thu Dec 01, 2011 2:11 pm

Re: Email alerts have no subject

Post by mehetmet »

Forgot to include, running Debian 6.0.5 (squeeze)
mehetmet
Posts: 11
Joined: Thu Dec 01, 2011 2:11 pm

Re: Email alerts have no subject

Post 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!
Locked