Module: check_mk
Branch: master
Commit: 7d54a2b121d64a17cf2815442f71e6ebe9344419
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d54a2b121d64a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Sat Oct 20 19:23:00 2018 +0200
6844 FIX mknotifyd: Fixed parse exception when failed to open listen socket
When a mknotifyd instance fails to open it's listen socket the parse
function of the check was unable to process the agent output of the
mknotifyd. This resulted in a crash, e.g. during service discovery.
Change-Id: I194ae70a2f7914750e9e96cb4a25c2c19e93f9eb
---
.werks/6844 | 13 +++++++++++++
checks/mknotifyd | 6 ++++++
2 files changed, 19 insertions(+)
diff --git a/.werks/6844 b/.werks/6844
new file mode 100644
index 0000000..5f72064
--- /dev/null
+++ b/.werks/6844
@@ -0,0 +1,13 @@
+Title: mknotifyd: Fixed parse exception when failed to open listen socket
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1540056102
+
+When a mknotifyd instance fails to open it's listen socket the parse
+function of the check was unable to process the agent output of the
+mknotifyd. This resulted in a crash, e.g. during service discovery.
diff --git a/checks/mknotifyd b/checks/mknotifyd
index 9601903..924462f 100644
--- a/checks/mknotifyd
+++ b/checks/mknotifyd
@@ -87,6 +87,12 @@ def parse_mknotifyd(info):
else:
if value == "None":
value = None
+ elif value and varname == "Listening FD":
+ # May be the listening FD number or an error message
+ try:
+ value = int(value.split()[0])
+ except ValueError:
+ pass
elif value and varname not in [
"Type",
"State",