Module: check_mk
Branch: master
Commit: 0602863aee43e20fc004f9f69e7d2100ef35fdd4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0602863aee43e2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 19 10:20:34 2015 +0100
#2772 FIX Fixed possible exception in icon column when showing some actions in the column
When e.g. moving the reschedule action icon from the dropdown menu to the column top
level, this could result in an exception when the webserver is not being restarted
after this config change. This has now been fixed to work as expected.
---
.werks/2772 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 19 ++++++++++++-------
web/plugins/views/painters.py | 20 ++++++++++----------
4 files changed, 34 insertions(+), 17 deletions(-)
diff --git a/.werks/2772 b/.werks/2772
new file mode 100644
index 0000000..a7a0deb
--- /dev/null
+++ b/.werks/2772
@@ -0,0 +1,11 @@
+Title: Fixed possible exception in icon column when showing some actions in the column
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447924751
+Class: fix
+
+When e.g. moving the reschedule action icon from the dropdown menu to the column top
+level, this could result in an exception when the webserver is not being restarted
+after this config change. This has now been fixed to work as expected.
diff --git a/ChangeLog b/ChangeLog
index d58adb6..f11f73c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -113,6 +113,7 @@
* 2447 FIX: Fixed sorting of performancedata values with units...
* 2758 FIX: Fixed processing of metrics containing varnames with quotes and/or spaces
* 2762 FIX: Fixed formating of check_http when using "clickable URL" option
+ * 2772 FIX: Fixed possible exception in icon column when showing some actions in the column...
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 4533379..98c582f 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -808,23 +808,28 @@ def get_needed_columns(view, painters):
for entry in painters:
painter = entry[0]
linkview_name = entry[1]
- columns += painter["columns"]
+
+ columns += get_painter_columns(painter)
+
if linkview_name:
linkview = views.get(linkview_name)
if linkview:
for filt in [ visuals.get_filter(fn) for fn in visuals.get_single_info_keys(linkview) ]:
columns += filt.link_columns
- # The site attribute is no column. Filter it out here
- #if 'site' in columns:
- # columns.remove('site')
-
if len(entry) > 2 and entry[2]:
tt = entry[2]
- columns += multisite_painters[tt]["columns"]
+ columns += get_painter_columns(multisite_painters[tt])
return columns
+def get_painter_columns(painter):
+ if type(lambda: None) == type(painter["columns"]):
+ return painter["columns"]()
+ else:
+ return painter["columns"]
+
+
# Display options are flags that control which elements of a
# view should be displayed (buttons, sorting, etc.). They can be
# specified via the URL variable display_options. The function
@@ -2343,7 +2348,7 @@ def group_value(row, group_painters):
else:
group.append(groupvalfunc(row))
else:
- for c in p[0]["columns"]:
+ for c in get_painter_columns(p[0]):
group.append(row[c])
return tuple(group)
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index ce78910..e845043 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -333,21 +333,21 @@ def iconpainter_columns(what, toplevel):
return cols
multisite_painters["service_icons"] = {
- "title": _("Service icons"),
- "short": _("Icons"),
+ "title" : _("Service icons"),
+ "short" : _("Icons"),
"printable" : False, # does not contain printable text
- "columns": iconpainter_columns("service", toplevel=True),
- "groupby" : lambda row: "", # Do not account for in grouping
- "paint": lambda row: paint_icons("service", row)
+ "columns" : lambda: iconpainter_columns("service", toplevel=True),
+ "groupby" : lambda row: "", # Do not account for in grouping
+ "paint" : lambda row: paint_icons("service", row)
}
multisite_painters["host_icons"] = {
- "title": _("Host icons"),
- "short": _("Icons"),
+ "title" : _("Host icons"),
+ "short" : _("Icons"),
"printable" : False, # does not contain printable text
- "columns": iconpainter_columns("host", toplevel=True),
- "groupby" : lambda row: "", # Do not account for in grouping
- "paint": lambda row: paint_icons("host", row)
+ "columns" : lambda: iconpainter_columns("host", toplevel=True),
+ "groupby" : lambda row: "", # Do not account for in grouping
+ "paint" : lambda row: paint_icons("host", row)
}
# -----------------------------------------------------------------------
Module: check_mk
Branch: master
Commit: 7585c365177e56c88c080281c98b02d0b719f680
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7585c365177e56…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Nov 18 16:27:33 2015 +0100
#1303 multipath, solaris_multipath: Level for needed paths can now be specified in percent
---
.werks/1303 | 9 +++++++++
ChangeLog | 1 +
checks/multipath | 14 ++++++++------
checks/solaris_multipath | 5 ++++-
web/plugins/wato/check_parameters.py | 11 +++++++++--
5 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/.werks/1303 b/.werks/1303
new file mode 100644
index 0000000..4645de3
--- /dev/null
+++ b/.werks/1303
@@ -0,0 +1,9 @@
+Title: multipath, solaris_multipath: Level for needed paths can now be specified in percent
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447860323
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index cbb1cf3..b84c16b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@
* 2710 arbor_peakflow_sp, arbor_peakflow_sp.cpu_load, arbor_peakflow_sp.disk_usage, arbor_peakflow_sp.flows, arbor_peakflow_tms, arbor_peakflow_tms.cpu_load, arbor_peakflow_tms.disk_usage, arbor_peakflow_tms.host_fault, arbor_peakflow_tms.updates, arbor_pravail, arbor_pravail.cpu_load, arbor_pravail.disk_usage, arbor_pravail.host_fault: new checks for various arbor devices
* 2711 janitza_umg: added support for umg508...
* 2792 check_mk_agent.aix: now able to use wildcards in the fileinfo.cfg
+ * 1303 multipath, solaris_multipath: Level for needed paths can now be specified in percent
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checks/multipath b/checks/multipath
index d39a3d4..4d509eb 100644
--- a/checks/multipath
+++ b/checks/multipath
@@ -281,9 +281,6 @@ def inventory_multipath(parsed):
# item is UUID (e.g. '360a9800043346937686f456f59386741') or alias (e.g. 'mpath0')
def check_multipath(item, target_numpaths, parsed):
- if target_numpaths == None:
- target_numpaths = 2 # default case: we need two paths
-
# Keys in parsed are the UUIDs. First assume that we are
# looking for a UUID. Then fall back to aliases
if item in parsed:
@@ -313,14 +310,19 @@ def check_multipath(item, target_numpaths, parsed):
if numbroken > 0:
return (2, "%sbroken paths: %s" % (aliasinfo, ",".join(broken)))
+ if target_numpaths == None:
+ target_numpaths = 2 # default case: we need two paths
+ elif type(target_numpaths) == float:
+ target_numpaths = (target_numpaths / 100) * numpaths
+
info = "%spaths expected: %d, paths active: %d" % (aliasinfo, target_numpaths, numpaths)
if numpaths < target_numpaths:
- return (2, info)
+ return 2, info
elif numpaths > target_numpaths:
- return (1, info)
+ return 1, info
else:
- return (0, info)
+ return 0, info
check_info["multipath"] = {
'check_function': check_multipath,
diff --git a/checks/solaris_multipath b/checks/solaris_multipath
index 55d8afb..424cf47 100644
--- a/checks/solaris_multipath
+++ b/checks/solaris_multipath
@@ -52,7 +52,10 @@ def check_solaris_multipath(item, params, info):
state = 1
infotext += ", expected paths unknown, please redo service discovery"
else:
- expected = int(params) # should be int, just for legacy reasons
+ if type(params) == float:
+ expected = (params / 100) * total
+ else:
+ expected = int(params) # should be int, just for legacy reasons
if operational > expected:
state = 1
elif expected == operational:
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 93a4384..4a124b8 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6458,10 +6458,17 @@ register_check_parameters(
subgroup_storage,
"multipath",
_("Linux and Solaris Multipath Count"),
- Integer(
+ Alternative(
help = _("This rules sets the expected number of active paths for a multipath LUN "
"on Linux and Solaris hosts"),
- title = _("Expected number of active paths")),
+ title = _("Expected number of active paths"),
+ elements = [
+ Integer(
+ title = _("Expected number of active paths")),
+ Percentage(
+ title = _("Expected percentage of active paths")),
+ ]
+ ),
TextAscii(
title = _("Name of the MP LUN"),
help = _("For Linux multipathing this is either the UUID (e.g. "
Module: check_mk
Branch: master
Commit: 286295204c79cf1cd877bf3d48a3931132ed1d6f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=286295204c79cf…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Nov 18 11:37:08 2015 +0100
Reworked waittriggers.
* Don't fiddle around with pthread directly, use condition_variable and friends.
* Made the interface type-safe.
* Renamed things to a more consistent schema.
* Added a non-standard method to condition_variable, we don't have std::chrono.
* Tiny cleanup.
Nevertheless, things are still a bit dubious: The mutex used for waiting
(see Query.cc) is *not* used for notifications (see module.c). This looks
like a bug...
---
livestatus/src/ConditionVariable.h | 12 +++-
livestatus/src/Makefile.am | 2 +-
livestatus/src/Mutex.h | 20 +++---
livestatus/src/Query.cc | 41 ++++-------
livestatus/src/Query.h | 2 +-
livestatus/src/module.c | 21 ++----
livestatus/src/waittriggers.c | 55 ---------------
livestatus/src/waittriggers.cc | 132 ++++++++++++++++++++++++++++++++++++
livestatus/src/waittriggers.h | 47 +++++++------
9 files changed, 201 insertions(+), 131 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=286295204c…
Module: check_mk
Branch: master
Commit: 3bf7baf5c6d9932db72f45c213bf91db46e5db50
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3bf7baf5c6d993…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 18 10:57:06 2015 +0100
#2771 Errors in Check_MK configuration do not prevent the core from being restarted anymore
This has been implemented for the CMC configuration generating mechanism some time ago.
See werk #8294 for details. This has also been implemented for installations which use
Nagios as monitoring core.
---
.werks/2771 | 11 ++
ChangeLog | 1 +
modules/automation.py | 15 +--
modules/check_mk.py | 350 ++++++++++++++++++++++++++++---------------------
modules/nagios.py | 42 ++----
5 files changed, 231 insertions(+), 188 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=3bf7baf5c6…
Module: check_mk
Branch: master
Commit: 989bef70ecdcf45f1e82f3daddf6f20ceedde023
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=989bef70ecdcf4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 18 10:09:30 2015 +0100
#2770 FIX Check_MK is now warning the user about deprecated but configured checkgroup parameters
These messages help during migration from 1.2.6 to 1.2.8 when the check groups of checks
have been changed. The message is a hint for the user to check the deprecated rulesets
and migrate the rules to the new ones.
---
.werks/2770 | 11 +++++++++++
ChangeLog | 1 +
modules/check_mk.py | 34 ++++++++++++++++++++++++++++------
modules/nagios.py | 2 ++
4 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/.werks/2770 b/.werks/2770
new file mode 100644
index 0000000..56cb12b
--- /dev/null
+++ b/.werks/2770
@@ -0,0 +1,11 @@
+Title: Check_MK is now warning the user about deprecated but configured checkgroup parameters
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447836914
+Class: fix
+
+These messages help during migration from 1.2.6 to 1.2.8 when the check groups of checks
+have been changed. The message is a hint for the user to check the deprecated rulesets
+and migrate the rules to the new ones.
diff --git a/ChangeLog b/ChangeLog
index 87617b0..cbb1cf3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
* 2756 FIX: SNMP: Generalized error handling of emtpy info for SNMP checks...
* 2759 FIX: Allowing Emails to contain special characters like umlauts...
* 2764 FIX: Fixed broken SNMP checks in case SNMP check interval is configured for clusters...
+ * 2770 FIX: Check_MK is now warning the user about deprecated but configured checkgroup parameters...
Checks & Agents:
* 2434 NetApp monitoring: Cluster-Mode is now supported, changes in existing 7Mode checks...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 9d3639b..da7231e 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -380,20 +380,25 @@ def load_checks():
# Now convert check_info to new format.
convert_check_info()
- verify_checkgroups()
+ verify_checkgroup_members()
-# This function validates the checks which are members of checkgroups to have either
-# all or none an item. Mixed checkgroups lead to strange exceptions when processing
-# the check parameters. So it is much better to catch these errors in a central place
-# with a clear error message.
-def verify_checkgroups():
+def checks_by_checkgroup():
groups = {}
for check_type, check in check_info.items():
group_name = check["group"]
if group_name:
groups.setdefault(group_name, [])
groups[group_name].append((check_type, check))
+ return groups
+
+
+# This function validates the checks which are members of checkgroups to have either
+# all or none an item. Mixed checkgroups lead to strange exceptions when processing
+# the check parameters. So it is much better to catch these errors in a central place
+# with a clear error message.
+def verify_checkgroup_members():
+ groups = checks_by_checkgroup()
for group_name, checks in groups.items():
with_item, without_item = [], []
@@ -4840,6 +4845,7 @@ def compute_check_parameters(host, checktype, item, params):
params = entry
return params
+
def get_checkgroup_parameters(host, checktype, item):
checkgroup = check_info[checktype]["group"]
if not checkgroup:
@@ -4854,6 +4860,22 @@ def get_checkgroup_parameters(host, checktype, item):
return service_extra_conf(host, item, rules)
+# Verify that the user has no deprecated check groups configured.
+def verify_non_deprecated_checkgroups():
+ groups = checks_by_checkgroup()
+
+ for checkgroup, rules in checkgroup_parameters.items():
+ if checkgroup not in groups:
+ raise MKGeneralException(
+ "Found configured rules of deprecated check group \"%s\". These rules are not used "
+ "by any check. Maybe this check group has been renamed during an update, "
+ "in this case you will have to migrate your configuration to the new ruleset manually. "
+ "Please check out the release notes of the involved versions. "
+ "You may use the page \"Deprecated rules\" in WATO to view your rules and move them to "
+ "the new rulesets." % checkgroup)
+
+
+
def output_profile():
if g_profile:
g_profile.dump_stats(g_profile_path)
diff --git a/modules/nagios.py b/modules/nagios.py
index fa45388..a032a64 100644
--- a/modules/nagios.py
+++ b/modules/nagios.py
@@ -79,6 +79,8 @@ def create_nagios_config(outfile = sys.stdout, hostnames = None):
if summary_service_notification_periods != []:
raise MKGeneralException("summary_service_notification_periods is not longer supported. Please use extra_summary_service_conf['notification_period'] instead.")
+ verify_non_deprecated_checkgroups()
+
# Map service_period to _SERVICE_PERIOD. This field das not exist in Nagios/Icinga.
# The CMC has this field natively.
if "service_period" in extra_host_conf: