Created Notify_pagertree (markdown)

master
Chris Caron 2023-02-16 18:58:25 -05:00
parent 6f9e03440b
commit c59589d66a
1 changed files with 70 additions and 0 deletions

70
Notify_pagertree.md Normal file

@ -0,0 +1,70 @@
## Pagertree Notifications
* **Source**: https://www.pagerduty.com
* **Icon Support**: No
* **Attachment Support**: Yes
* **Message Format**: Text
* **Message Limit**: 32768 Characters per message
1. For this to work, you'll need to signup for a [PagerTree](https://pagertree.com) account (free trial is fine). Make sure you follow the setup wizard (you'll want to be on-call for the team the integration is pointed to in Step 2)
2. Create a [webhook integration](https://pagertree.com/docs/integration-guides/webhook) and point it to the team (default: "Devops Team")
3. From the integration page, copy the integration Prefix ID (used for the apprise url)
![image](https://user-images.githubusercontent.com/9020194/217587441-cfbf0f43-f736-4b9d-85dc-18acc6cc418c.png)
4. Use the Prefix ID for the apprise URL `./bin/apprise -t test -b message "pagertree://int_xxxxxxxxxx"`
### Syntax
Valid syntax is as follows:
* `pagerduty://{integration}@{api_key}`
* `pagerduty://{integration}@{api_key}/{source}`
* `pagerduty://{integration}@{api_key}/{source}/{component}`
### Parameter Breakdown
| Variable | Required | Description
| ----------- | -------- | -----------
| integration | Yes | This is provided to you on the Events API V2 integration's detail page. This can also be referred to as a Routing Key.
| api_key | Yes | The API Key associated with your setup
| group | No | Provide a group (string) as part of the payload
| class | No | Provide a class (string) as part of the payload
| region | No | By default this takes on the value of **us**. But you can optionally set it to **eu** as well.
| source | No | Provide a source (string) as part of the payload; the default is **Apprise** if one isn't specified.
| component | No | Provide a component (string) as part of the payload; the default is **Notification** if one isn't specified.
| click | No | Provide a clickable URL to associate with the notice.
| image | No | Associate the notification status via a represented icon. You can set this value to `no` if you do not want this to occur.
| severity | No | The notification severity is otherwise detected on it's own, however if you wish to force a specific mode always, you can do so by providing this as part of the URL. Possible values are: `info`, `warning`, `critical`, and `error`.
#### Example
Send a Pager Duty trigger to our **source** `node01.local` and the **component** `drive_sda`
```bash
# Assuming our {integration_key} is A1BRTD4JD
# Assuming our {api_key} is TIiajkdnlazkcOXrIdevi7F
# Assuming our {source} is node01.local
# Assuming our {component} is drive_sda
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"pagerduty://A1BRTD4JD@TIiajkdnlazkcOXrIdevi7F/node01.local/drive_sda/"
```
### Custom Details
You can provide custom details as part of the payload as well. This can be accomplished by just sticking a plus symbol (**+**) in front of any parameter you specify on your URL string.
```bash
# Below would pass along in the `custom_details` payload of the API
# "disk_space_left": "145GB"
#
# Assuming our {integration_key} is abc123
# Assuming our {api_key} is 98754
# Assuming our {source} is node01.local
# Assuming our {component} is drive_sda
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"pagerduty://abc123@98754/node01.local/drive_sda/?+disk_space_left=145GB"
# Multiple details just require more entries defined:
# Below would set the custom details to:
# "disk_space_left": "145GB"
# "disk_space_total": "500GB"
#
# Assuming our {integration_key} is abc123
# Assuming our {api_key} is 98754
# Assuming our {source} is node01.local
# Assuming our {component} is drive_sda
apprise -vv -t "Test Message Title" -b "Test Message Body" \
"pagerduty://abc123@98754/node01.local/drive_sda/?+disk_space_left=145GB&"+disk_space_total=500GB"
```