---
title: "PRTG integration for Grafana IRM | Grafana Cloud documentation"
description: "Configure PRTG integration for Grafana IRM to receive network monitoring alerts"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# PRTG integration for Grafana IRM

The PRTG integration for Grafana IRM handles ticket events sent from PRTG webhooks. The integration provides grouping, auto-acknowledge and auto-resolve logic via customizable alert templates.

## Configure Grafana IRM to receive alerts from PRTG

1. In Grafana IRM, navigate to **IRM &gt; Integrations &gt; Monitoring Systems**
2. Click **+ New integration**
3. Select **PRTG** from the list of available integrations
4. Enter a name and description for the integration, click **Create**
5. A new page will open with the integration details. Copy the **IRM Integration URL** from **HTTP Endpoint** section

## Configure PRTG to send alerts to Grafana IRM

PRTG can use the script to send the alerts to Grafana IRM. Please use the format below

Body Fields Format:

plaintext ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```plaintext
alert_uid [char][not required] - unique alert ID for grouping;
title [char][not required] - title;
image_url [char][not required] - url for image attached to alert;
state [char][not required] - could be "ok" or "alerting", helpful for auto-resolving;
link_to_upstream_details [char][not required] - link back to your monitoring system;
message [char][not required] - alert details;
```

### PowerShell script example

ps1 ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```ps1
# This script sends alerts from PRTG to Grafana IRM
Param(
  [string]$sensorid,
  [string]$date,
  [string]$device,
  [string]$shortname,
  [string]$status,
  [string]$message,
  [string]$datetime,
  [string]$linksensor,
  [string]$url
)

# PRTG Server
$PRTGServer = "localhost:8080"
$PRTGUsername = "irm"
$PRTGPasshash  = *****

#Directory for logging
$LogDirectory = "C:\temp\prtg-notifications-msteam.log"

#Acknowledgement Message for alerts ack'd via Teams
$ackmessage = "Problem has been acknowledged via IRM."

# the acknowledgement URL
$ackURL = [string]::Format("{0}/api/acknowledgealarm.htm?id={1}&ackmsg={2}&username={3}&passhash={4}",
$PRTGServer,$sensorID,$ackmessage,$PRTGUsername,$PRTGPasshash);

# Autoresolve an alert in IRM
if($status -eq "Up")
{ $state = "ok" }
ElseIf($status -match "now: Up")
{ $state = "ok" }
ElseIf($status -match "Up (was:")
{ $state = "ok" }
Else
{ $state = "alerting" }

$image_datetime = [datetime]::parse($datetime)
$sdate = $image_datetime.AddHours(-1).ToString("yyyy-MM-dd-HH-mm-ss")
$edate = $image_datetime.ToString("yyyy-MM-dd-HH-mm-ss")

$image_url = "$PRTGServer/chart.png?type=graph&graphid=-1&avg=0&width=1000&height=400
&username=$PRTGUsername&passhash=$PRTGPasshash&id=$sensorid&sdate=$sdate&edate=$edate"

$Body = @{
            "alert_uid"="$sensorid $date";
            "title"="$device $shortname $status at $datetime ";
            "image_url"=$image_url;
            "state"=$state;
            "link_to_upstream_details"="$linksensor";
            "message"="$message";
            "ack_url_get"="$ackURL"
} | ConvertTo-Json
$Body

try
{ Invoke-RestMethod -uri $url -Method Post -body $Body -ContentType 'application/json; charset=utf-8'; exit 0; }
Catch
{
    $ErrorMessage = $_.Exception.Message
    (Get-Date).ToString() +" - "+ $ErrorMessage | Out-File -FilePath $LogDirectory -Append
    exit 2;
}
```

## Related topics

- [Grafana IRM integrations overview](/docs/grafana-cloud/alerting-and-irm/irm/integrations/alert-sources)
- [Alert escalation and routing](/docs/grafana-cloud/alerting-and-irm/irm/escalation-and-routing)
- [PRTG Network Monitor documentation](https://www.paessler.com/manuals/prtg/)
