Module: check_mk
Branch: master
Commit: 5f1dd7ed6bb7e58103bf9feaaf808b577b221a17
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5f1dd7ed6bb7e5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 20 09:51:57 2014 +0100
#1527 FIX Fixed views missing values of some filters (serviceregex, hostgroup filters, ...)
With the rewrite of the views/dashboards/visuals we introduced a mechanism of transforming
views of the old format to the new format. This transform mechanism missed to transform
hard coded values of some filters where the variable names had been renamed.
The affected filters are:
'serviceregex'
'hostregex'
'hostgroupnameregex'
'servicegroupnameregex'
'opthostgroup'
'optservicegroup'
'hostgroup'
'servicegroup'
'host_contactgroup'
'service_contactgroup'
If you already have migrated to a previous release, which transformed your views and made
you miss these filters or hard coded values, you can install a version containing this
fix, remove the file <tt>var/check_mk/web/USER/user_views.mk</tt> from your site and then
access the Web-GUI again. This should fix the problem. Be aware: By removing the user_views.mk
all your changes to your views you made since the initial creation of the user_views.mk
will be reverted.
---
.werks/1527 | 31 +++++++++++++++++++++++++++++++
web/htdocs/views.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+)
diff --git a/.werks/1527 b/.werks/1527
new file mode 100644
index 0000000..502c88e
--- /dev/null
+++ b/.werks/1527
@@ -0,0 +1,31 @@
+Title: Fixed views missing values of some filters (serviceregex, hostgroup filters, ...)
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i6p3
+Date: 1416473103
+Class: fix
+
+With the rewrite of the views/dashboards/visuals we introduced a mechanism of transforming
+views of the old format to the new format. This transform mechanism missed to transform
+hard coded values of some filters where the variable names had been renamed.
+
+The affected filters are:
+
+'serviceregex'
+'hostregex'
+'hostgroupnameregex'
+'servicegroupnameregex'
+'opthostgroup'
+'optservicegroup'
+'hostgroup'
+'servicegroup'
+'host_contactgroup'
+'service_contactgroup'
+
+If you already have migrated to a previous release, which transformed your views and made
+you miss these filters or hard coded values, you can install a version containing this
+fix, remove the file <tt>var/check_mk/web/USER/user_views.mk</tt> from your site and then
+access the Web-GUI again. This should fix the problem. Be aware: By removing the user_views.mk
+all your changes to your views you made since the initial creation of the user_views.mk
+will be reverted.
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 8601980..b6f0d13 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -171,6 +171,7 @@ def transform_old_views():
# The exact match filters have been removed. They where used only as
# link filters anyway - at least by the builtin views.
continue
+
for var in f.htmlvars:
# Check whether or not the filter is supported by the datasource,
# then either skip or use the filter vars
@@ -179,6 +180,56 @@ def transform_old_views():
all_vars[var] = value
context[filter_name][var] = value
+ # We changed different filters since the visuals-rewrite. This must be treated here, since
+ # we need to transform views which have been created with the old filter var names.
+ # Changes which have been made so far:
+ changed_filter_vars = {
+ 'serviceregex': { # Name of the filter
+ # old var name: new var name
+ 'service': 'service_regex',
+ },
+ 'hostregex': {
+ 'host': 'host_regex',
+ },
+ 'hostgroupnameregex': {
+ 'hostgroup_name': 'hostgroup_regex',
+ },
+ 'servicegroupnameregex': {
+ 'servicegroup_name': 'servicegroup_regex',
+ },
+ 'opthostgroup': {
+ 'opthostgroup': 'opthost_group',
+ 'neg_opthostgroup': 'neg_opthost_group',
+ },
+ 'optservicegroup': {
+ 'optservicegroup': 'optservice_group',
+ 'neg_optservicegroup': 'neg_optservice_group',
+ },
+ 'hostgroup': {
+ 'hostgroup': 'host_group',
+ 'neg_hostgroup': 'neg_host_group',
+ },
+ 'servicegroup': {
+ 'servicegroup': 'service_group',
+ 'neg_servicegroup': 'neg_service_group',
+ },
+ 'host_contactgroup': {
+ 'host_contactgroup': 'host_contact_group',
+ 'neg_host_contactgroup': 'neg_host_contact_group',
+ },
+ 'service_contactgroup': {
+ 'service_contactgroup': 'service_contact_group',
+ 'neg_service_contactgroup': 'neg_service_contact_group',
+ },
+ }
+
+ if filter_name in changed_filter_vars and f.info in datasource['infos']:
+ for old_var, new_var in changed_filter_vars[filter_name].items():
+ if old_var in filtervars:
+ value = filtervars[old_var]
+ all_vars[new_var] = value
+ context[filter_name][new_var] = value
+
# Now, when there are single object infos specified, add these keys to the
# context
for single_key in single_keys:
Module: check_mk
Branch: master
Commit: 3614736a064012ec64222ba36953f4cf475d61b8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3614736a064012…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Nov 19 17:20:53 2014 +0100
parse_function: fixed exception when subchecks should use parsed data
---
modules/check_mk.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index f37deaf..8b1b58a 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2926,7 +2926,7 @@ def make_inventory(checkname, hostnamelist, check_only=False, include_state=Fals
if checkname_base in check_info: # parse function must be define for base check
parse_function = check_info[checkname_base]["parse_function"]
if parse_function:
- info = check_info[checkname]["parse_function"](info)
+ info = check_info[checkname_base]["parse_function"](info)
except MKAgentError, e:
# This special handling is needed for the inventory check. It needs special
Module: check_mk
Branch: master
Commit: a8236feb565c1ced549ff10e1eb9716781367b04
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a8236feb565c1c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 19 17:17:08 2014 +0100
#1506 FIX Fixed randomly hidden dashboard title
When dashboards with title enabled and without title were opened after each other,
it could happen randomly, that the dashboard with a title was hiding the title
behind the dashlets.
---
.werks/1506 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/dashboard.py | 5 +++--
web/plugins/dashboard/builtin.py | 3 +++
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/.werks/1506 b/.werks/1506
new file mode 100644
index 0000000..5626eaf
--- /dev/null
+++ b/.werks/1506
@@ -0,0 +1,12 @@
+Title: Fixed randomly hidden dashboard title
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1416413736
+
+When dashboards with title enabled and without title were opened after each other,
+it could happen randomly, that the dashboard with a title was hiding the title
+behind the dashlets.
diff --git a/ChangeLog b/ChangeLog
index 66bd4b3..25aa3db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -56,6 +56,7 @@
* 1436 FIX: quicksearch: search with multiple patterns (h: / s:) no longer discards the host pattern...
* 1438 FIX: quicksearch: fixed various non-working quicksearch filters...
* 1501 FIX: Legacy view formats created with 2014-09 snapshots are now converted...
+ * 1506 FIX: Fixed randomly hidden dashboard title...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 20abdf6..77cd07c 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -47,7 +47,6 @@ MAX = -1
# These settings might go into the config module, sometime in future,
# in order to allow the user to customize this.
-header_height = 60 # Distance from top of the screen to the lower border of the heading
screen_margin = 5 # Distance from the left border of the main-frame to the dashboard area
dashlet_padding = 21, 5, 5, 0, 4 # Margin (N, E, S, W, N w/o title) between outer border of dashlet and its content
corner_overlap = 22
@@ -263,10 +262,12 @@ def render_dashboard(name):
title = visuals.visual_title('dashboard', board)
+ # Distance from top of the screen to the lower border of the heading
+ header_height = 60
+
# The title of the dashboard needs to be prefixed with the WATO path,
# in order to make it clear to the user, that he is seeing only partial
# data.
- global header_height
if not board.get('show_title'):
# Remove the whole header line
html.set_render_headfoot(False)
diff --git a/web/plugins/dashboard/builtin.py b/web/plugins/dashboard/builtin.py
index a7f6672..e486289 100644
--- a/web/plugins/dashboard/builtin.py
+++ b/web/plugins/dashboard/builtin.py
@@ -28,6 +28,7 @@ builtin_dashboards["main"] = {
"single_infos": [],
"context" : {},
"mtime" : 0,
+ "show_title" : True,
"title" : _("Main Overview"),
"topic" : _("Overview"),
"description" : _("This dashboard gives you a general overview on the state of your "
@@ -198,6 +199,7 @@ if defaults.omd_site:
"single_infos": [],
"context" : {},
"mtime" : 0,
+ "show_title" : True,
"title" : _("Network Topology"),
"topic" : _("Overview"),
"description" : _("This dashboard uses the parent relationships of your hosts to display a "
@@ -220,6 +222,7 @@ builtin_dashboards["simple_problems"] = {
"single_infos": [],
"context" : {},
"mtime" : 0,
+ "show_title" : True,
"title" : _("Host & Services Problems"),
"topic" : _("Overview"),
"description" : _("A compact dashboard which lists your unhandled host and service problems."),
Module: check_mk
Branch: master
Commit: 4922b9f49696a0c2cacdb78c722a5b02f3c25ff6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4922b9f49696a0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 19 14:20:51 2014 +0100
#1505 FIX Snapshots are now bound to the used monitoring core
Snapshots created with CMC can not be restored on sites currently
using another core and vice versa. If you need to restore a snapshot
using another core, you might switch to this core, restore the snapshot
and then switch back to your former core.
---
.werks/1505 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 21 +++++++++++++++++++--
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/.werks/1505 b/.werks/1505
new file mode 100644
index 0000000..5a3edb3
--- /dev/null
+++ b/.werks/1505
@@ -0,0 +1,13 @@
+Title: Snapshots are now bound to the used monitoring core
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1416403159
+
+Snapshots created with CMC can not be restored on sites currently
+using another core and vice versa. If you need to restore a snapshot
+using another core, you might switch to this core, restore the snapshot
+and then switch back to your former core.
diff --git a/ChangeLog b/ChangeLog
index b43a02d..66bd4b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,7 @@
* 1492 FIX: Fixed too long URL bug when deleting a timeperiod right after creating one
* 1498 FIX: Fixed displaying of global settings titles / help texts...
* 1502 FIX: Fixed removing elements from ListOf choices during complain phase
+ * 1505 FIX: Snapshots are now bound to the used monitoring core...
Notifications:
* 1512 Bulk notification can now be grouped according to custom macro values...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 432691f..c411961 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6436,6 +6436,22 @@ def get_snapshot_status(snapshot, validate_checksums = False):
else:
raise MKGeneralException(_("Invalid snapshot (missing file: %s)") % entry)
+ def check_core():
+ if not defaults.omd_root:
+ return # Do not perform this check in non OMD environments
+ cmk_tar = cStringIO.StringIO(access_snapshot(lambda x: multitar.get_file_content(x, 'check_mk.tar.gz')))
+ files = multitar.list_tar_content(cmk_tar)
+ using_cmc = os.path.exists(defaults.omd_root + '/etc/check_mk/conf.d/microcore.mk')
+ snapshot_cmc = 'conf.d/microcore.mk' in files
+ if using_cmc and not snapshot_cmc:
+ raise MKGeneralException(_('You are currently using the Check_MK Microcore, but this snapshot does not use the '
+ 'Check_MK Microcore. If you need to migrate your data, you could consider changing '
+ 'the core, restoring the snapshot and changing the core back again.'))
+ elif not using_cmc and snapshot_cmc:
+ raise MKGeneralException(_('You are currently not using the Check_MK Microcore, but this snapshot uses the '
+ 'Check_MK Microcore. If you need to migrate your data, you could consider changing '
+ 'the core, restoring the snapshot and changing the core back again.'))
+
def snapshot_secret():
path = defaults.default_config_dir + '/snapshot.secret'
try:
@@ -6525,6 +6541,7 @@ def get_snapshot_status(snapshot, validate_checksums = False):
check_size()
check_extension()
check_content()
+ check_core()
if validate_checksums:
check_checksums()
@@ -6606,10 +6623,10 @@ def mode_snapshot_detail(phase):
html.write("<td>")
if verify_checksum:
- if values['checksum'] == True:
+ if values.get('checksum') == True:
checksum_title = _('Checksum valid and signed')
checksum_icon = ''
- elif values['checksum'] == False:
+ elif values.get('checksum') == False:
checksum_title = _('Checksum invalid and not signed')
checksum_icon = 'p'
else: