I have a CentOS 7 machine stood up running an Icinga2 master with several hosts reporting. I have checked out a multitude of topics and cannot seem to find a resolution to my issue. When forcing a custom notification, I receive a mail notification, however, if something goes to critical, Icingaweb2 says it sent a notification but I never receive one. I have looked at many posts over the last couple of days but cannot find a resolution.
I have also read over the notification & notification command documentation but cannot seem to find the cause of my misstep.
Here are some examples of my configuration:
notification template:
template Notification "mail-host-notification" {
command = "mail-host-notification"
interval = 15m
states = [ Up, Down ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
vars += {
// notification_icingaweb2url = "https://www.example.com/icingaweb2"
notification_from = "Icinga 2 Host Monitoring <email_changed>"
notification_logtosyslog = false
}
period = "24x7"
}
/**
* Provides default settings for service notifications.
* By convention all service notifications should import
* this template.
*/
template Notification "mail-service-notification" {
command = "mail-service-notification"
interval = 15m
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
vars += {
// notification_icingaweb2url = "https://www.example.com/icingaweb2"
notification_from = "Icinga 2 Service Monitoring <email_changed>"
notification_logtosyslog = false
}
period = "24x7"
}
host example, all configured the same:
object Host "hostname_changed" {
import "generic-host"
address = "123.123.123.123"
vars.agent_endpoint = "hostname_changed"
vars.os_type = "windows"
vars.notification["mail"] = {
groups = [ "icingaadmins" ]
}
}
apply rules for notifications
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
command_endpoint = host.vars.agent_endpoint
assign where host.vars.notification.mail
}
apply Notification "mail-icingaadmin" to Service {
import "mail-service-notification"
user_groups = host.vars.notification.mail.groups
users = host.vars.notification.mail.users
//interval = 2h
vars.notification_logtosyslog = true
command_endpoint = host.vars.agent_endpoint
assign where host.vars.notification.mail
}
user I configured
object User "username_hidden" {
display_name = "displayname_hidden"
enable_notifications = true
states = [ OK, Warning, Critical ]
types = [ Problem, Recovery ]
email = "email_hidden"
groups = [ "icingaadmins" ]
vars.notification["mail"] = {
groups = [ "icingaadmins" ]
users = [ "icingaadmins", "username_hidden" ]
}
}
object UserGroup "icingaadmins" {
display_name = "Icinga 2 Admin Group"
}