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
""" | |
Script to update on-call groups based on pagerduty escalation policies | |
From: https://gist.github.com/markddavidoff/863d77c351672345afa3fd465a970ad6 | |
Slack permissions required: | |
- Installer must be able to update user groups. | |
- usergroups:read | |
- usergroups:write | |
- users:read | |
- users:read.email |
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
#!/bin/bash | |
# Adapted from a puppet pre-commit hook at: | |
# http://blog.snijders-it.nl/2011/12/example-puppet-27-git-pre-commit-script.html | |
# | |
# install this as .git/hooks/pre-commit to check DNS zone files | |
# for errors before committing changes. | |
rc=0 | |
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
import copy | |
from pynsot.client import get_api_client() | |
api = get_api_client() | |
site = api.sites(api.default_site) | |
objects = site.networks.get(network_address='192.168.0.0')['data']['networks'] | |
to_update = copy.deepcopy(objects) | |
[t['attributes'] = {} for t in to_update] # Strip the attributes |
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
from __future__ import unicode_literals | |
""" | |
Loader for Trigger NetDevices using NSoT API. | |
Right now this loads ALL devices ALL the time, which scales very poorly with | |
the number of devices and attributes in NSoT. | |
To use this: |