This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:loop | |
@echo off | |
date /t >> test_mx.log | |
time /t >> test_mx.log | |
nslookup -type=MX foo.pagerduty.com >> test_mx.log | |
time /t >> test_mx.log | |
nslookup -type=MX foo.pagerduty.com 8.8.8.8 >> test_mx.log | |
time /t >> test_mx.log | |
nslookup -type=MX -d2 foo.pagerduty.com >> test_mx.log | |
time /t >> test_mx.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pd_headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" | |
$pd_headers.Add("Authorization", 'Token token=<rest_api_token>') | |
$pd_url = "https://<subdomain>.pagerduty.com/api/v1" | |
$requester_id = "<requester_id>" | |
$incident_id = "<incident_id>" | |
$duration = "900" //in seconds | |
$data = @{ | |
requester_id="$requester_id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Nagios alerts with a custom subject line that includes the HOSTNAME, SERVICESTATE, SERVICEDESC, HOSTSTATE and PagerDuty incident status fields. | |
$messages = json_decode($HTTP_RAW_POST_DATA); | |
if ($messages) foreach ($messages->messages as $webhook) { | |
$service = $webhook->data->incident->service->name; | |
$description = $webhook->data->incident->trigger_summary_data->subject." ".$webhook->data->incident->trigger_summary_data->description; | |
$status = $webhook->data->incident->status; | |
$link = $webhook->data->incident->html_url; | |
$emailAddress = ($webhook->type == "incident.resolve" ? $webhook->data->incident->last_status_change_by->email : $webhook->data->incident->assigned_to_user->email); | |
$body = "PagerDuty Update\n\nAn incident has been $status.\n\nDetails: $description on service $service\n\nClick here for more details: $link\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get the latest activity for all users within a PagerDuty account. | |
#This script is not supported by PagerDuty. | |
#!/usr/bin/env python | |
import datetime | |
import requests | |
import sys | |
#Your PagerDuty API key. A read-only key will work for this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2011-2013, 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 | |
# notice, this list of conditions and the following disclaimer. | |
# * Redistributions in binary form must reproduce the above copyright | |
# notice, this list of conditions and the following disclaimer in the | |
# documentation and/or other materials provided with the distribution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import datetime | |
import requests | |
import sys | |
import json | |
from urllib import urlencode | |
#Your PagerDuty API key. A read-only key will work for this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import datetime | |
import requests | |
import sys | |
import json | |
from urllib import urlencode | |
# How many notifications had to be escalated past the primary, due to lack of response? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import datetime | |
import requests | |
import sys | |
import json | |
from urllib import urlencode | |
# How many notifications had to be escalated past the primary, due to lack of response? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define command { | |
command_name notify-service-by-pagerduty | |
command_line /usr/local/bin/pagerduty_icinga.pl enqueue -f pd_nagios_object=service -f CONTACTPAGER="$CONTACTPAGER$" -f NOTIFICATIONTYPE="$NOTIFICATIONTYPE$" -f HOSTNAME="$HOSTNAME$" -f SERVICEDESC="$SERVICEDESC$" -f SERVICESTATE="$SERVICESTATE$" | |
} | |
define command { | |
command_name notify-host-by-pagerduty | |
command_line /usr/local/bin/pagerduty_icinga.pl enqueue -f pd_nagios_object=host -f CONTACTPAGER="$CONTACTPAGER$" -f NOTIFICATIONTYPE="$NOTIFICATIONTYPE$" -f HOSTNAME="$HOSTNAME$" -f HOSTSTATE="$HOSTSTATE$" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |