theoberlin
Goto Top

Icingaweb2 Notification Mails laufen nicht

Hallo zusammen,

ich habe folgendes Problem: Nach dem Austauch eines Servers auf dem mein Icinga2 Monitoring lief, laufen die Mail Notifications nicht mehr.

Ich hatte das ganze schon vor einem Jahr hier:
Alter Beitrag
Ist aber ins leere gelaufen. Vielleicht findet sich ja jetzt jemand.

echo "My message" | mail -s subject blablka@blababla.de  

Funkioniert. Das Emailsystem ist also eingerichtet.

Notifications.conf:
apply Notification "mail-icingaadmin" to Host {  
  import "mail-host-notification"  
 // user_groups = ["icingaadmins"] 
 // users = ["icingaadmin"] 
 user_groups = host.vars.notification.mail.groups
 users = host.vars.notification.mail.users

  interval = 30s
  period = "24x7"  
  //vars.notification_logtosyslog = true

  assign where host.vars.notification.mail
}

apply Notification "mail-icingaadmin" to Service {  
  import "mail-service-notification"  
 // user_groups = ["icingaadmins"] 
  user_groups = host.vars.notification.mail.groups
  users = host.vars.notification.mail.users

  interval = 1h
  period = "24x7"  
  //vars.notification_logtosyslog = true

  assign where host.vars.notification.mail
}

Commands.conf:
object NotificationCommand "mail-host-notification" {  
  import "plugin-notification-command"  

  command = [ SysconfDir + "/icinga2/scripts/mail-host-notification.sh" ]  

  env = {
    NOTIFICATIONTYPE = "$notification.type$"  
    HOSTALIAS = "$host.display_name$"  
    HOSTADDRESS = "$address$"  
    HOSTSTATE = "$host.state$"  
    LONGDATETIME = "$icinga.long_date_time$"  
    HOSTOUTPUT = "$host.output$"  
    NOTIFICATIONAUTHORNAME = "$notification.author$"  
    NOTIFICATIONCOMMENT = "$notification.comment$"  
    HOSTDISPLAYNAME = "$host.display_name$"  
    USEREMAIL = "$user.email$"  
  }
}

object NotificationCommand "mail-service-notification" {  
  import "plugin-notification-command"  

  command = [ SysconfDir + "/icinga2/scripts/mail-service-notification.sh" ]  

  env = {
    NOTIFICATIONTYPE = "$notification.type$"  
    SERVICEDESC = "$service.name$"  
    HOSTALIAS = "$host.display_name$"  
    HOSTADDRESS = "$address$"  
    SERVICESTATE = "$service.state$"  
    LONGDATETIME = "$icinga.long_date_time$"  
    SERVICEOUTPUT = "$service.output$"  
    NOTIFICATIONAUTHORNAME = "$notification.author$"  
    NOTIFICATIONCOMMENT = "$notification.comment$"  
    HOSTDISPLAYNAME = "$host.display_name$"  
    SERVICEDISPLAYNAME = "$service.display_name$"  
    USEREMAIL = "$user.email$"  
  }
}
Users.conf:
object User "icingaadmin" {  
  import "generic-user"  

  display_name = "Ich"  
  enable_notifications=true
  groups = [ "icingaadmins" ]  
  email = "blaempfänger@blablabla"  
  period = "24x7"  
  states = [OK, Warning, Critical, Unknown ]
  types = [Problem, Recovery]
}

object UserGroup "icingaadmins" {  
  display_name = "Icinga 2 Admin Group"  
}

Host Beispiel:
object Host "Exchangeserver 1"{  
import "generic-host"  
address = "xx.xx.xx.xx"  
vars.sla = "24x7"  
vars.os = "Windows"  

vars.notification["mail"] = {  
    /* The UserGroup `icingaadmins` is defined in `users.conf`. */
    groups = [ "icingaadmins" ]  
  }

}

Hat irgendjemand eine Idee oder einen Denkanstoß? Bzw. in welches Log ich gucken kann?

Content-Key: 5768249171

Url: https://administrator.de/contentid/5768249171

Printed on: April 23, 2024 at 06:04 o'clock