Hey,
im trying to configure a Mail notification for my Icinga2 version 2.8.1 on Ubuntu 18.04.04 LTS.
I went with the “official” Guide, but i still got the Problem, that i won´t get a notification via Mail.
Surprisingly, i do get a Mail notification, when Icinga2 requires an update.
Postfix and bsd-mailx are already installed.
Here are my config files:
notifications.conf
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
}
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
assign where host.vars.notification.mail
}
users.conf
object User "icingaadmin" {
import "generic-user"
display_name = "Icinga 2 Admin"
groups = [ "icingaadmins" ]
enable_notifications = true
states = [ OK, Warning, Critical ]
types = [ Problem, Recovery ]
email = "testmail@test.de"
}
object UserGroup "icingaadmins" {
display_name = "Icinga 2 Admin Group"
}
hosts.conf
object Host "vCenterServer" {
import "generic-host"
address = "10.***.***.**"
check_command = "hostalive"
vars.notification["mail"] = {
groups = [ "icingaadmins" ]
users = [ "icingaadmin" ]
}
}
I´m still an apprentice and doesn´t have much experience with Ubuntu in general.
Does anyone have an idea, if i missed something or is my configuration just wrong?