README.md 1.74 KB
Newer Older
1
2
3
4
XMPP Notify Plugin for Icinga 2 (should work with nagios etc.)

# Installation

Christian Tacke's avatar
Christian Tacke committed
5
6
7
8
* Copy `xmppnotify.py` to `/etc/icinga2/scripts/`
* Copy `xmppnotify.sample.cfg` to `/etc/xmppnotify.cfg`
  and enter xmpp credentials
* Copy `commands-xmppnotify.conf` to `/etc/icinga2/conf.d/`.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

# Icinga2 configuration

## Templates
    template Notification "xmpp-host-notification" {
      command = "xmpp-host-notification"

      states = [ Up, Down ]
      types = [ Problem, Acknowledgement, Recovery, Custom ]

      period = "24x7"
      interval = 8h

      vars += {
        notification_icingaweb2url = "https://monitoring.finnchristiansen.de/icingaweb2"
      }
    }

    template Notification "xmpp-service-notification" {
      command = "xmpp-service-notification"

      states = [ OK, Warning, Critical, Unknown ]
      types = [ Problem, Acknowledgement, Recovery, Custom ]

      period = "24x7"
      interval = 8h

      vars += {
        notification_icingaweb2url = "https://monitoring.finnchristiansen.de/icingaweb2"
      }
    }


## Notifications
    apply Notification "xmpp-icingaadmin" to Host {
      import "xmpp-host-notification"

      user_groups = host.vars.notification.xmpp.groups
      users = host.vars.notification.xmpp.users

      assign where host.vars.notification.xmpp
    }

    apply Notification "xmpp-icingaadmin" to Service {
      import "xmpp-service-notification"

      user_groups = host.vars.notification.xmpp.groups
      users = host.vars.notification.xmpp.users

      assign where host.vars.notification.xmpp
    }

## Users
    object User "icingaadmin" {
      import "generic-user"

      display_name = "Icinga Admin"
      groups = [ "icingaadmins" ]

      email = "foo@example.org"
      vars.xmpp = "bar@example.org"
    }