Module: check_mk
Branch: master
Commit: e2b0c4a31d47bb93f6ba06f8183e8b660c2a7cff
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e2b0c4a31d47bb…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed May 24 15:11:50 2017 +0200
4742 FIX wmi_cpuload: Added required tables to prevent crash
Until now the checkplugin created Services only if there are potential
instancesi regardless if the needed information to compute these instances
is available. This has been fixed now - Services are only created, if all
necessary data is available.
Change-Id: I6b97345b8c85d213c8299ba528e2b148a3d82f05
---
.werks/4742 | 13 +++++++++++++
checks/wmi_cpuload | 9 +++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/.werks/4742 b/.werks/4742
new file mode 100644
index 0000000..a71f219
--- /dev/null
+++ b/.werks/4742
@@ -0,0 +1,13 @@
+Title: wmi_cpuload: Added required tables to prevent crash
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1495631029
+Class: fix
+
+Until now the checkplugin created Services only if there are potential
+instancesi regardless if the needed information to compute these instances
+is available. This has been fixed now - Services are only created, if all
+necessary data is available.
diff --git a/checks/wmi_cpuload b/checks/wmi_cpuload
index e433a57..d120721 100644
--- a/checks/wmi_cpuload
+++ b/checks/wmi_cpuload
@@ -25,6 +25,11 @@
# Boston, MA 02110-1301 USA.
+def inventory_wmi_cpuload(parsed):
+ return inventory_wmi_table(parsed, \
+ required_tables = [ "computer_system", "system_perf"
])
+
+
def check_wmi_cpuload(item, params, parsed):
# the processor queue length is logically similar to linux cpu load as
# it states the number of processes waiting to be assigned cpu time.
@@ -51,9 +56,9 @@ def check_wmi_cpuload(item, params, parsed):
check_info['wmi_cpuload'] = {
- 'inventory_function' : inventory_wmi_table,
- 'check_function' : check_wmi_cpuload,
'parse_function' : parse_wmi_table,
+ 'inventory_function' : inventory_wmi_cpuload,
+ 'check_function' : check_wmi_cpuload,
'has_perfdata' : True,
'service_description' : "Processor Queue",
'includes' : ['wmi.include', 'cpu_load.include'],