Follow

Setting up a Webhook and an Alerting Endpoint

Note that this is legacy functionality. Available in Pingdom accounts created before June 27th 2016. New webhooks are available, configuration details here.

 

A webhook is a HTTP GET request being made instead an email or SMS/text alert.

Our webhooks consists of a JSON payload with some information about what went wrong.

To set up a webhook you need to either add a new Alerting Endpoint, add a new contact method to an existing Alerting Endpoint, add a new User or add a new contact method to an existing User.

We are going to set up a new Alerting Endpoint with only the webhook as a contact method for a requestb.in.

First you need to get the URL that we are going to send the messages tIf you are testing things out you can use a service such as http://requestb.in to get a URL to use here.

Then we set up the Alerting Endpoint

  1. Navigate to Alerting > Alerting Endpoints.
  2. Click ADD ALERTING ENDPOINT, up in the right corner.
  3. Give it a name
  4. Click ADD CONTACT METHOD
  5. Select URL/WEBHOOK
  6. Enter the webhook URL you got earlier
  7. Save these settings

Next up, we are going to attach this Alerting Endpoint to an Alert Policy

  1. Navigate to Alerting > Alert Policies
  2. Either
    • Open an existing Alert Policy for editing
    • Create a new Alert Policy
  3. Start typing the name of the above created Alerting Endpoint in either the assignment field or the CC field
  4. Set a delay for this Alert Policy
  5. Save the settings

Next step is where we connect the Alert Policy to a check

  1. Navigate to Monitoring > Uptime
  2. Open a check for editing
  3. Make sure you are using Incident Alerts
  4. Select the recently edited/created Alert Policy
  5. Click Modify Check to save the settings

If you want to test the webhook, set up a check and point it to a URL that doesn't exist, or a site that gives an error code (example.com/404 is a good one), until you have gotten an alert.

  1. When an incident is assigned to you Message data:
    • "check": "12345"
    • "checkname": "My Pingdom Check"
    • "host": "example.com"
    • "action": "assign"
    • "incidentid": 123
    • "description": "down"
  2. When an incident alert is sent to a User/Endpoint on CC
    • "check": "12345"
    • "checkname": "My Pingdom Check"
    • "host": "example.com"
    • "action": "notify_user"
    • "incidentid": 123
    • "description": "down"
  3. When an incident previously assigned to you is reassigned to someone else Message data:
    • "check": "12345"
    • "checkname": "My Pingdom Check"
    • "host": "example.com"
    • "action": "reassign"
    • "incidentid": 123
    • "description": "down"
  4. When an incident is closed, either automatically or manually Message data:
    • "check": "12345"
    • "checkname": "My Pingdom Check"
    • "host": "example.com"
    • "action": "notify_of_close"
    • "incidentid": 123
    • "description": "up"
Was this article helpful?
2 out of 3 found this helpful