Created
November 30, 2016 10:18
-
-
Save adimania/29ec3dcad54fd4c3f28188e213b14d65 to your computer and use it in GitHub Desktop.
Zap for Datadog
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
api_key = <api_key> | |
application_key = <app_key> | |
monitors = requests.get("https://app.datadoghq.com/api/v1/monitor?api_key=%s&application_key=%s" % (api_key, application_key)).json() | |
bad_monitor = {'name':[]} | |
for monitor in monitors: | |
if monitor['overall_state'] == u'OK': | |
bad_monitor['name'].append(monitor['name']) | |
if bad_monitor['name']: | |
return [bad_monitor] | |
else: | |
return [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment