Module: check_mk
Branch: master
Commit: 5884bd46c6ffdeb13a3759b9660d4b23e361d657
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5884bd46c6ffde…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Dec 19 10:44:09 2016 +0100
4003 FIX esx_vsphere_objects: fixed check parameters display bug during WATO service
discovery
Change-Id: I845d47f0c32642e47ea581535f959b58b83bd9f6
---
.werks/4003 | 9 +++++++++
ChangeLog | 1 +
checks/esx_vsphere_objects | 28 ++++++++++++++--------------
3 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/.werks/4003 b/.werks/4003
new file mode 100644
index 0000000..2bae7f1
--- /dev/null
+++ b/.werks/4003
@@ -0,0 +1,9 @@
+Title: esx_vsphere_objects: fixed check parameters display bug during WATO service
discovery
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i4
+Date: 1482140611
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 7a469f8..97f0ff3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
WATO:
* 4142 New extended search dialog for rulesets and rules...
+ * 4003 FIX: esx_vsphere_objects: fixed check parameters display bug during WATO
service discovery
1.4.0i3:
diff --git a/checks/esx_vsphere_objects b/checks/esx_vsphere_objects
index ef84316..140da6f 100644
--- a/checks/esx_vsphere_objects
+++ b/checks/esx_vsphere_objects
@@ -76,16 +76,7 @@ def check_esx_vsphere_objects(item, params, info):
if vsphere_object_names[line[0]] + " " + line[1] == item and len(line)
> 3:
running_on = line[2]
power_state = line[3]
- state = params.get("states",{}).get(power_state)
- if state == None:
- if power_state == "poweredOn":
- state = 0
- elif power_state == "poweredOff":
- state = 1
- elif power_state == "suspended":
- state = 1
- else:
- state = 3
+ state = params["states"].get(power_state, 3)
infotext = "power state: %s" % power_state
if running_on:
if state == 0:
@@ -102,12 +93,21 @@ def check_esx_vsphere_objects(item, params, info):
else:
return 3, "No data about host system %s" % name
+factory_settings["esx_vsphere_objects_default_levels"] = {
+ "states": {
+ "poweredOn": 0,
+ "poweredOff": 1,
+ "suspended": 1,
+ "unknown": 3,
+ }
+}
check_info['esx_vsphere_objects'] = {
- "inventory_function" : inventory_esx_vsphere_objects,
- "check_function" : check_esx_vsphere_objects,
- "service_description" : "%s",
- "group" : "esx_vsphere_objects",
+ "inventory_function" : inventory_esx_vsphere_objects,
+ "check_function" : check_esx_vsphere_objects,
+ "service_description" : "%s",
+ "group" : "esx_vsphere_objects",
+ "default_levels_variable" : "esx_vsphere_objects_default_levels",
}
def inventory_esx_vsphere_objects_count(info):