Module: check_mk
Branch: master
Commit: 9f3bfeff5b4a0edb905bda1c3e7d0709ac3694ef
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f3bfeff5b4a0e…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Thu Jun 8 15:38:00 2017 +0200
4795 FIX netstat: Fixed wrong output if LISTENING connections should be monitored on
Ubuntu
Ubuntu uses LISTEN instead of LISTENING in netstat. The checkplugin now
reflects this exception.
Change-Id: I1e8e679daf6f0d651c4955cb6a402952f29d4428
---
.werks/4795 | 11 +++++++++++
checks/netstat | 3 +++
2 files changed, 14 insertions(+)
diff --git a/.werks/4795 b/.werks/4795
new file mode 100644
index 0000000..0dede84
--- /dev/null
+++ b/.werks/4795
@@ -0,0 +1,11 @@
+Title: netstat: Fixed wrong output if LISTENING connections should be monitored on
Ubuntu
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1496928598
+Class: fix
+
+Ubuntu uses LISTEN instead of LISTENING in netstat. The checkplugin now
+reflects this exception.
diff --git a/checks/netstat b/checks/netstat
index 846bcf0..6176f3f 100644
--- a/checks/netstat
+++ b/checks/netstat
@@ -60,6 +60,9 @@ def parse_netstat(info):
proto = "TCP"
elif proto.startswith("udp"):
proto = "UDP"
+ # Ubuntu recently deviced to use "LISTEN" instead of
"LISTENING"
+ if connstate == "LISTEN":
+ connstate == "LISTENING"
if len(line) == 5: # handles UDP listeners
proto, recv_q, send_q, local, remote = line