Code Monkey home page Code Monkey logo

prtgtopagerdutyapi's Introduction

PRTGtopagerdutyAPI

This is ment to be the simplest Powershell script that will allow PRTG notifications to be sent to pagerduty via the events V2 API and auto resolve incidents that resolve within PRTG. I created this script because there is no native integration between PRTG and pagerduty except email. Hopefully this helps others as well =).

Setup Instructions

Powershell

Make sure you have the latest version of powershell installed on the PRTG monitoring server.

In pagerduty

Follow the pagerduty documentation to "Create a Generic Events API Integration" for the Events API V2. (https://support.pagerduty.com/docs/services-and-integrations) This will give you a routing Key/ integration key for use later (this authenticates PRTG to the API).

In PRTG Network Monitor

  1. On your server, navigate to C:\Program Files (x86)\PRTG Network Monitor\Notifications\EXE and place the file named “prtgtopagerduty.ps1” in this directory.
  2. Log into your PRTG web interface.
  3. Navigate to "Setup" > "Account Settings" > "Notification Templates".
  4. Click "Add Notification Template" from the blue "+" symbol.
  5. Give the Template a name and update the following fields:
  • Method Always notify ASAP, never summarize
  • Toggle "Execute Program"
  • Program File: Select the Prtgtopagerduty.ps1 from the drop down.
  • Parameters: -API_URL 'https://events.pagerduty.com/v2/enqueue' -ROUTING_KEY 'Put your pagerduty routing key here' -Sensor %sensorid% -SiteName '%sitename' -Device '%device - %name' -DeviceId '%deviceid' -Name '%name' -Status '%status' -Down '%down' -DateTime '%datetime' -LinkDevice '%linkdevice' -Message '%message'
  1. click save.
  2. Test the notification.
  3. Use the Notification Template for the items you want to send to Pagerduty =). You can also test the notificaitons after they have been assigned to a sensor by using the "Simulate Error Status" on the sesonr.

prtgtopagerdutyapi's People

Contributors

brittandeyoung avatar sphr2k avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.