forked from seffparker/icinga2-teams-notification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
teams-notifications-configuration.conf
68 lines (51 loc) · 2.14 KB
/
teams-notifications-configuration.conf
1
2
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
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
template Notification "teams-notifications-default-configuration" {
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd ]
# DowntimeStart, DowntimeEnd, DowntimeRemoved ]
vars.users_fallback = [ "icingaadmin" ]
period = "24x7"
# interval = 10m
vars.teams_notifications_plugin_output_max_length = 3500
vars.teams_notifications_color = {
"OK" = "#32CD32",
"WARNING" = "#FF8C00",
"CRITICAL" = "#FF0000",
"UNKNOWN" = "#6A5ACD",
"UP" = "#32CD32",
"DOWN" = "#FF0000"
}
}
template Notification "teams-notifications-configuration" {
import "teams-notifications-user-configuration"
command = "teams-notifications-command"
}
template Notification "teams-notifications-default-configuration-services" {
import "teams-notifications-configuration"
states = [ OK, Warning, Critical, Unknown ]
}
template Notification "teams-notifications-default-configuration-hosts" {
import "teams-notifications-configuration"
states = [ Up, Down ]
}
apply Notification "teams-notifications-notification-hosts" to Host {
import "teams-notifications-user-configuration-hosts"
interval = (host.vars.notification.interval) || 10m
assign where host.vars.notification.teams == true
}
apply Notification "teams-notifications-notification-services" to Service {
import "teams-notifications-user-configuration-services"
interval = (service.vars.notification.interval) || 10m
assign where host.vars.notification.teams == true && service.vars.notification.teams != false
}
template Notification "teams-notifications-user-configuration" {
import "teams-notifications-default-configuration"
users = (host.vars.notify_users) || vars.users_fallback
vars.teams_notifications_webhook_url = "$user.vars.teams_webhook_url$"
vars.teams_notifications_icinga2_base_url = "http://mycompanyname.com/icingaweb2"
}
template Notification "teams-notifications-user-configuration-hosts" {
import "teams-notifications-default-configuration-hosts"
}
template Notification "teams-notifications-user-configuration-services" {
import "teams-notifications-default-configuration-services"
}