Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object NotificationCommand "notify-host-by-pagerduty" {
- import "plugin-notification-command"
- command = "/usr/local/bin/pagerduty_icinga.pl enqueue -f pd_nagios_object=host"
- env = {
- "CONTACTPAGER" = "$user.pager$"
- "NOTIFICATIONTYPE" = "$notification.type$"
- "HOSTNAME" = "$host.name$"
- "HOSTALIAS" = "$host.display_name$"
- "HOSTSTATE" = "$host.state$"
- "HOSTOUTPUT" = "$host.output$"
- }
- }
- object User "pagerduty" {
- import "generic-user"
- groups = [ "icingaadmins" ]
- pager = "32charkeyhere---------"
- }
- object Host "ubuntu-base-14-test-monitor" {
- address = "10.13.7.166"
- check_command = "hostalive"
- vars.sla = "24x7"
- check_interval = 30
- retry_interval = 15
- vars.os = "Linux"
- vars.enable_pagerduty = true
- }
- template Notification "notify-host-by-pagerduty" {
- command = "notify-host-by-pagerduty"
- states = [ Up, Down ]
- types = [ Problem, Acknowledgement, Recovery, Custom, FlappingStart, FlappingEnd, DowntimeStart, DowntimeEnd, DowntimeRemoved ]
- period = "24x7"
- }
- apply Notification "pagerduty-host" to Host {
- command = "notify-host-by-pagerduty"
- states = [ Up, Down ]
- types = [ Problem, Acknowledgement, Recovery, Custom ]
- period = "24x7"
- users = [ "pagerduty" ]
- assign where host.vars.enable_pagerduty == true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement