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
# 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: |
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
# 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 |
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
--- | |
rules: | |
suppress: | |
# array of rules of when to suppress | |
- match: | |
# ... properties to match |
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
{ | |
always: true, | |
alert: {...}, // the alert object | |
integration: {...}, // the integration object | |
event: string // the event name (ex: alert.resolved) | |
} |
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
# 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 |
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
import requests | |
pload = { | |
'event_type':'resolve', | |
'Id':'monitor-1' | |
} | |
r = requests.post('https://api.pagertree.com/int_xxxxxxx',data = pload) | |
print(r.text) |
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
import requests | |
pload = { | |
'event_type':'acknowledge', | |
'Id':'monitor-1' | |
} | |
r = requests.post('https://api.pagertree.com/int_xxxxxxx',data = pload) | |
print(r.text) |
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
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) |
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
# Ignore alerts that don't have "requests a call" | |
rules: | |
- match: | |
alert.description: | |
$regex: "requests a call" | |
$options: "i" | |
actions: | |
- type: setval | |
map: | |
urgency: high |