Module: check_mk
Branch: master
Commit: c8ee9de6e9e0f88fc09708d27a65ce665423b53d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c8ee9de6e9e0f8…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 28 15:20:55 2014 +0100
FIX winperf_if: now able to handle display of bandwidth > 4GBit
If an interface had a bandwidth of > 4GBit the check did not receive
the correct bandwidth value, because of a 32 bit counter overflow.
Workaround: The windows plugin wmic_if.bat now also reports the correct bandwidth value.
If you use this plugin its bandwidth value will have precedence before the bandwidth
determined by the agent.
---
.werks/740 | 11 +++++++++++
ChangeLog | 2 ++
agents/windows/plugins/wmic_if.bat | 2 +-
checks/winperf_if | 3 ++-
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/740 b/.werks/740
new file mode 100644
index 0000000..504df72
--- /dev/null
+++ b/.werks/740
@@ -0,0 +1,11 @@
+Title: winperf_if: now able to handle display of bandwidth > 4GBit
+Level: 1
+Component: checks
+Version: 1.2.5i2
+Date: 1396016199
+Class: fix
+
+If an interface had a bandwidth of > 4GBit the check did not receive
+the correct bandwidth value, because of a 32 bit counter overflow.
+Workaround: The windows plugin wmic_if.bat now also reports the correct bandwidth value.
+If you use this plugin its bandwidth value will have precedence before the bandwidth
determined by the agent.
diff --git a/ChangeLog b/ChangeLog
index 2cdf4e3..62c7302 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1.2.5i2:
Checks & Agents:
+ * 0147 enterasys_fans: New Check to monitor fans of enterasys swichtes
* 0774 ibm_svc_nodestats.diskio: new check for disk troughput per node on IBM SVC /
V7000 devices
+ * 0740 FIX: winperf_if: now able to handle display of bandwidth > 4GBit...
1.2.5i1:
diff --git a/agents/windows/plugins/wmic_if.bat b/agents/windows/plugins/wmic_if.bat
index 501c892..2192d7e 100644
--- a/agents/windows/plugins/wmic_if.bat
+++ b/agents/windows/plugins/wmic_if.bat
@@ -1,3 +1,3 @@
@echo off
echo ^<^<^<winperf_if:sep^(44^)^>^>^>
-wmic path Win32_NetworkAdapter get macaddress,name,netconnectionid,netconnectionstatus
/format:csv
+wmic path Win32_NetworkAdapter get
speed,macaddress,name,netconnectionid,netconnectionstatus /format:csv
diff --git a/checks/winperf_if b/checks/winperf_if
index a7a7cf6..6035cc3 100644
--- a/checks/winperf_if
+++ b/checks/winperf_if
@@ -121,6 +121,7 @@ def convert_winperf_if(info):
for nr, nic_name in enumerate(nic_names):
nic = nics[nic_name]
mac_txt = nic.get('MACAddress')
+ bandwidth = saveint(nic.get('Speed'))
if mac_txt:
mac = "".join(map(lambda x: chr(int(x, 16)),
mac_txt.split(':')))
else:
@@ -129,7 +130,7 @@ def convert_winperf_if(info):
str(nr + 1),
nic_name,
"loopback" in nic_name.lower() and '24' or '6',
- nic[10], # Aktuelle Bandbreite
+ bandwidth or nic[10], # Aktuelle Bandbreite
# NetConnectionStatus: 2 st up, 7 ist 'not connected'. If the plugin
# wmic_if is missing and we have link information we need to assume
'up':
nic.get('NetConnectionStatus', '2') == '2' and
'1' or '2',