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
April 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
15 participants
599 discussions
Start a n
N
ew thread
fixed set_browser_reload issues
by Andreas Boesl
Module: check_mk Branch: master Commit: 58fb020b3f3ffc099a78aac1a34f6f38799603b2 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=58fb020b3f3ffc…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Fri Apr 12 11:24:40 2019 +0200 fixed set_browser_reload issues Change-Id: I9f0cd720e5c664edfceb2c3be5e0dd30980b465e --- cmk/gui/plugins/wato/background_job.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmk/gui/plugins/wato/background_job.py b/cmk/gui/plugins/wato/background_job.py index 4af3423..fc59ae7 100644 --- a/cmk/gui/plugins/wato/background_job.py +++ b/cmk/gui/plugins/wato/background_job.py @@ -90,7 +90,7 @@ class ModeBackgroundJobsOverview(WatoMode): if any( job_manager.get_running_job_ids(c) for c in gui_background_job.job_registry.values()): - html.set_browser_reload(0.8) + html.immediate_browser_redirect(0.8, "") def action(self): action_handler = gui_background_job.ActionHandler() @@ -136,7 +136,7 @@ class ModeBackgroundJobDetails(WatoMode): job_manager = gui_background_job.GUIBackgroundJobManager() job_manager.show_job_details_from_snapshot(job_snapshot) if job_snapshot.is_running(): - html.set_browser_reload(1) + html.immediate_browser_redirect(1, "") def action(self): action_handler = gui_background_job.ActionHandler()
5 years, 5 months
1
0
0
0
sap_hana_{backup, license}: Fixed non matching ruleset {{SAP HANA Backup}} resp. {{SAP HANA License}}
by Simon Betz
Module: check_mk Branch: master Commit: 1e742f456859d0e38a0cadce6a3e27ddb2b77821 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1e742f456859d0…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Thu Apr 11 14:13:19 2019 +0200 sap_hana_{backup,license}: Fixed non matching ruleset {{SAP HANA Backup}} resp. {{SAP HANA License}} Change-Id: I26ce70d549198d5d385e89f354052c5b37e30170 --- checks/sap_hana_backup | 4 ++-- checks/sap_hana_license | 6 +++--- cmk/gui/plugins/metrics/check_mk.py | 2 +- cmk/gui/plugins/wato/check_parameters/sap_hana.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/checks/sap_hana_backup b/checks/sap_hana_backup index 73c94c0..5478814 100644 --- a/checks/sap_hana_backup +++ b/checks/sap_hana_backup @@ -25,7 +25,7 @@ # Boston, MA 02110-1301 USA. factory_settings['sap_hana_backup'] = { - 'backup_age_levels': (24 * 60 * 60, 2 * 24 * 60 * 60), + 'backup_age': (24 * 60 * 60, 2 * 24 * 60 * 60), } @@ -77,7 +77,7 @@ def check_sap_hana_backup(item, params, parsed): yield check_levels( time.time() - data['sys_end_time'], "backup_age", - params['backup_age_levels'], + params['backup_age'], human_readable_func=get_age_human_readable, infoname="Age") diff --git a/checks/sap_hana_license b/checks/sap_hana_license index 3aca5f1..1387222 100644 --- a/checks/sap_hana_license +++ b/checks/sap_hana_license @@ -25,7 +25,7 @@ # Boston, MA 02110-1301 USA. factory_settings['sap_hana_license_default_levels'] = { - 'license_usage_perc': (80.0, 90.0), + 'license_usage': (80.0, 90.0), } SAP_HANA_MAYBE = collections.namedtuple("SAP_HANA_MAYBE", ["bool", "value"]) @@ -119,8 +119,8 @@ def _check_product_usage(size, limit, params): else: yield check_levels( usage_perc, - "license_usage_perc", - params.get('license_usage_perc', (None, None)), + "license_usage", + params['license_usage'], human_readable_func=get_percent_human_readable, infoname="Usage") diff --git a/cmk/gui/plugins/metrics/check_mk.py b/cmk/gui/plugins/metrics/check_mk.py index 6482bf8..21c1b0c 100644 --- a/cmk/gui/plugins/metrics/check_mk.py +++ b/cmk/gui/plugins/metrics/check_mk.py @@ -3124,7 +3124,7 @@ metric_info["license_size"] = { "color": "11/a", } -metric_info["license_usage_perc"] = { +metric_info["license_usage"] = { "title": _("License usage"), "unit": "%", "color": "13/a", diff --git a/cmk/gui/plugins/wato/check_parameters/sap_hana.py b/cmk/gui/plugins/wato/check_parameters/sap_hana.py index 1a5f837..cd838dc 100644 --- a/cmk/gui/plugins/wato/check_parameters/sap_hana.py +++ b/cmk/gui/plugins/wato/check_parameters/sap_hana.py @@ -64,7 +64,7 @@ class RulespecCheckgroupParametersSapHanaBackup(CheckParameterRulespecWithItem): @property def parameter_valuespec(self): return Dictionary(elements=[ - ('backup_age_levels', + ('backup_age', Alternative( title=_("Upper levels for the backup age"), style="dropdown",
5 years, 5 months
1
0
0
0
mk_mysql: remove redundant code
by Moritz Kiemer
Module: check_mk Branch: master Commit: 9eaff28ab82638688c6ed73b54e506e06614314f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9eaff28ab82638…
Author: Moritz Kiemer <mo(a)mathias-kettner.de> Date: Fri Apr 12 08:41:19 2019 +0200 mk_mysql: remove redundant code Change-Id: I55c1916dc9f026f7b94e86dd6a2306cb312091bb --- agents/plugins/mk_mysql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agents/plugins/mk_mysql b/agents/plugins/mk_mysql index be2254e..117fc6c 100755 --- a/agents/plugins/mk_mysql +++ b/agents/plugins/mk_mysql @@ -25,14 +25,14 @@ # gets optional socket as argument function do_query() { - INSTANCE=$(echo $1|awk -v FS="=" '{print $2}') + SOCKET="$1" COUNT=$(ps -fww -C mysqld | grep socket | wc -l) if [ $COUNT -gt 1 ] then - INSTANCE_NAME=$(ps -efww|grep socket|grep "${INSTANCE}"|grep "[u]ser" | sed -ne 's/.*socket=\([^.]*\).*/\1/p') + INSTANCE_NAME=$(ps -efww|grep socket|grep "${SOCKET}"|grep "[u]ser" | sed -ne 's/.*socket=\([^.]*\).*/\1/p') INSTANCE_NAME="[[${INSTANCE_NAME##*/}]]" else - INSTANCE_NAME="[[$(ps -efww|grep socket|grep "${INSTANCE}"|grep "[u]ser" | sed -ne 's/.*user=\([^ ]*\).*/\1/p')]]" + INSTANCE_NAME="[[$(ps -efww|grep socket|grep "${SOCKET}"|grep "[u]ser" | sed -ne 's/.*user=\([^ ]*\).*/\1/p')]]" fi @@ -74,7 +74,7 @@ then do_query "" else for socket in $mysql_sockets ; do - do_query "--socket="$socket + do_query "$socket" done fi #echo "<<<mysql_version>>>"
5 years, 5 months
1
0
0
0
Rename source-related columns to label_source ones.
by Sven Panne
Module: check_mk Branch: master Commit: 3990372c0d4caceed8739b82241beb7f91bb9358 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3990372c0d4cac…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Apr 12 10:49:01 2019 +0200 Rename source-related columns to label_source ones. CMK-1939 Change-Id: I6fb2adc5789222f6dc495c649e1a35e5a450af65 --- cmk/gui/plugins/views/painters.py | 4 ++-- cmk/gui/plugins/views/utils.py | 4 ++-- cmk_base/core_config.py | 2 +- livestatus/src/MonitoringCore.h | 6 +++--- livestatus/src/TableContacts.cc | 14 +++++++------- livestatus/src/TableHosts.cc | 27 ++++++++++++++------------- livestatus/src/TableServices.cc | 22 +++++++++++----------- tests/unit/cmk_base/test_core_config.py | 2 +- 8 files changed, 41 insertions(+), 40 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=3990372c0d…
5 years, 5 months
1
0
0
0
mysql: consolidate
by Moritz Kiemer
Module: check_mk Branch: master Commit: bae17bfb14edc7207000b7bff5b72bd3f2413922 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bae17bfb14edc7…
Author: Moritz Kiemer <mo(a)mathias-kettner.de> Date: Wed Apr 10 12:18:06 2019 +0200 mysql: consolidate Change-Id: Ibd74dd26dd156086205d6127fd3b1aa71207367f --- checks/mysql.include | 45 +++++++++++++++++++++++++++++++++ checks/mysql_capacity | 69 ++++++++++++++++++--------------------------------- checks/mysql_ping | 29 +++++++--------------- checks/mysql_slave | 57 ++++++++++++++---------------------------- 4 files changed, 96 insertions(+), 104 deletions(-) diff --git a/checks/mysql.include b/checks/mysql.include new file mode 100644 index 0000000..64e103d --- /dev/null +++ b/checks/mysql.include @@ -0,0 +1,45 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2019 mk(a)mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at
http://mathias-kettner.de/check_mk
. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# tails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + + +def _mysql_iter_instance_lines(lines): + def _detect_instance(line): + if line[0].startswith("[["): + instance = line[0].strip('[]') + return instance or "mysql" + return None + + instance = None + for line in lines: + detected_instance = _detect_instance(line) + if detected_instance: + instance = detected_instance + elif instance: + yield instance, line + + if instance is None: + for line in lines: + yield "mysql", line diff --git a/checks/mysql_capacity b/checks/mysql_capacity index dd1d47c..05db2e7 100644 --- a/checks/mysql_capacity +++ b/checks/mysql_capacity @@ -41,36 +41,21 @@ # test 409255936 54525952 -# FIXME: Crapy copy n paste! Consolidate with other mysql_* parse functions def parse_mysql_capacity(info): - def cut_spaces(line): + def _name_size_avail(line): name = " ".join(line[:-2]) - size = line[-2] - avail = line[-1] - return name, size, avail + return name, line[-2], line[-1] parsed = {} - instance = False - for line in info: - if line[0].startswith("[["): - instance = line[0][2:-2] - if instance == "": - instance = "mysql" - parsed[instance] = [] - elif instance: - parsed[instance].append(cut_spaces(line)) - - if not instance: - parsed['mysql'] = [] - for line in info: - parsed['mysql'].append(cut_spaces(line)) - + for instance, line in _mysql_iter_instance_lines(info): # pylint: disable=undefined-variable + name, size, avail = _name_size_avail(line) + parsed.setdefault(instance, {})[name] = (size, avail) return parsed @discover def inventory_mysql_size(instance, values): - for dbname, used, avail in values: + for dbname, (used, avail) in values.iteritems(): if dbname not in ["information_schema", "mysql", "performance_schema"] \ and used != 'NULL' and avail != 'NULL': yield "%s:%s" % (instance, dbname) @@ -84,32 +69,25 @@ def check_mysql_size(item, params, parsed): else: instance, dbname = item.split(':') - dbs = parsed[instance] + instance_data = parsed.get(instance) + if not instance_data or dbname not in instance_data: + return + + size, _avail = instance_data[dbname] # size and avail are given as bytes - for db, size, _avail in dbs: - if db == dbname: - if size == 'NULL': - return 3, "Missing information - Size is reported as 'NULL'" - size = int(size) - infotext = "Size: %s" % get_bytes_human_readable(size) - if params: - state = 0 - warn, crit = params - warn_b = warn * 1024 - crit_b = crit * 1024 - perfdata = [("database_size", size, warn_b, crit_b)] - if size > crit_b: - state = 2 - elif size > warn_b: - state = 1 - if state: - infotext += " (warn/crit at %s/%s)" % (get_bytes_human_readable(warn_b), - get_bytes_human_readable(crit_b)) - else: - state = 0 - perfdata = [("database_size", size)] - return state, infotext, perfdata + if size == 'NULL': + yield 3, "Missing information - Size is reported as 'NULL'" + return + + size = int(size) + levels = (params[0] * 1024, params[1] * 1024) if params else None + yield check_levels( + size, + 'database_size', + levels, + human_readable_func=get_bytes_human_readable, + infoname="Size") check_info['mysql_capacity'] = { @@ -119,4 +97,5 @@ check_info['mysql_capacity'] = { "service_description": "MySQL DB Size %s", "has_perfdata": True, "group": "mysql_db_size", + "includes": ["mysql.include"], } diff --git a/checks/mysql_ping b/checks/mysql_ping index 3cb6a57..78d5fc9 100644 --- a/checks/mysql_ping +++ b/checks/mysql_ping @@ -34,29 +34,17 @@ # FIXME: Crapy copy n paste! Consolidate with other mysql_* parse functions def parse_mysql_ping(info): parsed = {} - instance = False - for line in info: - if line[0].startswith("[["): - instance = line[0][2:-2] - if instance == "": - instance = "mysql" - parsed[instance] = [] - elif instance: - parsed[instance].append(" ".join(line)) - - # Support for the old plugin version without instances - if not instance: - parsed['mysql'] = [" ".join(x) for x in info] - + for instance, line in _mysql_iter_instance_lines(info): + parsed.setdefault(instance, []).append(line) return parsed -def check_mysql_ping(item, _no_params, parsed): - if item in parsed: - message = parsed[item][0] - if message == "mysqld is alive": - return 0, "MySQL Deamon is alive" - return 2, message +@get_parsed_item_data +def check_mysql_ping(_no_item, _no_params, data): + message = " ".join(data[0]) + if message == "mysqld is alive": + return 0, "MySQL Deamon is alive" + return 2, message check_info['mysql_ping'] = { @@ -64,4 +52,5 @@ check_info['mysql_ping'] = { "inventory_function": discover(), "check_function": check_mysql_ping, "service_description": "MySQL Instance %s", + "includes": ["mysql.include"], } diff --git a/checks/mysql_slave b/checks/mysql_slave index 1dfdf90..4dc5831 100644 --- a/checks/mysql_slave +++ b/checks/mysql_slave @@ -25,56 +25,34 @@ # Boston, MA 02110-1301 USA. -# FIXME: Crapy copy n paste! Consolidate with other mysql_* parse functions def parse_mysql_slave(info): - def parse_line(l): - if ':' in l[0]: - val = ' '.join(l[1:]) - - # Parse some values - try: - val = int(val) - except ValueError: - if val == 'Yes': - val = True - elif val == 'No': - val = False - elif val == 'None': - val = None - return line[0][:-1], val - return None, None + def parse_line(line): + if not line[0].endswith(':'): + return None, None + key = line[0][:-1] + + val = ' '.join(line[1:]) + # Parse some values + try: + val = int(val) + except ValueError: + val = {'Yes': True, 'No': False, 'None': None}.get(val, val) + return key, val parsed = {} - instance = False - for line in info: - if line[0].startswith("[["): - instance = line[0][2:-2] - if instance == "": - instance = "mysql" - parsed[instance] = {} - elif instance: - key, value = parse_line(line) - if key: - parsed[instance][key] = value - - # Support for old Plugin version - if not instance: - parsed['mysql'] = {} - for line in info: - key, value = parse_line(line) - if key: - parsed['mysql'][key] = value - + for instance, line in _mysql_iter_instance_lines(info): # pylint: disable=undefined-variable + key, value = parse_line(line) + parsed.setdefault(instance, {})[key] = value return parsed @discover -def inventory_mysql_slave(key, values): +def inventory_mysql_slave(_key, values): return len(values) > 0 @get_parsed_item_data -def check_mysql_slave(item, params, data): +def check_mysql_slave(_no_item, params, data): state = 0 perfdata = [] output = [] @@ -122,4 +100,5 @@ check_info['mysql_slave'] = { "service_description": "MySQL DB Slave %s", "has_perfdata": True, "group": "mysql_slave", + "includes": ["mysql.include"], }
5 years, 5 months
1
0
0
0
added WK7258: SLA configuration: Percentage values are now always shown with three decimal places
by Andreas Boesl
Module: check_mk Branch: master Commit: 80ac193b12e027a1a827afeb0929c8fdaf8d09e3 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=80ac193b12e027…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Fri Apr 12 11:31:30 2019 +0200 added WK7258: SLA configuration: Percentage values are now always shown with three decimal places Change-Id: I8dc8fe61f93947110f3f5f6e93e63b1303bda0db --- .werks/7258 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.werks/7258 b/.werks/7258 new file mode 100644 index 0000000..77a39a0 --- /dev/null +++ b/.werks/7258 @@ -0,0 +1,10 @@ +Title: SLA configuration: Percentage values are now always shown with three decimal places +Level: 1 +Component: multisite +Class: feature +Compatible: compat +Edition: cre +State: unknown +Version: 1.6.0i1 +Date: 1555054839 +
5 years, 5 months
1
0
0
0
improved agent response in case of incorrect credentials
by Andreas Boesl
Module: check_mk Branch: master Commit: d0285d8c80fb6097cafaef6d24c0c458d198c013 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d0285d8c80fb60…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Thu Apr 11 18:55:19 2019 +0200 improved agent response in case of incorrect credentials CMK-1889 Change-Id: Id9a7c955cacce6b306b987076e4df4b1176bbdb9 --- agents/special/agent_bi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/agents/special/agent_bi b/agents/special/agent_bi index d656ff9..a672f3a 100755 --- a/agents/special/agent_bi +++ b/agents/special/agent_bi @@ -178,8 +178,13 @@ class AggregationRawdataGenerator(object): def _parse_response_text(self, response_text): try: rawdata = ast.literal_eval(response_text) - except ValueError: # ast.literal_eval - raise RawdataException("Error: Unable to parse data from monitoring instance") + except (ValueError, SyntaxError): # ast.literal_eval + if "automation secret" in response_text: + raise RawdataException( + "Error: Unable to parse data from monitoring instance. Please check the login credentials" + ) + else: + raise RawdataException("Error: Unable to parse data from monitoring instance") if not isinstance(rawdata, dict): raise RawdataException("Error: Unable to process parsed data from monitoring instance")
5 years, 5 months
1
0
0
0
7257 WATO: The host diagnose page now also indicates if there are errors in the agent datasource
by Andreas Boesl
Module: check_mk Branch: master Commit: 06a5751129e715f11bccce9289a7254319f2daa1 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06a5751129e715…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Thu Apr 11 18:52:47 2019 +0200 7257 WATO: The host diagnose page now also indicates if there are errors in the agent datasource CMK-1889 Change-Id: Ic22a1c18dcd10d57d14049cacf750a297a1158fb --- .werks/7257 | 11 +++++++++++ cmk_base/automations/check_mk.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/.werks/7257 b/.werks/7257 new file mode 100644 index 0000000..29b04a5 --- /dev/null +++ b/.werks/7257 @@ -0,0 +1,11 @@ +Title: WATO: The host diagnose page now also indicates if there are errors in the agent datasource +Level: 1 +Component: wato +Class: feature +Compatible: compat +Edition: cre +State: unknown +Version: 1.6.0i1 +Date: 1555001446 + + diff --git a/cmk_base/automations/check_mk.py b/cmk_base/automations/check_mk.py index 86cb6c2..8483e1b 100644 --- a/cmk_base/automations/check_mk.py +++ b/cmk_base/automations/check_mk.py @@ -1179,6 +1179,8 @@ class AutomationDiagHost(Automation): source.set_timeout(tcp_connect_timeout) output += source.run_raw() + if source.exception(): + output += "%s" % source.exception() return 0, output
5 years, 5 months
1
0
0
0
Synched expected package sizes once again.
by Sven Panne
Module: check_mk Branch: master Commit: 113ae51c1d7b83859fdc9a2883f30d7442b50778 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=113ae51c1d7b83…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Apr 12 10:40:17 2019 +0200 Synched expected package sizes once again. Change-Id: Ia77d5e80db535ac1cc969f215163a23788591cd7 --- tests/packaging/test_files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/packaging/test_files.py b/tests/packaging/test_files.py index 584af05..fe8aec1 100644 --- a/tests/packaging/test_files.py +++ b/tests/packaging/test_files.py @@ -26,10 +26,10 @@ def _get_package_paths(version_path, what): # In case packages grow/shrink this check has to be changed. # TODO: Handle Docker tar.gz differently? @pytest.mark.parametrize("what,min_size,max_size", [ - ("rpm", 168 * 1024 * 1024, 203 * 1024 * 1024), + ("rpm", 167 * 1024 * 1024, 202 * 1024 * 1024), ("deb", 132 * 1024 * 1024, 144 * 1024 * 1024), - ("cma", 235 * 1024 * 1024, 245 * 1024 * 1024), - ("tar.gz", 401 * 1024 * 1024, 443 * 1024 * 1024), + ("cma", 242 * 1024 * 1024, 252 * 1024 * 1024), + ("tar.gz", 400 * 1024 * 1024, 443 * 1024 * 1024), ]) def test_package_sizes(version_path, what, min_size, max_size): for pkg in _get_package_paths(version_path, what):
5 years, 5 months
1
0
0
0
Use NagiosCore abstraction for expanding macros.
by Sven Panne
Module: check_mk Branch: master Commit: 205d07ccfc24322a6aafc3f00b46dab7617353fd URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=205d07ccfc2432…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Apr 12 09:43:11 2019 +0200 Use NagiosCore abstraction for expanding macros. Change-Id: Idfaa31f0705bc92c7c13eb0d5746031944c83ed2 --- livestatus/src/OffsetStringMacroColumn.cc | 19 ++++++++------- .../src/test/test_OffsetStringMacroColumn.cc | 27 ++++++++++++++++++---- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/livestatus/src/OffsetStringMacroColumn.cc b/livestatus/src/OffsetStringMacroColumn.cc index 59c36e8..08d276f 100644 --- a/livestatus/src/OffsetStringMacroColumn.cc +++ b/livestatus/src/OffsetStringMacroColumn.cc @@ -27,6 +27,7 @@ #include <type_traits> #include <utility> #include "Column.h" +#include "MonitoringCore.h" #include "RegExp.h" #include "Row.h" #include "StringUtils.h" @@ -65,14 +66,16 @@ CustomVariableExpander::CustomVariableExpander(std::string prefix, std::optional<std::string> CustomVariableExpander::expand( const std::string &str) { - (void)_mc; - if (mk::starts_with(str, _prefix)) { - RegExp regExp(str.substr(_prefix.size()), RegExp::Case::ignore, - RegExp::Syntax::literal); - for (; _cvm != nullptr; _cvm = _cvm->next) { - if (regExp.match(_cvm->variable_name)) { - return from_ptr(_cvm->variable_value); - } + if (!mk::starts_with(str, _prefix)) { + return {}; + } + + RegExp regExp(str.substr(_prefix.size()), RegExp::Case::ignore, + RegExp::Syntax::literal); + for (const auto &[name, value] : + _mc->customAttributes(&_cvm, AttributeKind::custom_variables)) { + if (regExp.match(name)) { + return value; } } return {}; diff --git a/livestatus/src/test/test_OffsetStringMacroColumn.cc b/livestatus/src/test/test_OffsetStringMacroColumn.cc index ca721b3..61100f1 100644 --- a/livestatus/src/test/test_OffsetStringMacroColumn.cc +++ b/livestatus/src/test/test_OffsetStringMacroColumn.cc @@ -3,6 +3,7 @@ #include <iterator> #include <string> #include "Column.h" +#include "NagiosCore.h" #include "OffsetStringHostMacroColumn.h" #include "OffsetStringServiceMacroColumn.h" #include "Row.h" @@ -35,7 +36,7 @@ protected: host_.alias = cc("the alias"); host_.address = cc("the address"); host_.host_check_command = cc("the host check command"); - host_.custom_variables = &hcvm2_; + host_.custom_variables = &hcvm3_; host_.plugin_output = cc("the plugin output"); host_.long_plugin_output = cc("the long plugin output"); host_.perf_data = cc("the perf data"); @@ -59,10 +60,17 @@ protected: .variable_value = cc("Hirsch"), .has_been_modified = 0, .next = &hcvm1_}; + customvariablesmember hcvm3_{.variable_name = cc("_TAG_GUT"), + .variable_value = cc("Guten Tag!"), + .has_been_modified = 0, + .next = &hcvm2_}; + + NagiosCore core_{NagiosPaths{}, NagiosLimits{}, NagiosAuthorization{}, + Encoding::utf8}; host host_{}; Row host_row_{&host_}; OffsetStringHostMacroColumn oshmc_{ - "funny_column_name", "Cool description!", -1, -1, -1, nullptr, + "funny_column_name", "Cool description!", -1, -1, -1, &core_, offsetof(host, notes)}; }; @@ -78,7 +86,7 @@ protected: service_.description = cc("muppet_show"); service_.display_name = cc("The Muppet Show"); service_.service_check_command = cc("check_fozzie_bear"); - service_.custom_variables = &scvm2_; + service_.custom_variables = &scvm3_; service_.plugin_output = cc("plug"); service_.long_plugin_output = cc("long plug"); service_.perf_data = cc("99%"); @@ -99,10 +107,15 @@ protected: .variable_value = cc("Terrible!"), .has_been_modified = 0, .next = &scvm1_}; + customvariablesmember scvm3_{.variable_name = cc("_LABEL_LO"), + .variable_value = cc("Labello"), + .has_been_modified = 0, + .next = &scvm2_}; + service service_{}; Row service_row_{&service_}; OffsetStringServiceMacroColumn ossmc_{ - "navn", "Beskrivelse", -1, -1, -1, nullptr, offsetof(service, notes)}; + "navn", "Beskrivelse", -1, -1, -1, &core_, offsetof(service, notes)}; private: // Nagios and const-correctness: A Tale of Two Worlds... @@ -224,6 +237,9 @@ TEST_F(OffsetStringHostMacroColumnTest, border_cases) { set_host_notes("checking $USER257$..."); EXPECT_EQ("checking $USER257$...", expanded_host_notes()); + + set_host_notes("checking $GUT$..."); + EXPECT_EQ("checking $GUT$...", expanded_host_notes()); } TEST_F(OffsetStringServiceMacroColumnTest, misc) { @@ -341,4 +357,7 @@ TEST_F(OffsetStringServiceMacroColumnTest, border_cases) { set_service_notes("checking $USER257$..."); EXPECT_EQ("checking $USER257$...", expanded_service_notes()); + + set_service_notes("checking $LO$..."); + EXPECT_EQ("checking $LO$...", expanded_service_notes()); }
5 years, 5 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
60
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Results per page:
10
25
50
100
200