-
-
Save ronindesign/7015e244055c6e7ebab3 to your computer and use it in GitHub Desktop.
This file contains 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 User "pagerduty" { | |
pager = "SERVICE_KEY_HERE" | |
groups = [ "icingaadmins" ] | |
display_name = "PagerDuty Notification User" | |
states = [ OK, Warning, Critical, Unknown ] | |
types = [ Problem, Recovery ] | |
} | |
object NotificationCommand "notify-service-by-pagerduty" { | |
import "plugin-notification-command" | |
command = "/usr/share/pdagent-integrations/bin/pd-nagios -i \"event_source=service;host_name=$host.name$;service_desc=$service.name$\" -n service -k $user.pager$ -t $notification.type$ -f SERVICEDESC=$service.name$ -f SERVICESTATE=$service.state$ -f HOSTNAME=$host.name$ -f SERVICEOUTPUT=$s$" | |
} | |
object NotificationCommand "notify-host-by-pagerduty" { | |
import "plugin-notification-command" | |
command = "/usr/share/pdagent-integrations/bin/pd-nagios -i \"event_source=host;host_name=$host.name$\" -n host -k $user.pager$ -t $notification.type$ -f HOSTNAME=$host.name$ -f HOSTSTATE=$host.state$ -f HOSTOUTPUT=$host.output$" | |
} | |
apply Notification "pagerduty-service" to Service { | |
command = "notify-service-by-pagerduty" | |
states = [ OK, Warning, Critical, Unknown ] | |
types = [ Problem, Acknowledgement, Recovery ] | |
period = "24x7" | |
users = [ "pagerduty" ] | |
assign where service.vars.enable_pagerduty == true | |
} | |
apply Notification "pagerduty-host" to Host { | |
command = "notify-host-by-pagerduty" | |
states = [ Up, Down ] | |
types = [ Problem, Acknowledgement, Recovery ] | |
period = "24x7" | |
users = [ "pagerduty" ] | |
assign where host.vars.enable_pagerduty == true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added missing trailing " end quote to notify-service-bypagerduty command string.