Closed cornernote closed 6 years ago
I realised I didnt have $CONTACTEMAIL$
in my command.
Should be:
define command {
command_name notify-host-by-gmail
command_line echo "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\nDate/Time: $LONGDATETIME$" | /usr/bin/mail -s "** Nagios $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
define command {
command_name notify-service-by-gmail
command_line echo "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nDate/Time: $LONGDATETIME$\nAdditional Info: $SERVICEOUTPUT$" | /usr/bin/mail -s "** Nagios $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Now I get emails! Woohoo!
Hello,
It seems that out of the box it doesn't send emails. I have been fiddling for a while looking for a solution that works and can't seem to find anything.
Are you able to put together an example of how you get it to send email?
I added this to
Dockerfile
:Then added to config:
I'm not sure how to check what's wrong, but I'm not getting emails.
I get an email if I do this: