statuspage-notifications-configuration.conf 1.43 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
template Notification "statuspage-notifications-default-configuration" {
    types = [ Problem, Acknowledgement, Recovery, Custom,
              FlappingStart, FlappingEnd,
              DowntimeStart, DowntimeEnd, DowntimeRemoved ]

    user_groups = [ "icingaadmins" ]

    period = "24x7"

    interval = 5m

    vars.statuspage_notifications_api_url = "https://api.statuspage.io/v1/pages/your-pageid"
    vars.statuspage_notifications_api_key = "your-api-key"
    vars.statuspage_notifications_component_dictionary = {}
}

template Notification "statuspage-notifications-configuration" {
    import "statuspage-notifications-user-configuration"

    command = "statuspage-notifications-command"
}

Ryan Lee's avatar
Ryan Lee committed
23
template Notification "statuspage-notifications-default-configuration-services" {
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    import "statuspage-notifications-configuration"

    states = [ OK, Warning, Critical, Unknown ]
}

template Notification "statuspage-notifications-default-configuration-hosts" {
    import "statuspage-notifications-configuration"

    states = [ Up, Down ]
}

apply Notification "statuspage-notifications-notification-hosts" to Host {
  import "statuspage-notifications-user-configuration-hosts"

  assign where host.vars.statuspage_notifications == "enabled"
}

apply Notification "statuspage-notifications-notification-services" to Service {
  import "statuspage-notifications-user-configuration-services"

  assign where service.vars.statuspage_notifications == "enabled"
}