Module: check_mk
Branch: master
Commit: cb2e3ed2e90ec7b714bd472928d686b4e3732f07
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cb2e3ed2e90ec7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 24 11:27:41 2014 +0100
#1547 FIX win_cpuinfo: fix case where NumberOfCores is missing (Windows 2003)
Assume 1 Core or 1 Core per CPU in that case.
---
.werks/1547 | 10 ++++++++++
ChangeLog | 3 ++-
inventory/win_cpuinfo | 16 +++++++++++++---
3 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/.werks/1547 b/.werks/1547
new file mode 100644
index 0000000..b93e405
--- /dev/null
+++ b/.werks/1547
@@ -0,0 +1,10 @@
+Title: win_cpuinfo: fix case where NumberOfCores is missing (Windows 2003)
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.2.5i7
+Date: 1416824823
+Class: fix
+
+Assume 1 Core or 1 Core per CPU in that case.
+
diff --git a/ChangeLog b/ChangeLog
index e319351..f3eed41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,8 +36,8 @@
* 1511 FIX: oracle_jobs: avoid broken checks, make compatible with old version...
* 1513 FIX: Handle broken SNMP bulk walk implementation of Mikrotik Router firmware
RouterOS v6.22...
* 1503 FIX: Fixed monitoring of multiple SAP instances with one mk_sap plugin...
- * 1449 FIX: nginx_status: agent plugin no longer honours "http(s)_proxy"
env variables of root user
* 1515 FIX: cisco_secure: fix service description, fix OK state in case of no
violation
+ * 1449 FIX: nginx_status: agent plugin no longer honours "http(s)_proxy"
env variables of root user
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
@@ -92,6 +92,7 @@
HW/SW-Inventory:
* 1479 liveproxyd: new function for collecting remote inventory data...
NOTE: Please refer to the migration notes!
+ * 1547 FIX: win_cpuinfo: fix case where NumberOfCores is missing (Windows 2003)...
inventory:
* 1516 FIX: win_disks: fix exception in case of empty signature
diff --git a/inventory/win_cpuinfo b/inventory/win_cpuinfo
index 96600ab..7a614cf 100644
--- a/inventory/win_cpuinfo
+++ b/inventory/win_cpuinfo
@@ -67,15 +67,25 @@ def inv_win_cpuinfo(info):
for varname, value in info:
varname = re.sub(" *","", varname)
value = re.sub("^ ", "", value)
- if varname == "NumberOfCores":
- node["cores_per_cpu"] = int(value)
+
+ if varname == "NumberOfCores" and value != "":
+ if value != "":
+ node["cores_per_cpu"] = int(value)
+ else:
+ node["cores_per_cpu"] = 1 # missing on Windows 2003
+
elif varname == "NumberOfLogicalProcessors":
- node["threads_per_cpu"] = int(value)
+ if value != "":
+ node["threads_per_cpu"] = int(value)
+ else:
+ node["threads_per_cpu"] = 1 # missing on Windows 2003
+
elif varname == "Manufacturer":
node["vendor"] = {
"GenuineIntel" : "intel",
"AuthenticAMD" : "amd",
}.get(value, value)
+
# there is also the L3CacheSize
elif varname == "L2CacheSize" and value != "":
# normalized to bytes!