Skip to content

Instantly share code, notes, and snippets.

View ryanhoskin's full-sized avatar

Ryan Hoskin ryanhoskin

View GitHub Profile
@ryanhoskin
ryanhoskin / PAGERDUTY_V6.xml
Last active May 11, 2019 21:15
ServiceNow Update Set for PagerDuty integration
<?xml version="1.0" encoding="UTF-8"?>
<unload unload_date="2015-01-30 16:06:32">
<sys_remote_update_set action="INSERT_OR_UPDATE">
<collisions/>
<commit_date/>
<deleted/>
<description>PagerDuty is a third-party system used to alerts individuals/teams when an important issue requires attention. The integration with ServiceNow focuses on finding an owner (assignee) for high priority incidents.
Integration is supported in both directions allowing incidents to be acknowledged, delegated (assigned to another group) and resolved in either system. The following work models are supported:
1. User uses PagerDuty for notification only. Once notified, he/she uses ServiceNow to assign, investigate, resolve the incident.
@ryanhoskin
ryanhoskin / Trigger PD Incident
Last active March 13, 2018 13:27
Trigger a PagerDuty incident in C#
using System;
using System.IO;
using System.Net;
using System.Text;
namespace Examples.System.Net
{
public class WebRequestPostExample
{
@ryanhoskin
ryanhoskin / pagerduty_check_mk.cfg
Created December 4, 2014 00:19
Check_MK PagerDuty Integration
define contact {
contact_name pagerduty
alias PagerDuty Pseudo-Contact
service_notification_period 24X7
host_notification_period 24X7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-pagerduty
host_notification_commands notify-host-by-pagerduty
pager YOUR-SERVICE-KEY-HERE
@ryanhoskin
ryanhoskin / get_incident_subjects.py
Created November 24, 2014 18:22
Get PagerDuty incidents and include the subject/description and dump them to a CSV
#!/usr/bin/env python
import requests
import sys
import json
import time
from datetime import date, timedelta
#Your PagerDuty API key. A read-only key will work for this.
AUTH_TOKEN = 'YOUR_API_TOKEN'
#!/usr/bin/env perl
# Nagios/Icinga plugin that sends Nagios/Icinga events to PagerDuty.
#
# Copyright (c) 2011-2012, PagerDuty, Inc. <info@pagerduty.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@ryanhoskin
ryanhoskin / trigger.ps1
Created November 21, 2014 21:58
Trigger a PagerDuty incident
#This script can trigger an incident in PagerDuty
#Hit the PagerDuty Integrations API, echo results
function POST_Request ($url,$parameters) {
$http_request = New-Object -ComObject Msxml2.XMLHTTP
$http_request.open('POST', $url, $false)
$http_request.setRequestHeader("Content-type", "application/json")
$http_request.setRequestHeader("Content-length", $parameters.length)
$http_request.setRequestHeader("Connection", "close")
$http_request.send($parameters)
#!/usr/bin/env python
#
# Python script to submit Zabbix events to PagerDuty. This script has
# been tested with Python 2.6.
#
# Copyright (c) 2012, PagerDuty, Inc. <info@pagerduty.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@ryanhoskin
ryanhoskin / pd-zabbix-proxy.py
Created October 24, 2014 15:41
zabbix pagerduty integration with a proxy
#!/usr/bin/env python
#
# Python script to submit Zabbix events to PagerDuty. This script has
# been tested with Python 2.6.
#
# Copyright (c) 2012, PagerDuty, Inc. <info@pagerduty.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#!/usr/bin/env python
import requests
import sys
import json
from datetime import date, timedelta
#Your PagerDuty API key. A read-only key will work for this.
AUTH_TOKEN = 'YOUR_API_KEY'
#The API base url, make sure to include the subdomain
@ryanhoskin
ryanhoskin / reassign_incidents.py
Created June 24, 2014 15:40
Reassign PagerDuty incidents
#!/usr/bin/env python
import json
import requests
SUBDOMAIN='pdt-dank'
API_ACCESS_KEY='HjEs6A6KozribnKqm1tX'
REQUESTER_ID='PJR28TQ'
INCIDENT_ID='PBI9MB9'