Module: check_mk
Branch: master
Commit: ef87c0f949dab50b8dfa0a8589b3d98173d9f732
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ef87c0f949dab5…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 20 15:29:44 2015 +0100
#2063 winperf_if: now also able to detect the interface port state
'lowerLayerDown'
Previous version only reported interface 'down'
---
.werks/2063 | 9 +++++++++
ChangeLog | 1 +
checks/winperf_if | 8 +++++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/2063 b/.werks/2063
new file mode 100644
index 0000000..b21e042
--- /dev/null
+++ b/.werks/2063
@@ -0,0 +1,9 @@
+Title: winperf_if: now also able to detect the interface port state
'lowerLayerDown'
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1426861644
+Class: feature
+
+Previous version only reported interface 'down'
diff --git a/ChangeLog b/ChangeLog
index 3e843e8..669226e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -136,6 +136,7 @@
* 2062 grouped interfaces: additional information in check output and new port state
'degraded'...
NOTE: Please refer to the migration notes!
* 2153 siemens_plc.duration siemens_plc.flag siemens_plc.info: New Checks for Siemens
PLC devices
+ * 2063 winperf_if: now also able to detect the interface port state
'lowerLayerDown'...
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checks/winperf_if b/checks/winperf_if
index c88b25d..f08edbb 100644
--- a/checks/winperf_if
+++ b/checks/winperf_if
@@ -194,6 +194,12 @@ def convert_winperf_if(info):
if nic.get("GUID") in teaming_info:
index_info = ( teaming_info[nic.get("GUID")]["TeamName"],
index_info )
+
+ connection_status = nic.get('NetConnectionStatus')
+ if connection_status not in ['1', '2', '7']:
+ # Unknown states are set to down
+ connection_status = '2'
+
converted.append((
index_info,
nic_name,
@@ -201,7 +207,7 @@ def convert_winperf_if(info):
bandwidth or nic[10], # Bandwidth
# NetConnectionStatus: 2 means 'up', 7 is 'not connected'. If
the plugin
# wmic_if is missing and we have link information we have to assume
'up':
- nic.get('NetConnectionStatus', '2') == '2' and
'1' or '2',
+ connection_status,
nic[-246], # ifInOctets,
nic[14], # inucast
0, # inmcast