Skip to content

Instantly share code, notes, and snippets.

Avatar

Baskar Puvanathasan baskarp

  • Toronto, ON
View GitHub Profile
@baskarp
baskarp / create_pagerduty_overrides.rb
Created Jan 20, 2012
Ruby script to create overrides in PagerDuty.
View create_pagerduty_overrides.rb
#!/usr/bin/env ruby
# Ruby script to create overrides in PagerDuty.
#
# Copyright (c) 2011, 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:
# * Redistributions of source code must retain the above copyright
@baskarp
baskarp / pagerduty_nagios.pl
Created Jul 20, 2012
PagerDuty Nagios plug-in with support for FLAPPINGSTART and FLAPPINGSTOP
View pagerduty_nagios.pl
#!/usr/bin/env perl
# Nagios plugin that sends Nagios events to PagerDuty.
#
# Copyright (c) 2011, 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:
View gist:9edcf42df94823bd3effb8283f6dce69
CMDB:
I do not have names on specific commentors. These notes have been re-ordered to make a bit more sense.
We have dynamic environments, with information coming from systems and builds.
Systems need configuration from runtime data based on service discovery and build configuration (IP addresses, versions, etc).
CMDB use contexts:
On call users - The sysadmin who has been paged at 4 am needs to determine context for the page.
Deployment systems - To know where to deploy software, what version(s) to deploy, etc.
Maintenance - Downtimes, escalate, software versions, hardware info...
@baskarp
baskarp / gist:3291141
Created Aug 8, 2012
How to setup Python command line tool for PagerDuty
View gist:3291141
Here is a quick instructions on how to setup the Python command line tool for PagerDuty.
1) You'll need to have Python installed (tested with Python 2.6.1)
2) Verify if Python setuptools are installed
python -c "import setuptools;print 'OK';"
if you don't see output "OK", then setuptools are not installed.
To install setuptools, download setuptools (http://pypi.python.org/pypi/setuptools/) appropriate to your Python major version. ("python --version" to get the version number).
View active_directory_import.ps1
Import-Module ActiveDirectory
#Import users via the PD API, echo results
function POST_Request ($url,$parameters, $api_key) {
$http_request = New-Object -ComObject Msxml2.XMLHTTP
$http_request.open('POST', $url, $false)
$http_request.setRequestHeader("Content-type", "application/json")
$token = "Token token=" + $api_key
$http_request.setRequestHeader("Authorization", $token)
$http_request.setRequestHeader("Content-length", $parameters.length)
@baskarp
baskarp / PagerDuty_Migration.js
Created Jan 14, 2016 — forked from jlrjr/PagerDuty_Migration.js
Migration script to move from legacy PagerDuty update set integration to the new Fuji ServiceNow store app
View PagerDuty_Migration.js
/*
* Must be run from backgroup script as a user with the elevated security_admin role
*/
// migrate incident id values
migrateIncidents();
// migrate group attributes from legacy update set application to the new Fuji store app
migrateGroups();
View pd_maintenance_windows.rb
#!/usr/bin/env ruby
# Ruby script to create recurring maintenance windows in PagerDuty
#
# 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:
# * Redistributions of source code must retain the above copyright
@baskarp
baskarp / mirror_incident.rb
Created Nov 2, 2012
Ruby script to mirror an email incident as an API incident in PagerDuty
View mirror_incident.rb
#!/usr/bin/env ruby
# Ruby script to mirror an email incident as an API incident
#
# Copyright (c) 2011, 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:
# * Redistributions of source code must retain the above copyright
@baskarp
baskarp / pagerduty.bat
Created Oct 29, 2012
Invoke PagerDuty using cURL from Windows
View pagerduty.bat
@echo off
:: Download cURL with SSL support from here: http://www.paehl.com/open_source/?CURL_7.28.0:
:: Extract curl.exe in the same directory as this bat file
:: Usage: pagerduty.bat service_key event_type description incident_key
:: event_types = (trigger | acknowledge | resolve)
::
set service_key=%1
set service_key=%service_key:"=\"%
set event_type=%2
set event_type=%event_type:"=\"%
@baskarp
baskarp / quick_ack.rb
Created Oct 29, 2012
A script to quickly ack a PagerDuty incident by incident number
View quick_ack.rb
#
#
# How to use this script:
#
# 1) You'll need to have Ruby installed on your machine.
# Follow these instructions to install Ruby on your machine: https://docs.google.com/document/pub?id=1Eo3f77CC1Flkb2f71ro-NZCYK2VuA6ajxvcuTGG_c6Q
#
# 2) Once Ruby is installed, run the following from your command prompt:
# gem install faraday --no-ri --no-rdoc
#
You can’t perform that action at this time.