Skip to content

Instantly share code, notes, and snippets.

{{#if ctx.alert.meta.incident}}
[{{ctx.alert.meta.incident_severity}}] Incident #{{ctx.alert.tinyId}}
{{{ctx.alert.meta.incident_message}}}
{{{sanitize ctx.alert.title}}}
{{else}}
Alert #{{ctx.alert.tinyId}} {{{sanitize ctx.alert.title}}}
{{/if}}
{{#if (and ctx.bridge (or ctx.bridge.phone (eq ctx.bridge.host "pagertree")))}}
{{#if ctx.alert.meta.incident}}Incident{{else}}Alert{{/if}} {{ctx.alert.tinyId}}. {{#if ctx.alert.meta.incident}}{{ctx.alert.meta.incident_severity}}. {{{ctx.alert.meta.incident_message}}}.{{/if}}{{{sanitize ctx.alert.title}}}.
Push {{default (get "account.notification_templates.alert_alert.voice.acknowledge" ctx) 1}} to acknowledge or {{default (get "account.notification_templates.alert_alert.voice.reject" ctx) 2}} to reject.
# To switch the channel url the message is sent to.
rules:
- match:
alert.d_team_id: "tem_xxx" # Apps Team
actions:
- type: setval
map:
webhook_url: "https://hooks.slack.com/services/aaa/bbb/ccc" # apps channel webhook
- match:
# example rule showing how to suppress the outgoing webhook of any alert that is not 'critical'
rules:
- match:
alert.urgency:
$ne: critical
actions:
- type: ignore
# Example rules for the "Slack (Post to Channel)" integration
# To switch the channel the message is sent to.
# Note this won't work with private channels
rules:
- match:
alert.d_team_id: "tem_xxx" # Apps Team
actions:
- type: setval
map:
channel: "C3QCH7S7C" # apps channel
---
rules:
suppress:
# array of rules of when to suppress
- match:
# ... properties to match
{
always: true,
alert: {...}, // the alert object
integration: {...}, // the integration object
event: string // the event name (ex: alert.resolved)
}
import requests
pload = {
'event_type':'resolve',
'Id':'monitor-1'
}
r = requests.post('https://api.pagertree.com/int_xxxxxxx',data = pload)
print(r.text)
import requests
pload = {
'event_type':'acknowledge',
'Id':'monitor-1'
}
r = requests.post('https://api.pagertree.com/int_xxxxxxx',data = pload)
print(r.text)
import requests
pload = {
'event_type':'create',
'Id':'monitor-1',
'Title': 'Monitor 1 is Down for 60s',
'Description': 'Please check the monitor @ https://this.url'
}
r = requests.post('https://api.pagertree.com/int_xxxxxxx',data = pload)
print(r.text)