Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lfepp
lfepp / recurring_maintenance_windows.py
Last active May 3, 2023 03:58
Script to create a number of recurring maintenance windows in PagerDuty
#!/usr/bin/env python
#
# Copyright (c) 2016, 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
@lfepp
lfepp / get_schedule.rb
Created June 2, 2016 18:57
Script to retrieve information about a specific PagerDuty schedule
#!/usr/bin/env ruby
#
# Copyright (c) 2016, 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
@lfepp
lfepp / get_log_entry_details_file.rb
Created June 2, 2016 17:27
Script to retrieve detailed information about a specific PagerDuty log entry in a plain text file
#!/usr/bin/env ruby
#
# Copyright (c) 2016, 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
@lfepp
lfepp / get_incident_log_entries.rb
Created June 2, 2016 00:01
Script to retrieve all log entries from a PagerDuty incident
#!/usr/bin/env ruby
#
# Copyright (c) 2016, 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
@lfepp
lfepp / get_log_entry_details.rb
Last active June 1, 2016 23:59
Script to retrieve detailed information about a specific log entry in PagerDuty
#!/usr/bin/env ruby
#
# Copyright (c) 2016, 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
@lfepp
lfepp / trigger_incident_multiple_services.py
Created June 1, 2016 17:24
Trigger a PagerDuty incident within multiple services
#!/usr/bin/env python
#
# Copyright (c) 2016, 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
@lfepp
lfepp / get_recent_incidents.sh
Created May 26, 2016 22:11
Sample shell script to pull PagerDuty incidents that were triggerd within the given time period and are in currently queue
#!/bin/sh
#
# Copyright (c) 2016, 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
@lfepp
lfepp / incidents_in_service.rb
Created May 26, 2016 00:07
Sample script to pull all PagerDuty incidents from a service within a given time range and print the output to the file incidents_in_service.txt
#!/usr/bin/env ruby
#
# Copyright (c) 2016, 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
@lfepp
lfepp / get_incidents_csv.py
Created May 25, 2016 20:00
Sample script to output all PagerDuty incidents for a given time period to a CSV file (defaults to previous 24 hours)
#!/usr/bin/env python
#
# Copyright (c) 2016, 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
@lfepp
lfepp / get_incident_details_csv.py
Last active October 10, 2022 14:38
Output PagerDuty incident details to a CSV
#!/usr/bin/env python
#
# Copyright (c) 2016, 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