12-20-2017, 03:30 AM
been banging my head for days on this one.
using gmail to send email, successfully ran the nems-mailtest without issue, email is sent and properly received at the destination.
however i'm getting zero emails from nagios. the closest clue i get is:
Dec 19 22:57:32 nems sendemail[14155]: ERROR => You must specify a 'from' field! Try --help.
this happens when i FORCE a custom notification. it also shows in the logs repeatedly as if every time it tries to send a standard notification it fails with the same error.
current /etc/nagios3/commands.cfg:
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b%b%b%b%b%b%b" \
"***** Nagios *****\n\n" \
"Notification Type: $NOTIFICATIONTYPE$\n" \
"Host: $HOSTNAME$\n" \
"State: $HOSTSTATE$\n" \
"Address: $HOSTADDRESS$\n" \
"Info: $HOSTOUTPUT$\n\n" \
"Date/Time: $LONGDATETIME$\n" \
| /usr/bin/sendemail -v -f actualemail@mydomain.com -s $USER7$ -xu $USER9$ -xp $USER10$ \
-l /var/log/sendemail \
-t $CONTACTEMAIL$ \
-u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
}
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b%b%b%b%b%b%b%b%b" \
"***** Nagios *****\n\n" \
"Notification Type: $NOTIFICATIONTYPE$\n\n" \
"Service: $SERVICEDESC$\n" \
"Host: $HOSTALIAS$\n" \
"Address: $HOSTADDRESS$\n" \
"State: $SERVICESTATE$\n\n" \
"Date/Time: $LONGDATETIME$\n\n" \
"Additional Info:\n\n" \
"$SERVICEOUTPUT$" \
| /usr/bin/sendemail -v -f actualemail@mydomain.com -s $USER7$ -xu $USER9$ -xp $USER10$ \
-l /var/log/sendemail \
-t $CONTACTEMAIL$ \
-u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **"
}
Note that in the above, I have also tried $USER5$ as the -f configured parameter. No good. I added -v in my attempts to get more verbose output, but this also seems to have made no change.
At a loss at this point.
using gmail to send email, successfully ran the nems-mailtest without issue, email is sent and properly received at the destination.
however i'm getting zero emails from nagios. the closest clue i get is:
Dec 19 22:57:32 nems sendemail[14155]: ERROR => You must specify a 'from' field! Try --help.
this happens when i FORCE a custom notification. it also shows in the logs repeatedly as if every time it tries to send a standard notification it fails with the same error.
current /etc/nagios3/commands.cfg:
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b%b%b%b%b%b%b" \
"***** Nagios *****\n\n" \
"Notification Type: $NOTIFICATIONTYPE$\n" \
"Host: $HOSTNAME$\n" \
"State: $HOSTSTATE$\n" \
"Address: $HOSTADDRESS$\n" \
"Info: $HOSTOUTPUT$\n\n" \
"Date/Time: $LONGDATETIME$\n" \
| /usr/bin/sendemail -v -f actualemail@mydomain.com -s $USER7$ -xu $USER9$ -xp $USER10$ \
-l /var/log/sendemail \
-t $CONTACTEMAIL$ \
-u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
}
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b%b%b%b%b%b%b%b%b" \
"***** Nagios *****\n\n" \
"Notification Type: $NOTIFICATIONTYPE$\n\n" \
"Service: $SERVICEDESC$\n" \
"Host: $HOSTALIAS$\n" \
"Address: $HOSTADDRESS$\n" \
"State: $SERVICESTATE$\n\n" \
"Date/Time: $LONGDATETIME$\n\n" \
"Additional Info:\n\n" \
"$SERVICEOUTPUT$" \
| /usr/bin/sendemail -v -f actualemail@mydomain.com -s $USER7$ -xu $USER9$ -xp $USER10$ \
-l /var/log/sendemail \
-t $CONTACTEMAIL$ \
-u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **"
}
Note that in the above, I have also tried $USER5$ as the -f configured parameter. No good. I added -v in my attempts to get more verbose output, but this also seems to have made no change.
At a loss at this point.