lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
February 2019
----- 2024 -----
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
18 participants
457 discussions
Start a n
N
ew thread
Extracted sorter list calulation for easier testing
by Lars Michelsen
Module: check_mk Branch: master Commit: 88c961877f5a8d5c20fdb35c4133366070a7a58f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=88c961877f5a8d…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 7 11:56:12 2019 +0100 Extracted sorter list calulation for easier testing Change-Id: I2509e3557cc964faf8c14d00ce213034f143b2d8 --- cmk/gui/views.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/cmk/gui/views.py b/cmk/gui/views.py index e5954bc..0d3c706 100644 --- a/cmk/gui/views.py +++ b/cmk/gui/views.py @@ -1052,16 +1052,7 @@ def show_view(view, query = filterheaders + view.get("add_headers", "") # Sorting - use view sorters and URL supplied sorters - if not only_count: - user_sorters = parse_url_sorters(html.request.var("sort")) - if user_sorters: - sorter_list = user_sorters - else: - sorter_list = view["sorters"] - - sorters = _get_sorters(sorter_list) - else: - sorters = [] + sorters = get_sorters(view, only_count, html.request.var("sort")) # Prepare cells of the view # Group cells: Are displayed as titles of grouped rows @@ -1187,7 +1178,20 @@ def show_view(view, SorterEntry = namedtuple("SorterEntry", ["sorter", "negate", "join_key"]) -def _get_sorters(sorter_list): +def get_sorters(view, only_count, user_sort_parameter): + if only_count: + return [] + + user_sorters = parse_url_sorters(user_sort_parameter) + if user_sorters: + sorter_list = user_sorters + else: + sorter_list = view["sorters"] + + return _get_sorter_entries(sorter_list) + + +def _get_sorter_entries(sorter_list): sorters = [] for entry in sorter_list: if entry[0] not in sorter_registry: @@ -1455,8 +1459,13 @@ def _do_table_join(master_ds, master_rows, master_filters, join_cells, join_colu join_filters.append("Or: %d" % len(join_filters)) query = "%s%s\n" % (master_filters, "\n".join(join_filters)) - rows = query_data(slave_ds, [join_master_column, join_slave_column] + join_columns, [], query, - only_sites, None) + rows = query_data( + datasource=slave_ds, + columns=[join_master_column, join_slave_column] + join_columns, + add_columns=[], + add_headers=query, + only_sites=only_sites, + limit=None) per_master_entry = {} current_key = None current_entry = None
5 years, 7 months
1
0
0
0
Fixed broken joining of services in host columns
by Lars Michelsen
Module: check_mk Branch: master Commit: 0cf0e80ee68b041b3fe1301e47c93b5f2b7cc2fd URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0cf0e80ee68b04…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 7 12:15:13 2019 +0100 Fixed broken joining of services in host columns Added some regression tests for gathering the livestatus regular columns and join columns based on a view definition. Change-Id: I3052c00f00070bc3fb897204cdcae2e1243db98f --- cmk/gui/views.py | 6 ++++ tests/unit/cmk/gui/test_views.py | 64 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/cmk/gui/views.py b/cmk/gui/views.py index af11af4..6b7603f 100644 --- a/cmk/gui/views.py +++ b/cmk/gui/views.py @@ -1253,6 +1253,12 @@ def _get_needed_join_columns(join_cells, sorters): for entry in sorters: join_columns.update(entry.sorter.columns) + # Remove (implicit) site column + try: + join_columns.remove("site") + except KeyError: + pass + return list(join_columns) diff --git a/tests/unit/cmk/gui/test_views.py b/tests/unit/cmk/gui/test_views.py index 2c05cb8..7feaec9 100644 --- a/tests/unit/cmk/gui/test_views.py +++ b/tests/unit/cmk/gui/test_views.py @@ -1,3 +1,4 @@ +import copy import pytest from pathlib2 import Path import cmk.gui.config as config @@ -5705,3 +5706,66 @@ def test_register_sorter(monkeypatch): assert sorter.title == "A B C" assert sorter.columns == ["x"] assert sorter.cmp.__name__ == cmpfunc.__name__ + + +def test_get_needed_regular_columns(register_builtin_html, load_view_plugins): + view = cmk.gui.views.multisite_builtin_views["allhosts"] + + datasource = cmk.gui.views._get_datasource(view) + sorters = cmk.gui.views.get_sorters(view, only_count=False, user_sort_parameter=None) + group_cells = cmk.gui.views.get_group_cells(view) + cells = cmk.gui.views.get_cells(view) + + columns = cmk.gui.views._get_needed_regular_columns(group_cells + cells, sorters, datasource) + assert sorted(columns) == sorted([ + 'host_scheduled_downtime_depth', + 'host_in_check_period', + 'host_num_services_pending', + 'host_downtimes_with_extra_info', + 'host_pnpgraph_present', + 'host_check_type', + 'host_active_passive_checks', + 'host_num_services_crit', + 'host_icon_image', + 'host_is_flapping', + 'host_in_notification_period', + 'host_check_command', + 'host_modified_attributes_list', + 'host_downtimes', + 'host_filename', + 'host_acknowledged', + 'host_custom_variable_names', + 'host_state', + 'host_action_url_expanded', + 'host_comments_with_extra_info', + 'host_in_service_period', + 'host_num_services_ok', + 'host_has_been_checked', + 'host_address', + 'host_staleness', + 'host_num_services_unknown', + 'host_notifications_enabled', + 'host_active_checks_enabled', + 'host_perf_data', + 'host_custom_variable_values', + 'host_name', + 'host_num_services_warn', + 'host_notes_url_expanded', + ]) + + +def test_get_needed_join_columns(register_builtin_html, load_view_plugins): + builtin_view = cmk.gui.views.multisite_builtin_views["allhosts"] + + view = copy.deepcopy(builtin_view) + view["painters"].append(('service_description', None, None, u'CPU load')) + + sorters = cmk.gui.views.get_sorters(view, only_count=False, user_sort_parameter=None) + cells = cmk.gui.views.get_cells(view) + join_cells = cmk.gui.views.get_join_cells(cells) + + columns = cmk.gui.views._get_needed_join_columns(join_cells, sorters) + assert sorted(columns) == sorted([ + 'host_name', + 'service_description', + ])
5 years, 7 months
1
0
0
0
Extracted datasource construction for easier testing
by Lars Michelsen
Module: check_mk Branch: master Commit: 1a2b0739eb76d561fd1e4fdd080ad2e7e217502c URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a2b0739eb76d5…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 7 11:59:33 2019 +0100 Extracted datasource construction for easier testing Change-Id: I3c82a11bc443c4996b86bb3be272be8480987559 --- cmk/gui/views.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/cmk/gui/views.py b/cmk/gui/views.py index 0d3c706..af11af4 100644 --- a/cmk/gui/views.py +++ b/cmk/gui/views.py @@ -946,19 +946,7 @@ def show_view(view, show_checkboxes = force_checkboxes or html.request.var('show_checkboxes', '0') == '1' # Get the datasource (i.e. the logical table) - try: - datasource = data_source_registry[view["datasource"]]() - except KeyError: - if view["datasource"].startswith("mkeventd_"): - raise MKUserError( - None, - _("The Event Console view '%s' can not be rendered. The Event Console is possibly " - "disabled.") % view["name"]) - else: - raise MKUserError( - None, - _("The view '%s' using the datasource '%s' can not be rendered " - "because the datasource does not exist.") % (view["name"], view["datasource"])) + datasource = _get_datasource(view) tablename = datasource.table @@ -1175,6 +1163,22 @@ def show_view(view, show_checkboxes, layout, num_columns, show_filters, show_footer, browser_reload) +def _get_datasource(view): + try: + return data_source_registry[view["datasource"]]() + except KeyError: + if view["datasource"].startswith("mkeventd_"): + raise MKUserError( + None, + _("The Event Console view '%s' can not be rendered. The Event Console is possibly " + "disabled.") % view["name"]) + else: + raise MKUserError( + None, + _("The view '%s' using the datasource '%s' can not be rendered " + "because the datasource does not exist.") % (view["name"], view["datasource"])) + + SorterEntry = namedtuple("SorterEntry", ["sorter", "negate", "join_key"])
5 years, 7 months
1
0
0
0
mk_logwatch: make unit test deterministic
by Florian Kromer
Module: check_mk Branch: master Commit: 99c7121bc4143cba2ab513d3dc2a12d3501eca34 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=99c7121bc4143c…
Author: Florian Kromer <fk(a)mathias-kettner.de> Date: Thu Feb 7 10:04:16 2019 +0100 mk_logwatch: make unit test deterministic Change-Id: I98b29128331349b6ad89249689fc46d13d431c28 --- tests/unit/agents/plugins/test_mk_logwatch.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/unit/agents/plugins/test_mk_logwatch.py b/tests/unit/agents/plugins/test_mk_logwatch.py index 4c7f8a6..9d307d0 100644 --- a/tests/unit/agents/plugins/test_mk_logwatch.py +++ b/tests/unit/agents/plugins/test_mk_logwatch.py @@ -191,6 +191,7 @@ def test_read_status(tmpdir): # execution actual_status = mk_logwatch.read_status(file_path) + # comparing dicts (having unordered keys) is ok assert actual_status == { '/var/log/messages': (7767698, 32455445), '/var/test/x12134.log': (12345, 32444355) @@ -206,6 +207,6 @@ def test_save_status(tmpdir): '/var/test/x12134.log': (12345, 32444355) } mk_logwatch.save_status(fake_status, file_path) - assert fake_status_file.read() == """/var/log/messages|7767698|32455445 -/var/test/x12134.log|12345|32444355 -""" + assert sorted(fake_status_file.read().splitlines()) == [ + '/var/log/messages|7767698|32455445', '/var/test/x12134.log|12345|32444355' + ]
5 years, 7 months
1
0
0
0
7151 FIX apache_status: fixed NameError
by Ronny Bruska
Module: check_mk Branch: master Commit: 568cacc7eed2caddce910cd618334b39cefbf5fa URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=568cacc7eed2ca…
Author: Ronny Bruska <rb(a)mathias-kettner.de> Date: Thu Feb 7 10:10:23 2019 +0100 7151 FIX apache_status: fixed NameError Change-Id: Ic8393640dda81bd1c81e679e564989cf75eaf961 --- .werks/7151 | 10 ++++++++++ agents/plugins/apache_status | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.werks/7151 b/.werks/7151 new file mode 100644 index 0000000..c00ac83 --- /dev/null +++ b/.werks/7151 @@ -0,0 +1,10 @@ +Title: apache_status: fixed NameError +Level: 1 +Component: checks +Compatible: compat +Edition: cre +Version: 1.6.0i1 +Date: 1549530332 +Class: fix + + diff --git a/agents/plugins/apache_status b/agents/plugins/apache_status index e34d762..7b4c739 100755 --- a/agents/plugins/apache_status +++ b/agents/plugins/apache_status @@ -100,7 +100,7 @@ def try_detect_servers(): server_address = '127.0.0.1' elif server_address == '::': server_address = '[::1]' - elif ':' in address: + elif ':' in server_address: server_address = '[%s]' % server_address # Switch protocol if port is SSL port. In case you use SSL on another
5 years, 7 months
1
0
0
0
Removed print statement
by Simon Betz
Module: check_mk Branch: master Commit: c82d28853ef94ca78b964355c85cc493ad1c4135 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c82d28853ef94c…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Thu Feb 7 10:53:00 2019 +0100 Removed print statement Change-Id: I9a02ceee02a713f9cf62e931becd1031f341e883 --- checks/agent_aws | 1 - 1 file changed, 1 deletion(-) diff --git a/checks/agent_aws b/checks/agent_aws index 17e9c64..7222f66 100644 --- a/checks/agent_aws +++ b/checks/agent_aws @@ -36,7 +36,6 @@ def _get_tag_options(tag_values, prefix): def _get_services_choice(services): - print services # '--services': { # 's3': {'choice': ('tags', [('KEY', ['VAL1', 'VAL2'])])}, # 'ec2': {'choice': 'all'},
5 years, 7 months
1
0
0
0
Reserved 3 Werk IDS
by Ronny Bruska
Module: check_mk Branch: master Commit: 53d5b0cced16f700096018f5a10e7a7e4d6efccc URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=53d5b0cced16f7…
Author: Ronny Bruska <rb(a)mathias-kettner.de> Date: Thu Feb 7 10:04:13 2019 +0100 Reserved 3 Werk IDS Change-Id: Ib2dc30d9ac3c946844912a1086386a0fb7c46a1a --- .werks/first_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.werks/first_free b/.werks/first_free index 364ca62..088079f 100644 --- a/.werks/first_free +++ b/.werks/first_free @@ -1 +1 @@ -7151 +7154
5 years, 7 months
1
0
0
0
Reserved 10 Werk IDS
by Moritz Kiemer
Module: check_mk Branch: master Commit: 51f6486017ae918b8324200fcb3f1da37acf162e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=51f6486017ae91…
Author: Moritz Kiemer <mo(a)mathias-kettner.de> Date: Thu Feb 7 09:55:27 2019 +0100 Reserved 10 Werk IDS Change-Id: Ia748b8690eb47886f1419e93de55a0bf3c6c787c --- .werks/first_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.werks/first_free b/.werks/first_free index eedd0c9..364ca62 100644 --- a/.werks/first_free +++ b/.werks/first_free @@ -1 +1 @@ -7141 +7151
5 years, 7 months
1
0
0
0
Fixed position of the ListOf valuespec "Add" button
by Lars Michelsen
Module: check_mk Branch: master Commit: 3394dfa39be0785e28bc038496c0130a615c58b3 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3394dfa39be078…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 7 09:33:22 2019 +0100 Fixed position of the ListOf valuespec "Add" button Change-Id: I66a466b6dbdf597c3d39c793f62d095972681ef7 --- cmk/gui/valuespec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmk/gui/valuespec.py b/cmk/gui/valuespec.py index c5b853d..582eac4 100644 --- a/cmk/gui/valuespec.py +++ b/cmk/gui/valuespec.py @@ -1278,9 +1278,9 @@ class ListOf(ValueSpec): def _show_entries(self, varprefix, value): if self._style == ListOf.Style.REGULAR: + self._show_current_entries(varprefix, value) html.br() self._list_buttons(varprefix) - self._show_current_entries(varprefix, value) elif self._style == ListOf.Style.FLOATING: html.open_table()
5 years, 7 months
1
0
0
0
Service discovery: Fix "Updating..." message hiding error result
by Lars Michelsen
Module: check_mk Branch: master Commit: c60f02886227084e7d3f39159d473d0e206e50a6 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c60f0288622708…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Feb 7 07:46:16 2019 +0100 Service discovery: Fix "Updating..." message hiding error result The "Updating..." message is shown to the user during service discovery when the request takes more than 2 seconds. In case the discovery produces a final result this message should be hidden. In case an unhandled exception occured during discovery within the 2 seconds, the "Updating..." dialog did overwrite the error message. Change-Id: Ibf69af2d27f64e9f4852898cbe60b327a38e9d48 --- web/htdocs/js/modules/activation.js | 3 +++ web/htdocs/js/modules/async_progress.js | 2 +- web/htdocs/js/modules/service_discovery.js | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/web/htdocs/js/modules/activation.js b/web/htdocs/js/modules/activation.js index eac9dfc..c6daaaa 100644 --- a/web/htdocs/js/modules/activation.js +++ b/web/htdocs/js/modules/activation.js @@ -122,6 +122,9 @@ function handle_start_activation(_unused, response_json) "update_function": update_activation_state, "is_finished_function": is_activation_progress_finished, "finish_function": finish_activation, + "error_function": function(response) { + async_progress.show_error(response); + }, "post_data": "" }); } diff --git a/web/htdocs/js/modules/async_progress.js b/web/htdocs/js/modules/async_progress.js index d5c23bb..73699ed 100644 --- a/web/htdocs/js/modules/async_progress.js +++ b/web/htdocs/js/modules/async_progress.js @@ -56,7 +56,7 @@ function handle_update(handler_data, response_json) { var response = JSON.parse(response_json); if (response.result_code == 1) { - show_error(response.result); + handler_data.error_function(response.result); return; // Abort on error! } else { handler_data.update_function(handler_data, response.result); diff --git a/web/htdocs/js/modules/service_discovery.js b/web/htdocs/js/modules/service_discovery.js index 1bd1273..f2902dc 100644 --- a/web/htdocs/js/modules/service_discovery.js +++ b/web/htdocs/js/modules/service_discovery.js @@ -54,6 +54,7 @@ export function start(host_name, folder_path, discovery_options, transid, reques "is_finished_function": is_finished, "update_function": update, "finish_function": finish, + "error_function": error, "post_data": get_post_data(host_name, folder_path, discovery_options, transid, request_vars) }); } @@ -107,6 +108,15 @@ function finish(response) lock_controls(false); } +function error(response) +{ + if (g_show_updating_timer) { + clearTimeout(g_show_updating_timer); + } + async_progress.show_error(response); +} + + function update(handler_data, response) { if (g_show_updating_timer) { clearTimeout(g_show_updating_timer);
5 years, 7 months
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
46
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Results per page:
10
25
50
100
200