Email notifications not being sent
Posted: Fri Jan 25, 2019 5:46 am
Hi, I am brand new to Nagios and I have installed Nagios Core on an Ubuntu 18.04 VM and enabled notifications to send via email. However, I do not receive email notifications. I installed Sendmail and can successfully send a test email to my own email. Any help/advice given would be truly appreciative.
Contents from my contacts.cfg
Contents from my commands.cfg
Contents from my contacts.cfg
Code: Select all
define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin
}
define contact {
contact_name nagios
alias nagios
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
email [email protected]
}Code: Select all
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "Subject: $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$\n\n***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/sbin/sendmail -v [email protected]
}
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "Subject: $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$\n\n***** 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 -v [email protected]
}