Hello,
Currently I am stuck and not sure why I am not getting emails sent to me correctly. I was asked to add some email notifications for some alerts and hosts and logs say they are being sent but I don’t see any emails coming through. Currently my test is limited to a single host notification. I am able to bring the host up and down as needed and have seen logs that messages were being sent with a completed message in the log.
Please see details of my icinga instance, I am running on centos7.5
icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.5-1)
I did enable debug and received the following output, I am manually trigger the notification through the web GUI.
[2019-10-15 02:16:44 +0000] notice/Notification: Attempting to send notifications for notification object ‘testhost!mail-icingaadmin’.
[2019-10-15 02:16:44 +0000] notice/Notification: Not checking notification filters for notification object ‘testhost!mail-icingaadmin’: Notification was forced.
[2019-10-15 02:16:44 +0000] notice/Notification: Not checking notification filters for notification object ‘testhost!mail-icingaadmin’ and user ‘icingaadmin’: Notification was forced.
[2019-10-15 02:16:44 +0000] information/Notification: Sending ‘Custom’ notification ‘testhost!mail-icingaadmin’ for user ‘icingaadmin’
[2019-10-15 02:16:44 +0000] debug/DbEvents: add notification history for ‘testhost’
[2019-10-15 02:16:44 +0000] debug/DbEvents: add contact notification history for service ‘testhost’ and user ‘icingaadmin’.
[2019-10-15 02:16:44 +0000] notice/Process: Running command ‘/etc/icinga2/scripts/mail-host-notification.sh’ ‘-4’ ‘testhost’ ‘-6’ ‘’ ‘-b’ ‘zareh’ ‘-c’ ‘testsetst’ ‘-d’ ‘2019-10-15 02:16:44 +0000’ ‘-l’ ‘testhost’ ‘-n’ ‘testhost’ ‘-o’ ‘PING OK - Packet loss = 0%, RTA = 0.26 ms’ ‘-r’ ‘icinga@localhost’ ‘-s’ ‘UP’ ‘-t’ ‘CUSTOM’ ‘-v’ ‘false’: PID 21002
[2019-10-15 02:16:44 +0000] information/Notification: Completed sending ‘Custom’ notification ‘testhost!mail-icingaadmin’ for checkable ‘testhost’ and user ‘icingaadmin’.
[2019-10-15 02:16:44 +0000] notice/Process: PID 21002 (‘/etc/icinga2/scripts/mail-host-notification.sh’ ‘-4’ ‘testhost’ ‘-6’ ‘’ ‘-b’ ‘zareeh’ ‘-c’ ‘testsetst’ ‘-d’ ‘2019-10-15 02:16:44 +0000’ ‘-l’ ‘testhost’ ‘-n’ ‘testhost’ ‘-o’ ‘PING OK - Packet loss = 0%, RTA = 0.26 ms’ ‘-r’ ‘icinga@localhost’ ‘-s’ ‘UP’ ‘-t’ ‘CUSTOM’ ‘-v’ ‘false’) terminated with exit code 0
I am able to receive emails when I run the script manually as below
/etc/icinga2/scripts/mail-host-notification.sh -d 10.10.10 -l test -n test -o test -r change@me.com -s FAIL -t problem
I am using the below apply statement with the following host configuration
apply Notification “mail-icingaadmin” to Host {
import “mail-host-notification”
user_groups = host.vars.notification.mail.groups
users = host.vars.notification.mail.users
//interval = 2h
vars.notification_logtosyslog = true
assign where host.vars.notification.mail
}
object Host “testhost” {
import “generic-host”
address = “testhost”
vars.notification[“mail”] = {
groups = [ “icingaadmins” ]
}
}
My group configuration looks like
object User “icingaadmin” {
import “generic-user”
enable_notifications = true
display_name = “Icinga 2 Admin”
groups = [ “icingaadmins” ]
email = “change@me.com”
}
object UserGroup “icingaadmins” {
display_name = “Icinga 2 Admin Group”
}
I feel like I am missing something very obvious, please let me know if any other information would be helpful. I am using postfix to send mail and echo "Test body" | mail -s "Subject" change@me.com
also works without issue. I checked our mailserver and do not see any messages coming from the server that are not manual test messages either and nothing getting sent to junk.
Thank you.