# PRTG

EvoHub receives PRTG sensor alerts through a notification template with **Execute HTTP Action**. A sensor going Down or Warning opens an EvoHub alert, and the sensor returning to Up resolves it.

## Set it up

:::steps
### Create the integration
In EvoHub, go to **On-Call → Integrations → + Add Integration**, choose **PRTG**, pick an **Escalation Policy** and click **Create Integration**. Copy the **Webhook URL**.
### Create a notification template
In PRTG, go to **Setup → Notification Templates → Add Notification Template** and enable **Execute HTTP Action**.
### Set the URL and method
Set **URL** to your webhook URL and **HTTP Method** to **POST**. GET sends no payload.
### Set the postdata
Paste the postdata below as it is. PRTG fills in the `%…` placeholders.
### Use it in triggers
Add the template to the notification triggers of the sensors (or groups and devices) that should page: a **State Trigger** for Down and Warning, and for Up so alerts resolve.
:::

Postdata:

```text
device=%device&sensor=%sensor&status=%laststatus&message=%message&priority=%priority&sensor_id=%sensorid
```

PRTG's HTTP action sends form-encoded data, which EvoHub reads directly. EvoHub also accepts the same fields as JSON.

> [!WARNING]
> Keep `sensor_id=%sensorid` in the postdata. EvoHub uses the sensor ID to match a recovery to its alert and to keep different sensors apart. Keep `priority=%priority` too — without it, a Down sensor is treated as the lowest priority.

## What EvoHub reads

| EvoHub alert | Taken from |
| --- | --- |
| Title | "`sensor` on `device` is `status`", for example "Ping on db-01 is Down". |
| Description | `message`. |
| Labels | `device`, `sensor`, `status`. |
| Fingerprint | `sensor_id`. |

### Severity

Severity comes from the sensor's status and its priority (PRTG's `%priority` renders as stars, `*` to `*****`; a digit 1–5 also works):

| Status | Priority | EvoHub severity |
| --- | --- | --- |
| Down | 5 stars | critical |
| Down | 4 stars | high |
| Down | 3 stars | medium |
| Down | 2 stars | low |
| Down | 1 star or missing | info |
| Warning | any | medium |
| any other status (except Up and Paused) | any | low |

Raise the priority of sensors whose failure should wake someone up.

## Resolve and deduplication

- A notification whose status is **Up** or **Paused** resolves the open alert for that sensor. EvoHub reads the current state from both `%laststatus` ("Down") and the longer `%status` form ("Up ended (now: Down)").
- Repeated Down or Warning notifications for a sensor whose alert is still open are recorded as **Retriggered**.

## Troubleshooting

- **Nothing arrives**: check that **HTTP Method** is POST and that the URL includes `?key=`. A `400` means the postdata has none of `device`, `sensor` or `sensor_id`.
- **All sensors collapse into one alert, or recoveries do not resolve**: `sensor_id=%sensorid` is missing from the postdata.
- **Alerts stay open**: add the template to the trigger for the Up state too.

## Related

- [Integrations overview](https://docs-dev.evohub.io/integrations-overview.md)
- [Zabbix](https://docs-dev.evohub.io/zabbix.md)
- [Escalation policies](https://docs-dev.evohub.io/escalation-policies.md)
