Module: check_mk
Branch: master
Commit: f0faaa4cc16dd0b758b585a08bfddbe59142ab74
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f0faaa4cc16dd0…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Aug 7 15:50:22 2015 +0200
cleanup in ipmi check
now also allows disabling summarization from web interface and
restructured configuration variable.
---
.werks/2523 | 2 +-
ChangeLog | 2 +-
checks/ipmi | 43 ++++++++++++++++++++--------------
web/plugins/wato/check_parameters.py | 39 ++++++++++++++++++++++--------
4 files changed, 57 insertions(+), 29 deletions(-)
diff --git a/.werks/2523 b/.werks/2523
index 9bc513a..9854203 100644
--- a/.werks/2523
+++ b/.werks/2523
@@ -1,4 +1,4 @@
-Title: ipmi: new wato rule to set ignored sensors
+Title: ipmi: new wato rule to set ignored sensors and activate/deactivate summarizing
Level: 1
Component: checks
Compatible: compat
diff --git a/ChangeLog b/ChangeLog
index af9704c..28d9282 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,7 +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
+ * 2523 ipmi: new wato rule to set ignored sensors and activate/deactivate summarizing
* 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 5e33655..98a823e 100644
--- a/checks/ipmi
+++ b/checks/ipmi
@@ -97,16 +97,16 @@
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
+inventory_ipmi_rules = []
def ipmi_ignore_entry(name, state):
+ def ignored_sensors():
+ # merge ignored sensor list specified here and those from wato
+ ignored_sensors_combined = ipmi_ignored_sensors[:]
+ rules = host_extra_conf(g_hostname, inventory_ipmi_rules)[0]
+ ignored_sensors_combined += rules.get("ignored_sensors", [])
+ return ignored_sensors_combined
+
if ipmi_ignore_nr and state == 'nr':
return True
for e in ignored_sensors():
@@ -115,12 +115,15 @@ def ipmi_ignore_entry(name, state):
return False
def inventory_ipmi(info):
- if ipmi_summarize and len(info) > 0:
- return [ ( "Summary", None ) ]
- else:
+ rules = host_extra_conf(g_hostname, inventory_ipmi_rules)[0]
+ # the default for summarize is always true so if either configuration key has been set
+ # to false that setting was changed by the user and needs to override the other
+ if not ipmi_summarize or not rules.get("summarize", True) or len(info) == 0:
return [ ( line[0], None )
for line in info
if not ipmi_ignore_entry(line[0], line[3]) ]
+ else:
+ return [ ( "Summary", None ) ]
def check_ipmi(item, params, info):
if item == "Summary":
@@ -128,17 +131,25 @@ def check_ipmi(item, params, info):
else:
return check_ipmi_detailed(item, info)
+def ipmi_format_message(name, val, unit):
+ text = "%s is %s" % (name, val)
+ if unit != 'unspecified':
+ text += ' %s' % unit
+ # otherwise the unit is unknown or there is none (val could represent yes/no)
+ return text
+
+
def check_ipmi_detailed(item, info):
for name, val, unit, status, unrec_low, crit_low, \
warn_low, warn_high, crit_high, unrec_high in info:
if name == item:
perfdata = [ (name, val + unit) ] # TODO: add warn and crit levels
if status == 'ok':
- return (0, "%s is %s %s" % (name, val, unit), perfdata)
+ return (0, ipmi_format_message(name, val, unit), perfdata)
elif status == 'nc':
- return (1, "%s is %s %s" % (name, val, unit), perfdata)
+ return (1, ipmi_format_message(name, val, unit), perfdata)
else:
- return (2, "%s is %s %s" % (name, val, unit), perfdata)
+ return (2, ipmi_format_message(name, val, unit), perfdata)
def check_ipmi_summarized(info):
worst_status = 0
@@ -157,10 +168,8 @@ def check_ipmi_summarized(info):
if ipmi_ignore_entry(name, status):
continue
- text = "%s is %s" % (name, val)
- if unit != 'unspecified':
- text += ' %s' % unit
count += 1
+ text = ipmi_format_message(name, val, unit)
if status == 'nc':
worst_status = max(worst_status, 1)
warn_texts.append(text)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index cde6176..817beb7 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -88,16 +88,35 @@ register_rule(group + "/" + subgroup_networking,
# '----------------------------------------------------------------------'
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')
+ varname = "inventory_ipmi_rules",
+ title = _("Discovery of IPMI sensors"),
+ valuespec = Dictionary(
+ show_titles = True,
+ elements = [
+ ( "ignored_sensors",
+ ListOfStrings(
+ title = _("Ignore the following IPMI Sensors"),
+ help = _("Names of IPMI Sensors that should be ignored during inventory "
+ "and when summarizing."
+ "The pattern specified here must match exactly the beginning of "
+ "the actual sensor name (case sensitive)."),
+ orientation = "horizontal"
+ )
+ ),
+ ( "summarize",
+ Checkbox(
+ title = _("Display only a summary of all sensors"),
+ label = _("Summarize"),
+ help = _("If active, only a single summary item is displayed. The summary "
+ "will explicitly mention sensors in warn/crit state but the "
+ "sensors that are ok are aggregated."),
+ default_value = True
+ )
+ )
+ ]
+ ),
+ match = 'first'
+)
#.
# .--Applications--------------------------------------------------------.
Module: check_mk
Branch: master
Commit: c82959c6b7f01e1718ce8c8639b21d16c43c29c5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c82959c6b7f01e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 6 10:20:37 2015 +0200
#2503 FIX diskstat: Only excluding multipath members when infos for multipath devices are available
Werk #1831 made the discovery exclude member disks of multipath devices. Only do this when
diskstat has information for the multipath devices. Otherwise there will be no Disk IO information
at all for these devices.
---
.werks/2503 | 11 +++++++++++
ChangeLog | 1 +
checks/diskstat | 15 ++++++++++-----
checks/multipath | 1 +
4 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/.werks/2503 b/.werks/2503
new file mode 100644
index 0000000..7653b89
--- /dev/null
+++ b/.werks/2503
@@ -0,0 +1,11 @@
+Title: diskstat: Only excluding multipath members when infos for multipath devices are available
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1438848951
+Class: fix
+
+Werk #1831 made the discovery exclude member disks of multipath devices. Only do this when
+diskstat has information for the multipath devices. Otherwise there will be no Disk IO information
+at all for these devices.
diff --git a/ChangeLog b/ChangeLog
index 76f5fbb..83261fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -100,6 +100,7 @@
* 2415 FIX: check_mail, check_mail_loop: fixed incorrect POP3 ssl setting (thanks to Bernhard Schmidt)...
* 2452 FIX: cisco_temperature: Fixed handling of scaling...
* 2416 FIX: agent_netapp: fixed rare problem where environmental sensor info (fan, psus, temp) were not shown...
+ * 2503 FIX: diskstat: Only excluding multipath members when infos for multipath devices are available...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/checks/diskstat b/checks/diskstat
index 5fd250f..f6856eb 100644
--- a/checks/diskstat
+++ b/checks/diskstat
@@ -297,13 +297,18 @@ def diskstat_convert_info(info):
converted_disks = dict(disks.items()) # we must not mody info!
# If we have information about multipathing, then remove the
- # physical path devices from the disks array. Also rename the
- # generic names like "dm-8" with multipath names like "SDataCoreSANsymphony_DAT07-fscl"
+ # physical path devices from the disks array. But only do this,
+ # when there are information for the multipath device available.
+ #
+ # For multipath entries: Rename the generic names like "dm-8"
+ # with multipath names like "SDataCoreSANsymphony_DAT07-fscl"
if multipath_info:
for uuid, multipath in multipath_info.items():
- for path in multipath["paths"]:
- if path in converted_disks:
- del converted_disks[path]
+ if multipath["device"] in converted_disks:
+ for path in multipath["paths"]:
+ if path in converted_disks:
+ del converted_disks[path]
+
if multipath["device"] in converted_disks:
converted_disks[uuid] = converted_disks[multipath["device"]]
del converted_disks[multipath["device"]]
diff --git a/checks/multipath b/checks/multipath
index eabd80f..d39a3d4 100644
--- a/checks/multipath
+++ b/checks/multipath
@@ -161,6 +161,7 @@ def parse_multipath(info):
# 3: matched regex-group id of dm-device (optional)
reg_headers = [
(regex(r"^[0-9a-z]{33}$"), 0, None, None), # 1. (should be included in 3.)
+ (regex(r"^([^\s]+)\s\(([0-9A-Za-z_-]+)\)\s(dm.[0-9]+)"), 2, 1, 3), # 2.
(regex(r"^([^\s]+)\s\(([0-9A-Za-z_-]+)\)"), 2, 1, None), # 2.
(regex(r"^[a-zA-Z0-9_]+$"), 0, None, None), # 3.
(regex(r"^([0-9a-z]{33}|[0-9a-z]{49})\s?(dm.[0-9]+).*$"), 1, None, 2), # 4.
legacy agent no longer aborts when evaluating unknown ssl option
Message-ID: <55c21d5e.YpM0uZpBwUDbjRj2%ab(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 75032c7f4891a219aa7a74ada6b8ad93527f2a86
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=75032c7f4891a2…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Aug 5 16:24:29 2015 +0200
#2418 FIX agent_vsphere.pysphere: legacy agent no longer aborts when evaluating unknown ssl option
The agent_vsphere.pysphere is now able to accept the option --no-cert-check, which was introduced a month ago.
However, it is only implemented as a dummy. SSL certificate checking is not supported in the legacy version.
---
.werks/2418 | 11 +++++++++++
ChangeLog | 1 +
agents/special/agent_vsphere.pysphere | 3 ++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/2418 b/.werks/2418
new file mode 100644
index 0000000..bac0bd5
--- /dev/null
+++ b/.werks/2418
@@ -0,0 +1,11 @@
+Title: agent_vsphere.pysphere: legacy agent no longer aborts when evaluating unknown ssl option
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1438784205
+
+The agent_vsphere.pysphere is now able to accept the option --no-cert-check, which was introduced a month ago.
+However, it is only implemented as a dummy. SSL certificate checking is not supported in the legacy version.
diff --git a/ChangeLog b/ChangeLog
index 5d65306..fcaa730 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -101,6 +101,7 @@
* 2415 FIX: check_mail, check_mail_loop: fixed incorrect POP3 ssl setting (thanks to Bernhard Schmidt)...
* 2452 FIX: cisco_temperature: Fixed handling of scaling...
* 2416 FIX: agent_netapp: fixed rare problem where environmental sensor info (fan, psus, temp) were not shown...
+ * 2418 FIX: agent_vsphere.pysphere: legacy agent no longer aborts when evaluating unknown ssl option...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/agents/special/agent_vsphere.pysphere b/agents/special/agent_vsphere.pysphere
index 22609e3..0c5a7ee 100755
--- a/agents/special/agent_vsphere.pysphere
+++ b/agents/special/agent_vsphere.pysphere
@@ -58,6 +58,7 @@ OPTIONS:
having any assigned virtual disks.
-p, --port port Alternative port number (default is 443 for the https connection)
--pysphere Does nothing. For compatibility with new agent.
+ --no-cert-check Does nothing. For compatibility with new agent.
-H, --hostname Specify a hostname. This is neccessary if this is
different from HOST. It is being used in --direct
mode as the name of the host system when outputting
@@ -91,7 +92,7 @@ OPTIONS:
short_options = 'hi:u:s:Dat:H:cPp:S:'
long_options = [
'help', 'user=', 'secret=', 'direct', 'agent', 'debug', 'modules=', 'timeout=', 'hostname=',
- 'dump-counters', 'profile', 'pysphere', 'spaces=', 'port='
+ 'dump-counters', 'profile', 'pysphere', 'spaces=', 'port=', 'no-cert-check'
]
try: