Module: check_mk
Branch: master
Commit: cded304a73515abc11efb375d89da430eaafdbaa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cded304a73515a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Apr 6 10:42:45 2018 +0200
5946 FIX lnx_if: Exclude veth* network interfaces on docker nodes
The veth* network interfaces created for docker containers are now
excluded by the linux agent in all cases. The interface names have no
direct match with the docker container name or ID. They seem to have
some kind of random nature.
These container specific interfaces are not relevant to be monitored
on the node. We are monitoring the docker network interfaces in the
container.
Change-Id: Icecc44425b30cd1ae4e74448f7f71f86ab7b065e
---
.werks/5946 | 17 +++++++++++++++++
agents/check_mk_agent.linux | 2 +-
checks/lnx_if | 4 ++++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/.werks/5946 b/.werks/5946
new file mode 100644
index 0000000..00063a4
--- /dev/null
+++ b/.werks/5946
@@ -0,0 +1,17 @@
+Title: lnx_if: Exclude veth* network interfaces on docker nodes
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1523003860
+Class: fix
+
+The veth* network interfaces created for docker containers are now
+excluded by the linux agent in all cases. The interface names have no
+direct match with the docker container name or ID. They seem to have
+some kind of random nature.
+
+These container specific interfaces are not relevant to be monitored
+on the node. We are monitoring the docker network interfaces in the
+container.
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 22bd49f..7db4db9 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -393,7 +393,7 @@ if type ip > /dev/null
then
echo '<<<lnx_if>>>'
echo "[start_iplink]"
- ip link
+ ip link
echo "[end_iplink]"
fi
diff --git a/checks/lnx_if b/checks/lnx_if
index 449441c..9cd9d0b 100644
--- a/checks/lnx_if
+++ b/checks/lnx_if
@@ -217,6 +217,10 @@ def parse_lnx_if(info):
def inventory_lnx_if(parsed):
if linux_nic_check == "legacy":
return []
+
+ # Always exclude dockers veth* interfaces on docker nodes
+ parsed = [ e for e in parsed if not e[2].startswith("veth") ]
+
return inventory_if_common(parsed, has_nodeinfo=True)