forked from lazyfrosch/icinga2-telegram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
icinga2-example.conf
85 lines (69 loc) · 2.16 KB
/
icinga2-example.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* User
*/
object User "johndoe" {
import "generic-user"
display_name = "John Doe"
// The telegram chat ID
vars.telegram_chat_id = "ID"
}
/*
* Notifications
*/
apply Notification "telegram-icingaadmin" to Host {
import "mail-host-notification"
command = "telegram-host-notification"
users = [ "johndoe" ]
assign where host.name
}
apply Notification "telegram-icingaadmin" to Service {
import "mail-service-notification"
command = "telegram-service-notification"
users = [ "johndoe" ]
assign where host.name
}
/*
* Notification Commands
*/
object NotificationCommand "telegram-host-notification" {
import "plugin-notification-command"
command = [ SysconfDir + "/icinga2/scripts/telegram-host-notification.sh" ]
env = {
NOTIFICATIONTYPE = "$notification.type$"
HOSTNAME = "$host.name$"
HOSTALIAS = "$host.display_name$"
HOSTADDRESS = "$address$"
HOSTSTATE = "$host.state$"
LONGDATETIME = "$icinga.long_date_time$"
HOSTOUTPUT = "$host.output$"
NOTIFICATIONAUTHORNAME = "$notification.author$"
NOTIFICATIONCOMMENT = "$notification.comment$"
HOSTDISPLAYNAME = "$host.display_name$"
TELEGRAM_BOT_TOKEN = TelegramBotToken
TELEGRAM_CHAT_ID = "$user.vars.telegram_chat_id$"
// optional
ICINGAWEB2_URL = "https://icinga.example.com/icingaweb2"
}
}
object NotificationCommand "telegram-service-notification" {
import "plugin-notification-command"
command = [ SysconfDir + "/icinga2/scripts/telegram-service-notification.sh" ]
env = {
NOTIFICATIONTYPE = "$notification.type$"
SERVICEDESC = "$service.name$"
HOSTNAME = "$host.name$"
HOSTALIAS = "$host.display_name$"
HOSTADDRESS = "$address$"
SERVICESTATE = "$service.state$"
LONGDATETIME = "$icinga.long_date_time$"
SERVICEOUTPUT = "$service.output$"
NOTIFICATIONAUTHORNAME = "$notification.author$"
NOTIFICATIONCOMMENT = "$notification.comment$"
HOSTDISPLAYNAME = "$host.display_name$"
SERVICEDISPLAYNAME = "$service.display_name$"
TELEGRAM_BOT_TOKEN = TelegramBotToken
TELEGRAM_CHAT_ID = "$user.vars.telegram_chat_id$"
// optional
ICINGAWEB2_URL = "https://icinga.example.com/icingaweb2"
}
}