Your forum is not easy to use. it says, “Sorry new user can only put 2 links on the post.” There was not any links but i remove server addresses…
Thanks for your support,
log shows this, but i really cannot understand what should i add to notification.conf to make it send an email ?
[2019-05-31 18:41:00 +0300] information/Checkable: Checking for configured notifications for object ‘www4!ftp’
[2019-05-31 18:41:00 +0300] information/Checkable: Checkable ‘www4!ftp’ does not have any notifications.
hosts.conf
object Host “www4” {
address = “www4”
check_command = “hostalive”
}
object Service “http” {
host_name = “www4”
check_command = “http”
vars.notification[“mail”] = {
groups = [ “icingaadmins” ]
}
}
object Service “ssh” {
host_name = “www4”
check_command = “ssh”
vars.notification[“mail”] = {
groups = [ “icingaadmins” ]
}
}
object Service “ftp” {
host_name = “www4”
check_command = “ftp”
vars.notification[“mail”] = {
groups = [ “icingaadmins” ]
}
}
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” ]
email = “infofi”
}
object UserGroup “icingaadmins” {
display_name = “Icinga 2 Admin Group”
}
groups.conf
object HostGroup “linux-servers” {
display_name = “Linux Servers”
assign where host.vars.os == “Linux”
}
object HostGroup “windows-servers” {
display_name = “Windows Servers”
assign where host.vars.os == “Windows”
}
object ServiceGroup “ping” {
display_name = “Ping Checks”
assign where match(“ping*”, service.name)
}
object ServiceGroup “http” {
display_name = “HTTP Checks”
assign where match(“http*”, service.check_command)
}
object ServiceGroup “disk” {
display_name = “Disk Checks”
assign where match(“disk*”, service.check_command)
}