diff --git a/action_plugins/uptime.py b/action_plugins/uptime.py index 17dc8fc012bf0b35d209539bc5f5413988b6da84..33b4becc5950b23b077bcf8cd35135d1372006c6 100644 --- a/action_plugins/uptime.py +++ b/action_plugins/uptime.py @@ -189,9 +189,10 @@ class ActionModule(ActionBase): self._request('checks/' + existing.get('_id'), existing, 'POST') - def _findExistingCheck(self, url, type): + def _findExistingCheck(self, url, type, tracker_source, tracker_project_include): for check in self.checks: - if (check.get('url') == url and check.get('type') == type): + pollerParams = check.get('pollerParams', []) + if (check.get('url') == url and check.get('type') == type and pollerParams.get('tracker_source', '') == tracker_source and pollerParams.get('tracker_project_include', '') == tracker_project_include): return check return False @@ -284,7 +285,9 @@ class ActionModule(ActionBase): def _processItem(self, host_vars, item, field): url = self._buildUrl(item, field) check = self._buildCheck(host_vars, item, url) - existing = self._findExistingCheck(url, check['type']) + tracker_source = check.get('tracker_source', '') + tracker_project_include = check.get('tracker_project_include', '') + existing = self._findExistingCheck(url, check['type'], tracker_source, tracker_project_include) if existing: if check['enabled']: self._updateCheck(existing, check)