I installed and configured Icinga2 with icingaweb2.
I added a test-host with a test-service: Let's call it "example.com".
This is the test-host:
/etc/icinga2/conf.d/hosts/example-com:
object Host "example-com" {
//Importiert die generische Host-Vorlage aus der template.conf
import "generic-host"
//IPv4 Adresse
address = "2xx.2xx.2xx.2xx"
//Angabe des Betriebssystemtyps
vars.os = "Linux OS"
vars.sla = "24x7"
}
Okay, then we have the service-configuration:
/etc/icinga2/conf.d/hosts/example-com/http.conf
object Service "http" {
import "generic-service"
host_name = "example-com"
check_command = "http"
vars.sla = "24x7"
}
Of course I added a new user group to /etc/icinga2/conf.d/users.conf
/**
* The example user 'icingaadmin' and the example
* group 'icingaadmins'.
*/
object User "icingaadmin" {
import "generic-user"
display_name = "Icinga 2 Admin"
groups = [ "icingaadmins", "linux-admins" ]
email = "[email protected]"
}
object UserGroup "icingaadmins" {
display_name = "Icinga 2 Admin Group"
}
object UserGroup "linux-admins" {
display_name = "Linux-Administrators"
}
Now I think I have to add the contact_groups to the host. But if I do that the config-check fails :-(
Thanks for your help :-)
You did not define any notification objects, referenced to host/service objects and linked to users and notification commands.
The sample configuration in conf.d/notifications.conf already provide an insight, although you should consider writing your own notification apply rules for hosts and services based on your notification type - be it mail, sms, etc. See using apply notification.
Verify notification objects bring added by invoking:
after config validation.
Thats why we write documentation, please read it:
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#notifications
http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/migration#manual-config-migration-hints-notifications