Module: check_mk
Branch: master
Commit: ddb0ad4ddab2b326cf473f4a59f02b8d8e1d1693
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ddb0ad4ddab2b3…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Wed Aug 5 16:42:22 2015 +0200
#2523 ipmi: new wato rule to set ignored sensors
---
.werks/2523 | 9 +++++++++
ChangeLog | 1 +
checks/ipmi | 10 +++++++++-
web/plugins/wato/check_parameters.py | 22 ++++++++++++++++++++++
4 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/.werks/2523 b/.werks/2523
new file mode 100644
index 0000000..9bc513a
--- /dev/null
+++ b/.werks/2523
@@ -0,0 +1,9 @@
+Title: ipmi: new wato rule to set ignored sensors
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1438785639
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 5d65306..71f2744 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
* 2513 new checks sentry_pdu_outlets sentry_pdu_systempower: monitor the system power
consumption and outlet states of sentry pdu devices which support the Sentry3-MIB
* 2515 juniper_trpz_aps: check is now cluster-aware...
* 2417 winperf_phydisk: can now work in a cluster environment
+ * 2523 ipmi: new wato rule to set ignored sensors
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/checks/ipmi b/checks/ipmi
index 0bcc4a5..5e33655 100644
--- a/checks/ipmi
+++ b/checks/ipmi
@@ -97,11 +97,19 @@
ipmi_summarize = True
ipmi_ignore_nr = False # set to True in order to ignore entries with state 'nr'
ipmi_ignored_sensors = [] # example: [ "Power_Meter", "Virtual_Fan"
]
+ipmi_ignored_sensors_wato = [] # ignored sensors specified from wato
+
+def ignored_sensors():
+ # merge ignored sensor list specified here and those from wato
+ ignored_sensors_combined = ipmi_ignored_sensors[:]
+ if ipmi_ignored_sensors_wato:
+ ignored_sensors_combined += host_extra_conf(g_hostname,
ipmi_ignored_sensors_wato)[0]
+ return ignored_sensors_combined
def ipmi_ignore_entry(name, state):
if ipmi_ignore_nr and state == 'nr':
return True
- for e in ipmi_ignored_sensors:
+ for e in ignored_sensors():
if name.startswith(e):
return True
return False
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 7194251..cde6176 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -78,6 +78,28 @@ register_rule(group + "/" + subgroup_networking,
#.
+# .--Inventory-----------------------------------------------------------.
+# | ___ _ |
+# | |_ _|_ ____ _____ _ __ | |_ ___ _ __ _ _ |
+# | | || '_ \ \ / / _ \ '_ \| __/ _ \| '__| | | | |
+# | | || | | \ V / __/ | | | || (_) | | | |_| | |
+# | |___|_| |_|\_/ \___|_| |_|\__\___/|_| \__, | |
+# | |___/ |
+# '----------------------------------------------------------------------'
+
+register_rule(group + '/' + subgroup_inventory,
+ varname = "ipmi_ignored_sensors_wato",
+ title = _("Discovery of IPMI sensors"),
+ valuespec = ListOfStrings(
+ title = _("Ignore the following IPMI Sensors"),
+ help = _("Names of IPMI Sensors that should be ignored during
inventory. "
+ "The pattern specified here must match exactly the begin of
"
+ "the actual sensor name (case sensitive)."),
+ orientation = "horizontal"
+ ),
+ match = 'first')
+
+#.
# .--Applications--------------------------------------------------------.
# | _ _ _ _ _ |
# | / \ _ __ _ __ | (_) ___ __ _| |_(_) ___ _ __ ___ |