What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How can I automatically publish downtime to Statuspage.io?

Votes:

2

In order to publish an outage to Statuspage.io you can do the following:

1. You will need to get your API key to make the requests. https://developer.statuspage.io/#section/Authentication

Note: it's always a good idea to use an API key for a generic account!

2. Once you have your API key, you will want to set up your API call in PRTG. I am using a realtime incident as an example here but there are other types of incidents that can be triggered as well. See the documentation for other options: https://developer.statuspage.io/#operation/postPagesPageIdIncidents

Go to Setup -> Account Settings -> Notification Templates and create a new Template

Add a template

In the template, under the Execute HTTP Action you need to add the URL

https://api.statuspage.io/v1/pages/{page_id}/incidents?api_key=yourapikeyherexxxxxx

with your page id and API Key in it.

For the body of the POST request, you need to send the following:

{
  "incident": {
    "name": "string",
    "status": "string",
    "impact_override": "string",
    "scheduled_for": "2018-10-18T09:50:13Z",
    "scheduled_until": "2018-10-18T09:50:13Z",
    "scheduled_remind_prior": true,
    "scheduled_auto_in_progress": true,
    "scheduled_auto_completed": true,
    "metadata": null,
    "auto_transition_deliver_notifications_at_end": true,
    "auto_transition_deliver_notifications_at_start": true,
    "auto_transition_to_maintenance_state": true,
    "auto_transition_to_operational_state": true,
    "auto_tweet_at_beginning": true,
    "auto_tweet_on_completion": true,
    "auto_tweet_on_creation": true,
    "auto_tweet_one_hour_before": true,
    "backfill_date": "string",
    "backfilled": true,
    "body": "string",
    "components": {
      "component_id": "operational"
    },
    "component_ids": [
      "6vwkfff96rjk"
    ],
    "scheduled_auto_transition": true
  }
}

Execute Action

3. Once you've added this to the notification template, you need to add a trigger for it. The following should initiate the incident:

Add a trigger

That's it! Once you have this set up, PRTG should be able to open new incidents in your statuspage.io page when something goes down.

Remember, once the incident is open, you will have to close it by hand since you need the incident id to do this programmatically.


Note: PRTG sends data with the content-type "application/x-www-form-urlencoded" whereas the API of Statuspage expect it to be "application/json".

This leads to the response code 400 (bad request) and therefore it is necessary to use a custom script instead (stored under "C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE") with the Execute Program action.

custom-notification downtime status statuspage-io

Created on Oct 18, 2018 9:40:44 AM by  Greg Campion [Paessler Support]

Last change on May 17, 2022 11:29:33 AM by  Florian Lesage [Paessler Support]



11 Replies

Votes:

0

I cannot work out where to put my API key ? Is this also now out of date

The dates are 2018 and does the \V1\ part of the web address still valid ?

Created on Feb 12, 2019 8:36:49 PM



Votes:

0

Hi Mixxy,

You can pass the api key in as a query parameter to the URL:

Passing your API key in a query param

curl "https://api.statuspage.io/v1/pages/{page_id}/incidents?api_key=yourapikeyherexxxxxx"

Created on Feb 14, 2019 10:03:39 AM by  Greg Campion [Paessler Support]



Votes:

1

I followed your steps, but I continue to receive an HTTP 400 Bad Request message in PRTG. I am able to curl the URL, so I know my API key is working.

Do you have any tips or updates for getting this to work?

Created on Jun 23, 2020 1:26:06 PM



Votes:

0

Hi austincrider,
Did you test the URL in the browser of the corresponding PRTG Probe? If PRTG is displaying a HTTP 400 error, the browser of the probe should as well. If this is not the case, please contact us at [email protected] and send us screenshots of your settings as well as a support bundle containing the log files from PRTG, so we can take a closer look.

Created on Jun 24, 2020 6:50:02 AM by  Timo Dambach [Paessler Support]



Votes:

0

Hi Timo,

Thanks for the quick response. Can you point me in the direction of the PRTG Probe? I am not sure what you mean about testing it in the probe browser.

I noticed the original post uses JSON, but the information button next to the Execute HTTP Action Payload says JSON and XML are not support. Only application/x-www-form-urlencoded is supported.

Are there updated formatting instructions for the payload?

I would be happy to open a ticket for this if necessary.

Thanks!

Created on Jun 25, 2020 7:26:27 PM



Votes:

0

>>"Can you point me in the direction of the PRTG Probe? I am not sure what you mean about testing it in the probe browser."
- You either try to add the sensor to a device underneath the local probe or underneath a Remote probe. Please connect to the corresponding Server (the server running the PRTG probe) using RDP and open the browser here.

>>"I noticed the original post uses JSON, but the information button next to the Execute HTTP Action Payload says JSON and XML are not support. Only application/x-www-form-urlencoded is supported."
- Yes, you are right: JSON is not officially supported since JSON is not always reliable working as Postdata. JSON might work but we cannot ensure it to work in any case. However in case of statuspage.io we've tested this successfully.

Created on Jun 26, 2020 9:39:22 AM by  Timo Dambach [Paessler Support]



Votes:

0

Did you ever get this to work austincrider? I'm following the same instructions and getting the same results. It doesn't say it in the instructions above but I did swap out the id under "component_ids" with my component, but other than that I've tried leaving everything the same and tried entering custom strings or placeholders for various elements.

Created on Apr 13, 2021 8:57:27 PM



Votes:

0

UPDATE: in the HTTP Action template put:

URL: https://api.statuspage.io/v1/pages/{PAGE ID HERE}/incidents?api_key={API Key HERE}

in the payload put:

incident[name]= %device: %status &incident[body]=Body text that you want.

M@rtino

Created on Jul 15, 2021 10:30:08 PM



Votes:

0

Thanks for the update Martino, I was able to take what you had and also attach a component to the incident. What I would like to do is have it change the component's status to Partial Outage or Degraded Performance, but I'm not sure how to do this. I was also trying to have it automatically resolve the incident when the sensor came back up, but besides not knowing how to do that without it creating a new incident I decided automation wouldn't be best for that.

Here's what I did to tie the incident to a component: incident[name]= {whatever you want to name the incident} &incident[body]= {any info you want in the incident description - be aware your subscribers will see this} &incident[component_ids]= {your component ID}

Created on Sep 14, 2021 3:10:11 PM



Votes:

0

Hello, have you script to fix content-type "application/x-www-form-urlencoded" in "application/json" becouse in this moment I have got 400 error.

Created on Feb 10, 2023 2:23:08 PM



Votes:

0

Been a few months since the last comment with no answers. Not seeing any templates posted, am I missing something?

Created on May 21, 2023 1:59:42 AM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.