Git Product home page Git Product logo

pd-sdp-v2's Introduction

PD-SDP-V2

This repository contains a Python script (triggerPagerDuty.py) that can be used with the on-premise server version of ManageEngine's ServiceDesk Plus to send a JSON-formatted alert payload to a PagerDuty Events v2 API endpoint. This can either be a service-level endpoint or an endpoint associated with a Ruleset.

To create the necessary Events API routing key please consult the following PagerDuty documentation:

Test Environment

This Python script has been tested with the following configuration:

  • Windows Server 2016 Standard
  • Python 3.8.5
  • ServiceDesk Plus v11.1.0 Build 11129

Make sure the Python interpreter is added to the %PATH% system variable.

Installation

Copy the Python script to the following directory on the ServiceDesk Plus server:

C:\Program Files\ManageEngine\ServiceDesk\integration\custom_scripts

The script is designed to send events to PagerDuty that will trigger and resolve an incident. Modify the script adding the appropriate PagerDuty integration key. To minimize the number of scripts that need to be maintained, consider using a key associated with an event ruleset endpoint. The client_url should also be modified to include the FQDN of the local instance of ServiceDesk Plus.

The script uses a subset of the available parameters supplied by the ServiceDesk Plus V1 API. A full list of the parameters can be found in the ServiceDesk Plus Administration Guide.

The script is called via a new Incident Management Custom Trigger (see Admin | Incident Management | Custom Triggers). Two new Actions are required, one for when an new incident is created and another for when an incident is edited and the status is changed to Cancelled, Closed or Resolved. In both cases, give the Action a meaningful name and description.

Image 1a: Creating a new Custom Trigger in ServiceDesk Plus

For the action to create a new incident, 'Execute the Action' should be set to When a Request is created and Any Time. Then specify the criteria that must be met to perform the action. As a minimum the 'Request Type' should equal incident. Then set the 'Action Type' to Execute Script and specify the script to be run. By default these will be py triggerPagerDuty.py $COMPLETE_JSON_FILE.

Image 1a: Creating a new Custom Trigger in ServiceDesk Plus

For the Action to resolve an incident follow the instructions above but 'Execute the Action' should now be set to When a Request is edited and Any Time. Then specify the criteria that must be met to perform the action. This time, 'Status' is equal to Cancelled, Closed and Resolved.

Image 1b: Creating a new Custom Trigger in ServiceDesk Plus

To test the script, create a new Request (see Quick Actions | Create New | Incident).

Image 2: Create a new Request in ServiceDesk Plus

You can check the progress of the script by reviewing the History tab in the Request Details form. If the script executes successfully an incident will be created in your chosen PagerDuty service.

Image 3: The Incident in PagerDuty

Resolving the incident in ServiceDesk Plus will result in the incident being resolved in PagerDuty.

Futher Optimisations Within PagerDuty

Within PagerDuty a Ruleset can be used to triage and route the alert from ServiceDesk Plus making sure the most appropriate on-call responder is notified and any new actionable requests.

Values from the alert payload can be used to automatically set the incident priority in PagerDuty.

Image 4: The Incident in PagerDuty

Finally, use Dynamic Notifications to make sure responders are only contacted according to their high-urgency notification policy when the incident merits a real-time response.

Image 5: The Incident in PagerDuty

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.