forked from NDrive/nagios-mattermost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mattermost.cfg
38 lines (36 loc) · 1.58 KB
/
mattermost.cfg
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
define contact {
contact_name mattermost
alias Mattermost
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
_mattermoste_url <MATTERMOSTE_URL>
_mattermoste_channel <MATTERMOSTE_CHANNEL>
_nagios_cgiurl <NAGIOS_CGIURL>
host_notification_commands notify-host-by-mattermost
service_notification_commands notify-service-by-mattermost
}
define command {
command_name notify-service-by-mattermost
command_line /usr/local/nagios/libexec/mattermost.py --cgiurl "$_CONTACTNAGIOS_CGIURL$" \
--url "$_CONTACTMATTERMOSTE_URL$" \
--channel "$_CONTACTMATTERMOSTE_CHANNEL$" \
--notificationtype "$NOTIFICATIONTYPE$" \
--hostalias "$HOSTNAME$" \
--hostaddress "$HOSTADDRESS$" \
--servicedesc "$SERVICEDESC$" \
--servicestate "$SERVICESTATE$" \
--serviceoutput "$SERVICEOUTPUT$"
}
define command {
command_name notify-host-by-mattermost
command_line /usr/local/nagios/libexec/mattermost.py --cgiurl "$_CONTACTNAGIOS_URL$" \
--url "$_CONTACTMATTERMOSTE_URL$" \
--channel "$_CONTACTMATTERMISTE_CHANNEL$" \
--notificationtype "$NOTIFICATIONTYPE$" \
--hostalias "$HOSTNAME$" \
--hostaddress "$HOSTADDRESS$" \
--hoststate "$HOSTSTATE$" \
--hostoutput "$HOSTOUTPUT$"
}