Module: check_mk
Branch: master
Commit: 5351cf3c4b12e0c24883693027ddf655d5e23454
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5351cf3c4b12e0…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Mar 21 11:23:45 2018 +0100
5777 FIX ucs_bladecenter_fans.temp: Made item name unique
The check plugins {{ucs_bladecenter_fans.temp}} and
{{ucs_bladecenter_psu.chassis_temp}} created same
item names and both use the WATO ruleset {{Temperature}}.
That means that if a rule applied to a service generated
by one of these check plugins, this rule automatically
applied to the related one, too. No distinction was possible.
You have to perform a rediscovery on the affected hosts.
Performance data will be preserved.
Example:
ucs_bladecenter_fans.temp generated the services
- Temperature Ambient Chassis 1 FAN
- Temperature Ambient Chassis 2 FAN
and ucs_bladecenter_psu.chassis_temp generated the services
- Temperature Ambient Chassis 1
- Temperature Ambient Chassis 2
the item names were {{Ambient Chassis 1}} and {{Ambient Chassis 2}}
in both cases. The temperature rule matching the sensor ID
{{Ambient Chassis.*}} automatically applied to all four services.
Now the item names for
ucs_bladecenter_fans.temp look like
- {{Ambient Chassis 1 FAN}}
- {{Ambient Chassis 2 FAN}}
and for ucs_bladecenter_psu.chassis_temp
- {{Ambient Chassis 1}}
- {{Ambient Chassis 2}}
Independent rules may be created in the following order:
- {{Ambient Chassis.*FAN}}
- {{Ambient Chassis.*}}
Change-Id: I9aaa7a23f9d09b08c3b6ef6526ac5e09185ff584
---
.werks/5777 | 44 ++++++++++++++++++++++++++++++++++++++++++++
checks/ucs_bladecenter_fans | 6 +++---
2 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/.werks/5777 b/.werks/5777
new file mode 100644
index 0000000..d38479d
--- /dev/null
+++ b/.werks/5777
@@ -0,0 +1,44 @@
+Title: ucs_bladecenter_fans.temp: Made item name unique
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.5.0i4
+Date: 1521625999
+Class: fix
+
+The check plugins {{ucs_bladecenter_fans.temp}} and
+{{ucs_bladecenter_psu.chassis_temp}} created same
+item names and both use the WATO ruleset {{Temperature}}.
+That means that if a rule applied to a service generated
+by one of these check plugins, this rule automatically
+applied to the related one, too. No distinction was possible.
+
+You have to perform a rediscovery on the affected hosts.
+Performance data will be preserved.
+
+Example:
+ucs_bladecenter_fans.temp generated the services
+- Temperature Ambient Chassis 1 FAN
+- Temperature Ambient Chassis 2 FAN
+
+and ucs_bladecenter_psu.chassis_temp generated the services
+- Temperature Ambient Chassis 1
+- Temperature Ambient Chassis 2
+
+the item names were {{Ambient Chassis 1}} and {{Ambient Chassis 2}}
+in both cases. The temperature rule matching the sensor ID
+{{Ambient Chassis.*}} automatically applied to all four services.
+
+Now the item names for
+ucs_bladecenter_fans.temp look like
+- {{Ambient Chassis 1 FAN}}
+- {{Ambient Chassis 2 FAN}}
+
+and for ucs_bladecenter_psu.chassis_temp
+- {{Ambient Chassis 1}}
+- {{Ambient Chassis 2}}
+
+Independent rules may be created in the following order:
+- {{Ambient Chassis.*FAN}}
+- {{Ambient Chassis.*}}
diff --git a/checks/ucs_bladecenter_fans b/checks/ucs_bladecenter_fans
index e512bd4..fc56348 100644
--- a/checks/ucs_bladecenter_fans
+++ b/checks/ucs_bladecenter_fans
@@ -114,11 +114,11 @@
factory_settings["ucs_bladecenter_fans_temp_default_levels"] = {
def inventory_ucs_bladecenter_fans_temp(parsed):
for key, values in parsed.items():
if "AmbientTemp" in values:
- yield "Ambient " + " ".join(key.split()[:2]), {}
+ yield "Ambient %s FAN" % " ".join(key.split()[:2]), {}
def check_ucs_bladecenter_fans_temp(item, params, parsed):
- sensor_item = item[8:] # drop "Ambient "
+ sensor_item = item[8:-4] # drop "Ambient " and " FAN"
sensor_list = []
for key, values in parsed.items():
if key.startswith(sensor_item) and "AmbientTemp" in values:
@@ -133,7 +133,7 @@ def check_ucs_bladecenter_fans_temp(item, params, parsed):
check_info["ucs_bladecenter_fans.temp"] = {
'inventory_function' : inventory_ucs_bladecenter_fans_temp,
'check_function' : check_ucs_bladecenter_fans_temp,
- 'service_description' : 'Temperature %s FAN',
+ 'service_description' : 'Temperature %s',
'group' : 'temperature',
'has_perfdata' : True,
'includes' : [ 'ucs_bladecenter.include',
'temperature.include' ],