From e7e6a33e73d8bb7c5c1e47b5477ee561d6fb5ccd Mon Sep 17 00:00:00 2001 From: Prashant Bhandari Date: Fri, 5 May 2017 13:23:55 -0700 Subject: [PATCH] When getting all monitors set parameter "with_downtimes" to true Change in Datadog api requires this parameter to correctly report if monitor is silenced --- dogpush/dogpush.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dogpush/dogpush.py b/dogpush/dogpush.py index 99a6567..bc091c9 100755 --- a/dogpush/dogpush.py +++ b/dogpush/dogpush.py @@ -139,12 +139,13 @@ def _canonical_monitor(original, default_team=None, **kwargs): def get_datadog_monitors(): - monitors = datadog.api.Monitor.get_all() + monitors = datadog.api.Monitor.get_all(with_downtimes="true") if CONFIG['dogpush']['ignore_prefix'] is not None: monitors = [ m for m in monitors if not m['name'].startswith(CONFIG['dogpush']['ignore_prefix']) ] + if not _check_monitor_names_unique(monitors): raise DogPushException( 'Duplicate names found in remote datadog monitors.')