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
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
January 2019
----- 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
490 discussions
Start a n
N
ew thread
Unify web API registration.
by Sven Panne
Module: check_mk Branch: master Commit: 6c941564f718c8485337e3d84a98be5a4127971c URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6c941564f718c8…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Mon Jan 14 11:04:55 2019 +0100 Unify web API registration. CMK-1405 Change-Id: Iba00822feb5a06d53f56ea2ec711853501799687 --- cmk/gui/plugins/webapi/__init__.py | 1 - cmk/gui/plugins/webapi/utils.py | 3 - cmk/gui/plugins/webapi/webapi.py | 501 +++++++++++++++++---------------- cmk/gui/webapi.py | 19 +- tests/unit/cmk/gui/test_webapi_unit.py | 5 + 5 files changed, 267 insertions(+), 262 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=6c941564f7…
5 years, 8 months
1
0
0
0
Revert "Update persisted sections with existing (filtered)
by Simon Betz
persisted sections before saving" Message-ID: <5c3c8f07.M/qOiaOnEcSnfHKR%si(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: 1b96d8d035186b5f5146d08b65453fa17af9afad URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1b96d8d035186b…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Jan 14 13:02:10 2019 +0100 Revert "Update persisted sections with existing (filtered) persisted sections before saving" This reverts commit 62673227ec2bdbd5d61eecb5a5e9d431f62b9daf. Change-Id: Ieb5667fdbdee58c5097a9436aebfe53d11669e6a --- cmk_base/data_sources/abstract.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cmk_base/data_sources/abstract.py b/cmk_base/data_sources/abstract.py index 4b8d1e3..56e562d 100644 --- a/cmk_base/data_sources/abstract.py +++ b/cmk_base/data_sources/abstract.py @@ -128,8 +128,13 @@ class DataSource(object): if get_raw_data: return raw_data + if host_sections.persisted_sections and not is_cached_data: + self._store_persisted_sections(host_sections.persisted_sections) + # Add information from previous persisted infos - return self._update_info_with_persisted_sections(host_sections, is_cached_data) + host_sections = self._update_info_with_persisted_sections(host_sections) + + return host_sections except MKTerminate: raise @@ -408,6 +413,7 @@ class DataSource(object): return file_path = self._persisted_sections_file_path() + try: os.makedirs(os.path.dirname(file_path)) except OSError as e: @@ -419,14 +425,8 @@ class DataSource(object): store.save_data_to_file(file_path, persisted_sections, pretty=False) self._logger.debug("Stored persisted sections: %s" % (", ".join(persisted_sections.keys()))) - def _update_info_with_persisted_sections(self, host_sections, is_cached_data): - persisted_sections_from_raw = host_sections.persisted_sections + def _update_info_with_persisted_sections(self, host_sections): persisted_sections = self._load_persisted_sections() - - if persisted_sections_from_raw and not is_cached_data: - persisted_sections.update(persisted_sections_from_raw) - self._store_persisted_sections(persisted_sections) - if not persisted_sections: return host_sections @@ -437,13 +437,13 @@ class DataSource(object): persisted_from, persisted_until, section_info = entry # Don't overwrite sections that have been received from the source with this call - if section_name in host_sections.sections: - self._logger.debug( - "Skipping persisted section %r, live data available" % (section_name)) - else: + if section_name not in host_sections.sections: self._logger.debug("Using persisted section %r" % (section_name)) host_sections.add_cached_section(section_name, section_info, persisted_from, persisted_until) + else: + self._logger.debug("Skipping persisted section %r" % (section_name)) + return host_sections def _load_persisted_sections(self):
5 years, 8 months
1
0
0
0
Speed up unit test discovery a bit.
by Sven Panne
Module: check_mk Branch: master Commit: cf487d812b6d1bcdb2d81fe60d90679af152a1e9 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cf487d812b6d1b…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Mon Jan 14 13:43:52 2019 +0100 Speed up unit test discovery a bit. Change-Id: Ia518003a9faecec6c10130045a1616f35a709ccb --- tests/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index ce75da0..c355b99 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -80,7 +80,8 @@ test-shellcheck: "$$ENTERPRISE_DIR/agents/mk-remote-alert-handler" test-unit: $(VENV) - $(PYTEST) -T unit + $(PYTEST) -T unit git unit test-unit-coverage-html: $(VENV) - $(COVERAGE) run --rcfile=.coveragerc_unit -m pytest -T unit ; $(COVERAGE) html + $(COVERAGE) run --rcfile=.coveragerc_unit -m pytest -T unit git unit + $(COVERAGE) html
5 years, 8 months
1
0
0
0
DCD: Use bulk host delete API call
by Lars Michelsen
Module: check_mk Branch: master Commit: 78d8c2db65b094dc481650468862b387a1fb936e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=78d8c2db65b094…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Dec 26 00:13:43 2018 +0100 DCD: Use bulk host delete API call * Using less API calls reduces the API call overhead and improves execution performance. * Add test for delete_hosts call on the way Change-Id: I3cd06fe5e98fd744862fd8e951d86283d000fe85 --- tests/integration/cmk/gui/test_webapi.py | 18 +++++++++++++++--- tests/testlib/__init__.py | 13 +++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/tests/integration/cmk/gui/test_webapi.py b/tests/integration/cmk/gui/test_webapi.py index f3d3642..c513722 100644 --- a/tests/integration/cmk/gui/test_webapi.py +++ b/tests/integration/cmk/gui/test_webapi.py @@ -82,6 +82,20 @@ def test_delete_host(web): web.delete_host("test-host-delete") +def test_delete_hosts(web): + try: + web.add_host( + "test-hosts-delete1", attributes={ + "ipaddress": "127.0.0.1", + }) + web.add_host( + "test-hosts-delete2", attributes={ + "ipaddress": "127.0.0.1", + }) + finally: + web.delete_hosts(["test-hosts-delete1", "test-hosts-delete2"]) + + def test_get_host_effective_attributes(web): try: web.add_host( @@ -246,9 +260,7 @@ def test_write_host_tags(web, site): assert "lan" in tags_by_host["test-host-lan2"] finally: - web.delete_host("test-host-lan2") - web.delete_host("test-host-lan") - web.delete_host("test-host-dmz") + web.delete_hosts(["test-host-lan2", "test-host-lan", "test-host-dmz"]) # TODO: Parameterize test for cme / non cme diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index 7b9c490..743772b 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -1405,6 +1405,19 @@ class CMKWebSession(WebSession): hosts = self.get_all_hosts() assert hostname not in hosts + def delete_hosts(self, hostnames): + result = self._api_request("webapi.py?action=delete_hosts", { + "request": json.dumps({ + "hostnames": hostnames, + }), + }) + + assert result is None + + hosts = self.get_all_hosts() + for hostname in hostnames: + assert hostname not in hosts + def get_all_groups(self, group_type): result = self._api_request("webapi.py?action=get_all_%sgroups" % group_type, {}) return result
5 years, 8 months
1
0
0
0
New host bulk API calls
by Lars Michelsen
Module: check_mk Branch: master Commit: f113b9dc2c1d971879aa30d28b0cdd337a47306e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f113b9dc2c1d97…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Dec 26 20:34:26 2018 +0100 New host bulk API calls Added a new API call "add_hosts" which does the same work as the "add_host" calls with the difference that it may create multiple hosts. The request must contain a single key "hosts" which must be a list containing the single host specifications equal to the add_host call. Change-Id: I4314b54c7c9868d5ed02fb8b566310a3c0160e04 --- cmk/gui/plugins/webapi/webapi.py | 9 +++++++++ tests/integration/cmk/gui/test_webapi.py | 10 ++++++++++ tests/testlib/__init__.py | 20 ++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/cmk/gui/plugins/webapi/webapi.py b/cmk/gui/plugins/webapi/webapi.py index 27c90b7..9e9daff 100644 --- a/cmk/gui/plugins/webapi/webapi.py +++ b/cmk/gui/plugins/webapi/webapi.py @@ -216,6 +216,10 @@ class APICallHosts(APICallCollection): "handler": self._add, "locking": True, }, + "add_hosts": { + "handler": self._add_hosts, + "locking": True, + }, "edit_host": { "handler": self._edit, "locking": True, @@ -282,6 +286,11 @@ class APICallHosts(APICallCollection): cluster_nodes = map(str, cluster_nodes) watolib.Folder.folder(folder_path).create_hosts([(hostname, attributes, cluster_nodes)]) + def _add_hosts(self, request): + validate_request_keys(request, required_keys=["hosts"]) + for host_request in request["hosts"]: + self._add(host_request) + def _edit(self, request): validate_request_keys( request, diff --git a/tests/integration/cmk/gui/test_webapi.py b/tests/integration/cmk/gui/test_webapi.py index c513722..298a3fd 100644 --- a/tests/integration/cmk/gui/test_webapi.py +++ b/tests/integration/cmk/gui/test_webapi.py @@ -59,6 +59,16 @@ def test_add_host_no_folder_create(web): assert "Unable to create parent folder" in exc_msg +def test_add_hosts(web): + hosts = ["test-hosts1", "test-hosts2"] + try: + web.add_hosts([(hostname, "", { + "ipaddress": "127.0.0.1", + }) for hostname in hosts]) + finally: + web.delete_hosts(hosts) + + def test_get_all_hosts_basic(web): try: web.add_host( diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index 743772b..14f00e0 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -1263,6 +1263,26 @@ class CMKWebSession(WebSession): assert host["path"] == folder assert host["attributes"] == attributes + # hosts: List of tuples of this structure: (hostname, folder_path, attributes) + def add_hosts(self, create_hosts): + hosts = [{ + "hostname": hostname, + "folder": folder, + "attributes": attributes, + "create_folders": True, + } for hostname, folder, attributes in create_hosts] + + result = self._api_request("webapi.py?action=add_hosts", { + "request": json.dumps({ + "hosts": hosts, + }), + }) + + assert result is None + hosts = self.get_all_hosts() + for hostname, _folder, _attributes in create_hosts: + assert hostname in hosts + def get_host(self, hostname, effective_attributes=False): result = self._api_request( "webapi.py?action=get_host", {
5 years, 8 months
1
0
0
0
New API call edit_hosts
by Lars Michelsen
Module: check_mk Branch: master Commit: fb61174f85477d500caf9a3cf5bc4649129526c5 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fb61174f85477d…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Dec 26 21:14:35 2018 +0100 New API call edit_hosts Added a new API call "edit_hosts" which does the same work as the "edit_host" calls with the difference that it may create multiple hosts. The request must contain a single key "hosts" which must be a list containing the single host specifications equal to the edit_host call. Added tests for the "edit_host" call on the way. Change-Id: If80aeb83865be64ff94748b3ddf94a1be67f9ed1 --- cmk/gui/plugins/webapi/webapi.py | 9 ++++++ tests/integration/cmk/gui/test_webapi.py | 35 +++++++++++++++++++++++ tests/testlib/__init__.py | 49 ++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/cmk/gui/plugins/webapi/webapi.py b/cmk/gui/plugins/webapi/webapi.py index 9e9daff..a935934 100644 --- a/cmk/gui/plugins/webapi/webapi.py +++ b/cmk/gui/plugins/webapi/webapi.py @@ -224,6 +224,10 @@ class APICallHosts(APICallCollection): "handler": self._edit, "locking": True, }, + "edit_hosts": { + "handler": self._edit_hosts, + "locking": True, + }, "get_host": { "handler": self._get, "locking": False, @@ -328,6 +332,11 @@ class APICallHosts(APICallCollection): host.edit(current_attributes, cluster_nodes) + def _edit_hosts(self, request): + validate_request_keys(request, required_keys=["hosts"]) + for host_request in request["hosts"]: + self._edit(host_request) + def _get(self, request): validate_request_keys( request, required_keys=["hostname"], optional_keys=["effective_attributes"]) diff --git a/tests/integration/cmk/gui/test_webapi.py b/tests/integration/cmk/gui/test_webapi.py index 298a3fd..3940a7f 100644 --- a/tests/integration/cmk/gui/test_webapi.py +++ b/tests/integration/cmk/gui/test_webapi.py @@ -69,6 +69,41 @@ def test_add_hosts(web): web.delete_hosts(hosts) +def test_edit_host(web): + try: + web.add_host( + "test-edit-host", attributes={ + "ipaddress": "127.0.0.1", + }) + + web.edit_host("test-edit-host", attributes={"ipaddress": "127.10.0.1"}) + finally: + web.delete_host("test-edit-host") + + +def test_edit_hosts(web): + try: + web.add_host( + "test-edit-hosts1", attributes={ + "ipaddress": "127.0.0.1", + }) + web.add_host( + "test-edit-hosts2", attributes={ + "ipaddress": "127.0.0.1", + }) + + web.edit_hosts([ + ("test-edit-hosts1", { + "ipaddress": "127.10.0.1" + }, []), + ("test-edit-hosts2", { + "ipaddress": "127.20.0.1" + }, []), + ]) + finally: + web.delete_hosts(["test-edit-hosts1", "test-edit-hosts2"]) + + def test_get_all_hosts_basic(web): try: web.add_host( diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index 14f00e0..4afd1e4 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -1283,6 +1283,55 @@ class CMKWebSession(WebSession): for hostname, _folder, _attributes in create_hosts: assert hostname in hosts + def edit_host(self, hostname, attributes=None, unset_attributes=None, cluster_nodes=None): + if attributes is None: + attributes = {} + + if unset_attributes is None: + unset_attributes = [] + + result = self._api_request( + "webapi.py?action=edit_host", { + "request": json.dumps({ + "hostname": hostname, + "unset_attributes": unset_attributes, + "attributes": attributes, + "nodes": cluster_nodes, + }), + }) + + assert result is None + + host = self.get_host(hostname) + + assert host["hostname"] == hostname + assert host["attributes"] == attributes + + def edit_hosts(self, edit_hosts): + hosts = [{ + "hostname": hostname, + "attributes": attributes, + "unset_attributes": unset_attributes, + } for hostname, attributes, unset_attributes in edit_hosts] + + result = self._api_request("webapi.py?action=edit_hosts", { + "request": json.dumps({ + "hosts": hosts, + }), + }) + + assert result is None + + hosts = self.get_all_hosts() + for hostname, attributes, unset_attributes in edit_hosts: + host = hosts[hostname] + + for k, v in attributes.items(): + assert host["attributes"][k] == v + + for unset in unset_attributes: + assert unset not in host["attributes"] + def get_host(self, hostname, effective_attributes=False): result = self._api_request( "webapi.py?action=get_host", {
5 years, 8 months
1
0
0
0
aws_costs_and_usage: Also display time period
by Simon Betz
Module: check_mk Branch: master Commit: e55ad44f1a0c0fa9985af881ba28c2e3311db297 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e55ad44f1a0c0f…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Jan 14 12:56:08 2019 +0100 aws_costs_and_usage: Also display time period Change-Id: Ie40156c75a9f88bce4f61cd24c802894c40de1ab --- agents/special/agent_aws | 4 +++- checkman/aws_costs_and_usage | 3 ++- checkman/aws_costs_and_usage.per_service | 2 +- checks/aws_costs_and_usage | 30 ++++++++++++++++++++---------- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/agents/special/agent_aws b/agents/special/agent_aws index aac51c2..80b38bc 100755 --- a/agents/special/agent_aws +++ b/agents/special/agent_aws @@ -219,7 +219,7 @@ class CostsAndUsage(AWSSection): now = time.time() return self._client.get_cost_and_usage( TimePeriod={ - 'Start': time.strftime(fmt, time.gmtime(now - self.period)), + 'Start': time.strftime(fmt, time.gmtime(now - self.interval)), 'End': time.strftime(fmt, time.gmtime(now)), }, Granularity='DAILY', @@ -840,6 +840,8 @@ class Glacier(AWSSection): # | | # '----------------------------------------------------------------------' +# AWS eigener Monitoring service + class CloudTrail(AWSSection): @property diff --git a/checkman/aws_costs_and_usage b/checkman/aws_costs_and_usage index b901ebb..d65d6b6 100644 --- a/checkman/aws_costs_and_usage +++ b/checkman/aws_costs_and_usage @@ -4,7 +4,8 @@ catalog: cloud/aws license: GPL distribution: check_mk description: - This check gives an overview over the unblended costs of AWS accounts. + This check gives an overview over the unblended costs of AWS accounts and + shows the costs of the last day. To make this check work you have to configure the related special agent {{Amazon Web Services (AWS)}}. Upper levels are configurable; no default levels are set. diff --git a/checkman/aws_costs_and_usage.per_service b/checkman/aws_costs_and_usage.per_service index ea46861..450125a 100644 --- a/checkman/aws_costs_and_usage.per_service +++ b/checkman/aws_costs_and_usage.per_service @@ -5,7 +5,7 @@ license: GPL distribution: check_mk description: This check gives an overview over the unblended costs of each service - configured in AWS accounts. + configured in AWS accounts and shows the costs of the last day. To make this check work you have to configure the related special agent {{Amazon Web Services (AWS)}}. Upper levels are configurable; no default levels are set. diff --git a/checks/aws_costs_and_usage b/checks/aws_costs_and_usage index eb872c2..f59af24 100644 --- a/checks/aws_costs_and_usage +++ b/checks/aws_costs_and_usage @@ -32,7 +32,9 @@ AWSCostAndUageMetrics = [ def parse_aws_costs_and_usage(info): parsed = {} for row in parse_aws(info): + timeperiod = row['TimePeriod']['Start'] for group in row.get('Groups', []): + service_name = " ".join(group['Keys']) for metric_name, metrics in group['Metrics'].iteritems(): try: costs = float(metrics['Amount']) @@ -40,7 +42,7 @@ def parse_aws_costs_and_usage(info): except (KeyError, ValueError): continue else: - parsed.setdefault(" ".join(group['Keys']), {})\ + parsed.setdefault((timeperiod, service_name), {})\ .setdefault(metric_name, (costs, unit)) return parsed @@ -64,17 +66,17 @@ def inventory_aws_costs_and_usage_summary(parsed): def check_aws_costs_and_usage_summary(item, params, parsed): amounts_by_metrics = collections.defaultdict(float) - for metrics in parsed.itervalues(): + for (timeperiod, _service_name), metrics in parsed.iteritems(): for title, metric_name, key, in AWSCostAndUageMetrics: costs, unit = metrics[metric_name] - amounts_by_metrics[(title, unit, key)] += costs + amounts_by_metrics[(timeperiod, title, unit, key)] += costs - for (title, unit, key), costs in amounts_by_metrics.iteritems(): + for (timeperiod, title, unit, key), costs in amounts_by_metrics.iteritems(): yield check_levels( costs, "aws_costs_%s" % key, params.get('levels_%s' % key, (None, None)), - infoname="Total %s %s" % (title, unit)) + infoname="(%s) Total %s %s" % (timeperiod, title, unit)) check_info['aws_costs_and_usage'] = { @@ -99,19 +101,27 @@ check_info['aws_costs_and_usage'] = { def inventory_aws_costs_and_usage_per_service(parsed): - for service_name in parsed.iterkeys(): + for (_timeperiod, service_name) in parsed.iterkeys(): yield service_name, {} -@get_parsed_item_data -def check_aws_costs_and_usage_per_service(item, params, metrics): +def check_aws_costs_and_usage_per_service(item, params, parsed): + data = None + timeperiod = None + for (timeperiod, service_name), metrics in parsed.iteritems(): + if item == service_name: + data = metrics + break + if not data: + return + for title, metric_name, key in AWSCostAndUageMetrics: - costs, unit = metrics[metric_name] + costs, unit = data[metric_name] yield check_levels( costs, "aws_costs_%s" % key, params.get('levels_%s' % key, (None, None)), - infoname="%s %s" % (title, unit)) + infoname="(%s) %s %s" % (timeperiod, title, unit)) check_info['aws_costs_and_usage.per_service'] = {
5 years, 8 months
1
0
0
0
6656 FIX Bug predictive levels Diskstat, read-write wait
by Óscar Nájera
Module: check_mk Branch: master Commit: fd15d2ad668f82ff5f018b8a35d25d4505d60e59 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd15d2ad668f82…
Author: Óscar Nájera <on(a)mathias-kettner.de> Date: Fri Jan 11 12:55:55 2019 +0100 6656 FIX Bug predictive levels Diskstat, read-write wait Predictive levels on diskstat check could not reach the read-wait, nor write-wait perf data. Change-Id: I4f65a020b5bebed814e9484f725d2814df210ac4 --- .werks/6656 | 12 ++++++++++++ checks/diskstat.include | 8 ++++++-- tests/unit/checks/test_diskstat.py | 16 ++++++++-------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.werks/6656 b/.werks/6656 new file mode 100644 index 0000000..b8e8f65 --- /dev/null +++ b/.werks/6656 @@ -0,0 +1,12 @@ +Title: Bug predictive levels Diskstat, read-write wait +Level: 1 +Component: checks +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.6.0i1 +Date: 1547207314 + +Predictive levels on diskstat check could not reach the read-wait, nor write-wait perf data. + diff --git a/checks/diskstat.include b/checks/diskstat.include index bfcd82d..8abb2de 100644 --- a/checks/diskstat.include +++ b/checks/diskstat.include @@ -457,7 +457,7 @@ def check_diskstat_dict(item, params, disks): wait = disk.pop("average_" + what) yield check_levels( wait, - what, + "disk_average_" + what, params.get(what), unit="ms", scale=0.001, @@ -485,7 +485,11 @@ def check_diskstat_dict(item, params, disks): if what in disk: ql = disk.pop(what) yield check_levels( - ql, what, params.get(what), statemarkers=False, infoname="Average %s" % plugin_text) + ql, + "disk_" + what, + params.get(what), + statemarkers=False, + infoname="Average %s" % plugin_text) # I/O operations for what in "read", "write": diff --git a/tests/unit/checks/test_diskstat.py b/tests/unit/checks/test_diskstat.py index 299263d..ea798af 100644 --- a/tests/unit/checks/test_diskstat.py +++ b/tests/unit/checks/test_diskstat.py @@ -35,11 +35,11 @@ pytestmark = pytest.mark.checks }, [(0, 'Utilization: 0.00%', [('disk_utilization', 0.0)]), (0, 'Read: 0.00 B/s', [('disk_read_throughput', 0.0)]), (0, 'Write: 0.00 B/s', [('disk_write_throughput', 0.0)]), - (0, 'Average Wait: 0.00 ms', [('wait', 0.0)]), - (0, 'Average Read Wait: 0.00 ms', [('read_wait', 0.0)]), - (0, 'Average Write Wait: 0.00 ms', [('write_wait', 0.0)]), + (0, 'Average Wait: 0.00 ms', [('disk_average_wait', 0.0)]), + (0, 'Average Read Wait: 0.00 ms', [('disk_average_read_wait', 0.0)]), + (0, 'Average Write Wait: 0.00 ms', [('disk_average_write_wait', 0.0)]), (0, 'Latency: 0.00 ms', [('disk_latency', 0.0)]), - (0, 'Average Queue Length: 0.00', [('queue_length', 0.0)]), + (0, 'Average Queue Length: 0.00', [('disk_queue_length', 0.0)]), (1, 'Read operations: 201.00 1/s (warn/crit at 200.00 1/s/300.00 1/s)', [('disk_read_ios', 201.0, 200.0, 300.0)]), (1, 'Write operations: 401.00 1/s (warn/crit at 400.00 1/s/500.00 1/s)', @@ -75,11 +75,11 @@ pytestmark = pytest.mark.checks }, [(0, 'Utilization: 0.00%', [('disk_utilization', 0.0)]), (0, 'Read: 0.00 B/s', [('disk_read_throughput', 0.0)]), (0, 'Write: 0.00 B/s', [('disk_write_throughput', 0.0)]), - (0, 'Average Wait: 0.00 ms', [('wait', 0.0)]), - (0, 'Average Read Wait: 0.00 ms', [('read_wait', 0.0)]), - (0, 'Average Write Wait: 0.00 ms', [('write_wait', 0.0)]), + (0, 'Average Wait: 0.00 ms', [('disk_average_wait', 0.0)]), + (0, 'Average Read Wait: 0.00 ms', [('disk_average_read_wait', 0.0)]), + (0, 'Average Write Wait: 0.00 ms', [('disk_average_write_wait', 0.0)]), (0, 'Latency: 0.00 ms', [('disk_latency', 0.0)]), - (0, 'Average Queue Length: 0.00', [('queue_length', 0.0)]), + (0, 'Average Queue Length: 0.00', [('disk_queue_length', 0.0)]), (2, 'Read operations: 301.00 1/s (warn/crit at 200.00 1/s/300.00 1/s)', [('disk_read_ios', 301.0, 200.0, 300.0)]), (2, 'Write operations: 501.00 1/s (warn/crit at 400.00 1/s/500.00 1/s)',
5 years, 8 months
1
0
0
0
7052 FIX fileinfo.groups: fix display bug in service discovery
by Tom Baerwinkel
Module: check_mk Branch: master Commit: cb0dd62d10bcbfa6fcf29b09a145b3c1986dbc50 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cb0dd62d10bcbf…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de> Date: Mon Jan 14 11:47:46 2019 +0100 7052 FIX fileinfo.groups: fix display bug in service discovery The service discovery for fileinfo.groups showed an error starting with "Invalid check parameter: Undefined key 'group_patterns'". This commit resolves this issue. Change-Id: I29486246f4ead3c8b0047953201e7c5437e82b53 --- .werks/7052 | 13 +++++++++++++ cmk/gui/plugins/wato/check_parameters/unsorted.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.werks/7052 b/.werks/7052 new file mode 100644 index 0000000..f1bfe5f --- /dev/null +++ b/.werks/7052 @@ -0,0 +1,13 @@ +Title: fileinfo.groups: fix display bug in service discovery +Level: 1 +Component: checks +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.6.0i1 +Date: 1547459719 + +The service discovery for fileinfo.groups showed an error starting with +"Invalid check parameter: Undefined key 'group_patterns'". This commit +resolves this issue. diff --git a/cmk/gui/plugins/wato/check_parameters/unsorted.py b/cmk/gui/plugins/wato/check_parameters/unsorted.py index 389467b..c024a20 100644 --- a/cmk/gui/plugins/wato/check_parameters/unsorted.py +++ b/cmk/gui/plugins/wato/check_parameters/unsorted.py @@ -1880,7 +1880,7 @@ register_check_parameters( "a conjunction are reached then the related state is reported."), )), ], - ignored_keys=["precompiled_patterns"]), + ignored_keys=["precompiled_patterns", "group_patterns"]), TextAscii( title=_("File Group Name"), help=_(
5 years, 8 months
1
0
0
0
agent_aws: Fixed interval of costs and usage section
by Simon Betz
Module: check_mk Branch: master Commit: 7b89bd7a2624a08c5028291891ecdd349af91053 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b89bd7a2624a0…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Jan 14 10:14:10 2019 +0100 agent_aws: Fixed interval of costs and usage section Change-Id: Id6badb75fc21d75166dc56f6f8e6b8d33c549f33 --- agents/special/agent_aws | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/special/agent_aws b/agents/special/agent_aws index b5eb18d..aac51c2 100755 --- a/agents/special/agent_aws +++ b/agents/special/agent_aws @@ -219,8 +219,8 @@ class CostsAndUsage(AWSSection): now = time.time() return self._client.get_cost_and_usage( TimePeriod={ - 'Start': time.strftime(fmt, time.gmtime(now)), - 'End': time.strftime(fmt, time.gmtime(now + self.period)), + 'Start': time.strftime(fmt, time.gmtime(now - self.period)), + 'End': time.strftime(fmt, time.gmtime(now)), }, Granularity='DAILY', Metrics=['UnblendedCost'],
5 years, 8 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
49
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
Results per page:
10
25
50
100
200