Module: check_mk
Branch: master
Commit: d0285d8c80fb6097cafaef6d24c0c458d198c013
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d0285d8c80fb60…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Apr 11 18:55:19 2019 +0200
improved agent response in case of incorrect credentials
CMK-1889
Change-Id: Id9a7c955cacce6b306b987076e4df4b1176bbdb9
---
agents/special/agent_bi | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/agents/special/agent_bi b/agents/special/agent_bi
index d656ff9..a672f3a 100755
--- a/agents/special/agent_bi
+++ b/agents/special/agent_bi
@@ -178,8 +178,13 @@ class AggregationRawdataGenerator(object):
def _parse_response_text(self, response_text):
try:
rawdata = ast.literal_eval(response_text)
- except ValueError: # ast.literal_eval
- raise RawdataException("Error: Unable to parse data from monitoring
instance")
+ except (ValueError, SyntaxError): # ast.literal_eval
+ if "automation secret" in response_text:
+ raise RawdataException(
+ "Error: Unable to parse data from monitoring instance. Please
check the login credentials"
+ )
+ else:
+ raise RawdataException("Error: Unable to parse data from monitoring
instance")
if not isinstance(rawdata, dict):
raise RawdataException("Error: Unable to process parsed data from
monitoring instance")