commands-xmppnotify.conf 2.33 KB
Newer Older
1
template NotificationCommand "xmpp-notification-base" {
2
  command = [ ConfigDir + "/scripts/xmppnotify.py" ]
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

  arguments += {
    "-6" = "$notification_address6$"
    "-b" = "$notification_author$"
    "-c" = "$notification_comment$"
    "-d" = {
      required = true
      value = "$notification_date$"
    }
    "-i" = "$notification_icingaweb2url$"
    "-l" = {
      required = true
      value = "$notification_hostname$"
    }
    "-n" = {
      required = true
      value = "$notification_hostdisplayname$"
    }
    "-r" = {
      required = true
      value = "$notification_useremail$"
    }
    "-t" = {
      required = true
      value = "$notification_type$"
    }
29
30
31
    "-B" = {
      set_if = "$notification_brief$"
      }
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  }

  vars += {
    notification_address = "$address$"
    notification_address6 = "$address6$"
    notification_author = "$notification.author$"
    notification_comment = "$notification.comment$"
    notification_type = "$notification.type$"
    notification_date = "$icinga.long_date_time$"
    notification_hostname = "$host.name$"
    notification_hostdisplayname = "$host.display_name$"
    notification_useremail = "$user.vars.xmpp$"
  }
}

47
48
object NotificationCommand "xmpp-host-notification" {
  import "xmpp-notification-base"
49
50

  arguments += {
51
    "-4" = {
52
      required = true
53
      value = "$notification_address$"
54
    }
55
    "-o" = {
56
      required = true
57
      value = "$notification_hostoutput$"
58
    }
59
    "-s" = {
60
      required = true
61
      value = "$notification_hoststate$"
62
    }
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  }

  vars += {
    notification_hostoutput = "$host.output$"
    notification_hoststate = "$host.state$"
  }
}

object NotificationCommand "xmpp-service-notification" {
  import "xmpp-notification-base"

  arguments += {
    "-4" = "$notification_address$"
    "-e" = {
77
      required = true
78
      value = "$notification_servicename$"
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    }
    "-o" = {
      required = true
      value = "$notification_serviceoutput$"
    }
    "-s" = {
      required = true
      value = "$notification_servicestate$"
    }
    "-u" = {
      required = true
      value = "$notification_servicedisplayname$"
    }
  }

  vars += {
    notification_servicename = "$service.name$"
    notification_serviceoutput = "$service.output$"
    notification_servicestate = "$service.state$"
    notification_servicedisplayname = "$service.display_name$"
  }
}