diff --git a/check_mk_web_api/__init__.py b/check_mk_web_api/__init__.py index 2341508..9f89a7a 100644 --- a/check_mk_web_api/__init__.py +++ b/check_mk_web_api/__init__.py @@ -149,7 +149,7 @@ def make_request(self, action, query_params=None, data=None): body = response.read().decode() - if body.startswith('Authentication error:'): + if re.match('(^Authentication error:|^Permission denied: Invalid automation secret)', body): raise CheckMkWebApiAuthenticationException(body) if 'output_format' in query_params and query_params['output_format'] == 'python':