Created
August 21, 2015 14:57
-
-
Save DirkHeinke/8389ab3eb5a971581607 to your computer and use it in GitHub Desktop.
icinga2 slack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object NotificationCommand "slack-overlayr-host-notification" { | |
import "plugin-notification-command" | |
command = [ "/usr/local/bin/slack_nagios.pl" ] | |
arguments = { | |
"-field" = "slack_channel=#general" | |
} | |
env = { | |
ICINGA_HOSTALIAS = "$host.display_name$" | |
ICINGA_HOSTSTATE = "$host.state$" | |
ICINGA_HOSTOUTPUT = "$host.output$" | |
ICINGA_NOTIFICATIONTYPE = "$notification.type$" | |
} | |
} | |
object NotificationCommand "slack-overlayr-service-notification" { | |
import "plugin-notification-command" | |
command = [ "/usr/local/bin/slack_nagios.pl" ] | |
arguments = { | |
"-field" = "slack_channel=#general" | |
} | |
env = { | |
ICINGA_HOSTALIAS = "$host.display_name$" | |
ICINGA_SERVICEDESC = "$service.display_name$" | |
ICINGA_SERVICESTATE = "$service.state$" | |
ICINGA_SERVICEOUTPUT= "$service.output$" | |
ICINGA_NOTIFICATIONTYPE = "$notification.type$" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply Notification "slack-overlayr" to Host { | |
import "slack-overlayr-host-notification" | |
users = [ "icingaadmin" ] | |
assign where host.name.contains("overlayr") | |
} | |
apply Notification "slack-overlayr" to Service { | |
import "slack-overlayr-service-notification" | |
users = [ "icingaadmin" ] | |
assign where host.name.contains("overlayr") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template Notification "slack-overlayr-host-notification" { | |
command = "slack-overlayr-host-notification" | |
states = [ Up, Down ] | |
types = [ Problem, Acknowledgement, Recovery, Custom, | |
FlappingStart, FlappingEnd, | |
DowntimeStart, DowntimeEnd, DowntimeRemoved ] | |
period = "24x7" | |
} | |
template Notification "slack-overlayr-service-notification" { | |
command = "slack-overlayr-service-notification" | |
states = [ OK, Warning, Critical, Unknown ] | |
types = [ Problem, Acknowledgement, Recovery, Custom, | |
FlappingStart, FlappingEnd, | |
DowntimeStart, DowntimeEnd, DowntimeRemoved ] | |
period = "24x7" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment