Module: check_mk
Branch: master
Commit: 7f4faf181a766073d2eeaf2d88096e2b61eb9564
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7f4faf181a7660…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 20 11:31:18 2016 +0100
MKGeneralExceptions raised by checks (e.g. local) do not trigger crash reports anymore
---
modules/discovery.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/discovery.py b/modules/discovery.py
index adef453..eef62d5 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -305,12 +305,16 @@ def check_discovery(hostname, ipaddress=None):
output += "\n" + "\n".join(long_infotexts)
output += "\n"
- except (MKSNMPError, MKAgentError), e:
+ except (MKSNMPError, MKAgentError, MKGeneralException), e:
output = "Discovery failed: %s\n" % e
# Honor rule settings for "Status of the Check_MK service". In case of
# a problem we assume a connection error here.
spec = exit_code_spec(hostname)
- status = spec.get("connection", 1)
+ if isinstance(e, MKAgentError) or isinstance(e, MKSNMPError):
+ what = "connection"
+ else:
+ what = "exception"
+ status = spec.get(what, 1)
except MKCheckTimeout:
if opt_keepalive: