3

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 = "me@example123.com"
}

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 :-)

Tombart
  • 2,013
  • 3
  • 27
  • 47
MyFault
  • 893
  • 3
  • 14
  • 35

2 Answers2

5

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:

icinga2 object list --type Notification 

after config validation.

Tombart
  • 2,013
  • 3
  • 27
  • 47
dnsmichi
  • 845
  • 5
  • 12
-4

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

lazyfrosch
  • 790
  • 4
  • 10
  • Hm, I read this - but I did not find the error in my conf. – MyFault Jun 19 '15 at 15:26
  • Well you said you tried to add contact_group to your host, that is wrong - you need to create/apply a Notification to tell Icinga 2 how to notify whom for what object and event. – lazyfrosch Jun 21 '15 at 10:49