Module: check_mk
Branch: master
Commit: 0d10f5b0267b5dadb6018b5412a450d2613170da
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0d10f5b0267b5d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Feb 10 16:20:48 2014 +0100
FIX statgrab_net.ctr: only inventorize interfaces with actual traffic
Some virtual interfaces with no counter information got inventorized - doesn't made
sense.
Now we only inventorize interfaces which also provide traffic information.
---
.werks/281 | 10 ++++++++++
ChangeLog | 1 +
checks/statgrab_net | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/281 b/.werks/281
new file mode 100644
index 0000000..e8a32dd
--- /dev/null
+++ b/.werks/281
@@ -0,0 +1,10 @@
+Title: statgrab_net.ctr: only inventorize interfaces with actual traffic
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1392045619
+Class: fix
+
+Some virtual interfaces with no counter information got inventorized - doesn't made
sense.
+Now we only inventorize interfaces which also provide traffic information.
+
diff --git a/ChangeLog b/ChangeLog
index e6eb693..91c8aec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -170,6 +170,7 @@
* 0708 FIX: ntp.time, ntp: avoid DNS lookups in NTP queries and avoid timeouts...
* 0277 FIX: solaris agent: ntp now able to work with ntpd and xntpd...
* 0279 FIX: check_mk_agent.solaris: removed proc section from statgrab...
+ * 0281 FIX: statgrab_net.ctr: only inventorize interfaces with actual traffic...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/checks/statgrab_net b/checks/statgrab_net
index f8dfdc9..6268852 100644
--- a/checks/statgrab_net
+++ b/checks/statgrab_net
@@ -97,10 +97,13 @@ def check_statgrab_net_params(item, params, info):
def inventory_statgrab_net_ctr(info):
items = []
+ last_tx_nic = ""
for var, value in info:
- if var.endswith(".up"):
+ if var.endswith(".tx"):
+ last_tx_nic = var.split('.')[0]
+ elif var.endswith(".up"):
nicname = var.split('.')[0]
- if not nicname.startswith("lo"):
+ if nicname == last_tx_nic and not nicname.startswith("lo"):
items.append( (nicname, '', '""') )
return items