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
February 2017
----- 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
10 participants
452 discussions
Start a n
N
ew thread
feature: table.open() context.
by Roland Halbig
Module: check_mk Branch: master Commit: a7a23cefea4723091f26fb3f3c44057bfcd660c8 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a7a23cefea4723…
Author: Roland Halbig <rh(a)mathias-kettner.de> Date: Tue Feb 7 14:26:33 2017 +0100 feature: table.open() context. Change-Id: I3d7fb0d3de3dcf411b44240a7c374a5501e9e851 --- tests/web/test_table.py | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ web/htdocs/table.py | 10 +++++++++ 2 files changed, 65 insertions(+) diff --git a/tests/web/test_table.py b/tests/web/test_table.py index 16c3492..25d5308 100644 --- a/tests/web/test_table.py +++ b/tests/web/test_table.py @@ -138,3 +138,58 @@ def table_test_cubical(sortable, searchable, limit, output_format, tmpdir): assert len(data) == limit assert data == rows[:limit] + + + + + +def test_context(): + import table + + html = TableTest() + __builtin__.html = html + + table_id = 0 + rows = [ (i, i**3) for i in range(10) ] + header = ["Number", "Cubical"] + + with table.open(table_id=table_id, searchable=False, sortable=False): + for row in rows: + table.row() + for i in range(len(header)): + table.cell(_(header[i]), row[i]) + + text = html.written_text + data = read_out_table(text) + assert data.pop(0) == header + data = [ tuple(map(int, row)) for row in data if row and row[0]] + assert data == rows + + +#def test_nested_context(): +# import table +# +# html = TableTest() +# __builtin__.html = html +# +# table_id = 0 +# rows = [ (i, i**3) for i in range(2) ] +# header = ["Number", "Cubical"] +# +# with table.open(table_id=table_id, searchable=False, sortable=False): +# for row in rows: +# table.row() +# for i in range(len(header)): +# table.cell(_(header[i]), row[i]) +# with table.open(table_id=table_id, searchable=False, sortable=False): +# for row in rows: +# table.row() +# for i in range(len(header)): +# table.cell(_(header[i]), row[i]) +# +# text = html.written_text +# print "\n" + text +# data = read_out_table(text) +# assert data.pop(0) == header +# data = [ tuple(map(int, row)) for row in data if row and row[0]] +# assert data == rows diff --git a/web/htdocs/table.py b/web/htdocs/table.py index e2851ba..bc4fe9f 100644 --- a/web/htdocs/table.py +++ b/web/htdocs/table.py @@ -26,6 +26,16 @@ import config from lib import num_split +# TODO: Is contextlib part of older versions of python? +# external imports +from contextlib import contextmanager +@contextmanager +def open(**kwargs): + begin(**kwargs) + yield + end() + + table = None mode = None next_func = None
7 years, 7 months
1
0
0
0
Fixed recently broke integration tests
by Lars Michelsen
Module: check_mk Branch: master Commit: caadea5d5a025fa7a30da551bacc6c0b290a6cf7 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=caadea5d5a025f…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Feb 13 14:52:17 2017 +0100 Fixed recently broke integration tests Change-Id: I5609f4e59c9247fb6a7995ddd8c7919a0238c5d8 --- tests/testlib/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index a70c18e..4d90736 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -458,11 +458,11 @@ class Site(object): # Check_MK is now the site, so all tests that somehow rely on the environment should be # executed this way. def switch_to_site_user(self): - env_vars = [] + env_var_str = "" if "WORKSPACE" in os.environ: - env_vars.append("WORKSPACE=\"%s\"" % os.environ["WORKSPACE"]) + env_var_str = "WORKSPACE='%s' " % os.environ["WORKSPACE"] - cmd = subprocess.list2cmdline(env_vars + sys.argv + [ cmk_path() + "/tests" ]) + cmd = env_var_str + subprocess.list2cmdline(sys.argv + [ cmk_path() + "/tests" ]) args = [ "/usr/bin/sudo", "--", "/bin/su", "-l", self.id, "-c", cmd ] return subprocess.call(args)
7 years, 7 months
1
0
0
0
Test generation tool.
by Roland Halbig
Module: check_mk Branch: master Commit: 951863fd388f9c4a3c570add2bf1a195e293be38 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=951863fd388f9c…
Author: Roland Halbig <rh(a)mathias-kettner.de> Date: Thu Feb 9 09:55:52 2017 +0100 Test generation tool. Added new unittests. Change-Id: I0cb546a89f4f2967d0177dde4667d82b48c6f6a0 --- tests/web/generate_integration.py | 7 +- tests/web/html_tests.py | 134 +- tests/web/test_integration.py | 5 +- tests/web/unittest_files/body_start.unittest | 15 +- tests/web/unittest_files/button.unittest | 56 + tests/web/unittest_files/buttonlink.unittest | 336 +++ .../unittest_files/context_button_test.unittest | 1344 ++++-------- .../unittest_files/default_html_headers.unittest | 6 +- tests/web/unittest_files/empty_icon.unittest | 6 +- tests/web/unittest_files/header.unittest | 22 +- tests/web/unittest_files/help.unittest | 26 + tests/web/unittest_files/hidden_field.unittest | 50 + tests/web/unittest_files/html_foot.unittest | 6 +- tests/web/unittest_files/html_head.unittest | 24 +- tests/web/unittest_files/icon.unittest | 8 +- tests/web/unittest_files/icon_button.unittest | 8 +- tests/web/unittest_files/icon_select.unittest | 48 +- tests/web/unittest_files/javascript.unittest | 8 +- tests/web/unittest_files/javascript_file.unittest | 8 +- tests/web/unittest_files/play_sound.unittest | 8 +- tests/web/unittest_files/popup_trigger.unittest | 384 +--- tests/web/unittest_files/radiobuttons.unittest | 96 +- tests/web/unittest_files/render_icon.unittest | 7 +- .../web/unittest_files/render_icon_button.unittest | 7 +- tests/web/unittest_files/select.unittest | 72 +- tests/web/unittest_files/stylesheet.unittest | 8 +- tests/web/unittest_files/text_area.unittest | 56 +- tests/web/unittest_files/text_input.unittest | 2160 ++++++-------------- tests/web/unittest_files/top_heading.unittest | 8 +- tests/web/unittest_files/top_heading_left.unittest | 8 +- .../web/unittest_files/top_heading_right.unittest | 6 +- 31 files changed, 1853 insertions(+), 3084 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=951863fd38…
7 years, 7 months
1
0
0
0
Fixed path quoting in test
by Lars Michelsen
Module: check_mk Branch: master Commit: cd50336397f09797b203c6163960455eb43c7829 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cd50336397f097…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Feb 13 14:31:45 2017 +0100 Fixed path quoting in test Change-Id: I350ee0d227807b78828fb116abcc68ebef830b87 --- tests/testlib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index 493adb5..a70c18e 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -460,7 +460,7 @@ class Site(object): def switch_to_site_user(self): env_vars = [] if "WORKSPACE" in os.environ: - env_vars.append("WORKSPACE=%s" % os.environ["WORKSPACE"]) + env_vars.append("WORKSPACE=\"%s\"" % os.environ["WORKSPACE"]) cmd = subprocess.list2cmdline(env_vars + sys.argv + [ cmk_path() + "/tests" ]) args = [ "/usr/bin/sudo", "--", "/bin/su", "-l", self.id, "-c", cmd ]
7 years, 7 months
1
0
0
0
Fixed .f12 in werks directory
by Lars Michelsen
Module: check_mk Branch: master Commit: 0955265f64fc4b6f85c1ea46f2a29a24c2642496 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0955265f64fc4b…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Feb 13 14:16:13 2017 +0100 Fixed .f12 in werks directory Change-Id: I5f4978b3ecdfd10f3ef3e72cfa0d737ff703470b --- .werks/.f12 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.werks/.f12 b/.werks/.f12 index e317cfd..1fc7145 100644 --- a/.werks/.f12 +++ b/.werks/.f12 @@ -2,6 +2,6 @@ SITE=${SITE:-$(cat ../.site)} SITE=${SITE:-$(omd sites --bare | head -n 1)} sudo mkdir -p /omd/sites/$SITE/share/check_mk/werks/ -make -C .. precompile-werks +make -C .. .werks/werks sudo install -m 644 -g $SITE -o $SITE werks /omd/sites/$SITE/share/check_mk/werks/werks sudo omd restart $SITE apache
7 years, 7 months
1
0
0
0
Fixed duplicate key in dict
by Lars Michelsen
Module: check_mk Branch: master Commit: f1a253c39c2fb4bdae529143acc70f2abe521e72 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f1a253c39c2fb4…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Feb 13 13:56:13 2017 +0100 Fixed duplicate key in dict Change-Id: I1d50b68c3285bf1c5aea417f8fb348603dd51f2b --- web/htdocs/werks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/htdocs/werks.py b/web/htdocs/werks.py index 8e5953f..fbc09a0 100644 --- a/web/htdocs/werks.py +++ b/web/htdocs/werks.py @@ -80,7 +80,7 @@ def werk_components(): "cmc" : _("The Check_MK Micro Core"), "setup" : _("Setup, Site Management"), "config" : _("Configuration generation"), - "inline-snmp" : _("Inline-SNMP"), + "inline-snmp" : _("Inline SNMP"), "agents" : _("Agent Bakery"), "metrics" : _("Metrics System"), @@ -89,7 +89,6 @@ def werk_components(): "rpm": _("RPM Packaging"), "deb": _("DEB Packaging"), "nagvis": _("NagVis"), - "inline-snmp": _("Inline-SNMP"), "packages": _("Other Components"), "distros": _("Linux Distributions"), }
7 years, 7 months
1
0
0
0
Added werk components of cmk-omd to werk list
by Lars Michelsen
Module: check_mk Branch: master Commit: 9f9004709bd7adce498793e72bb1dcc84d9c8bae URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f9004709bd7ad…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Feb 10 16:45:16 2017 +0100 Added werk components of cmk-omd to werk list Change-Id: Iad3f666334cb6a886563121fef11ac592ebe240a --- web/htdocs/werks.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/htdocs/werks.py b/web/htdocs/werks.py index 6ad4b80..8e5953f 100644 --- a/web/htdocs/werks.py +++ b/web/htdocs/werks.py @@ -83,6 +83,15 @@ def werk_components(): "inline-snmp" : _("Inline-SNMP"), "agents" : _("Agent Bakery"), "metrics" : _("Metrics System"), + + # CMK-OMD + "omd": _("Site Management"), + "rpm": _("RPM Packaging"), + "deb": _("DEB Packaging"), + "nagvis": _("NagVis"), + "inline-snmp": _("Inline-SNMP"), + "packages": _("Other Components"), + "distros": _("Linux Distributions"), }
7 years, 7 months
1
0
0
0
GUI crawl: Hand over WORKSPACE path for storing the results
by Lars Michelsen
Module: check_mk Branch: master Commit: 562df33c7a36c68a3638c6575200c8c93d68a172 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=562df33c7a36c6…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Feb 10 16:42:35 2017 +0100 GUI crawl: Hand over WORKSPACE path for storing the results Change-Id: Ic4573b440deb7e1b8ca5290900fc92d0e810a1aa --- tests/testlib/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index 9edf9c7..493adb5 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -458,7 +458,11 @@ class Site(object): # Check_MK is now the site, so all tests that somehow rely on the environment should be # executed this way. def switch_to_site_user(self): - cmd = subprocess.list2cmdline(sys.argv + [ cmk_path() + "/tests" ]) + env_vars = [] + if "WORKSPACE" in os.environ: + env_vars.append("WORKSPACE=%s" % os.environ["WORKSPACE"]) + + cmd = subprocess.list2cmdline(env_vars + sys.argv + [ cmk_path() + "/tests" ]) args = [ "/usr/bin/sudo", "--", "/bin/su", "-l", self.id, "-c", cmd ] return subprocess.call(args)
7 years, 7 months
1
0
0
0
introduced a few more automated web api tests
by Andreas Boesl
Module: check_mk Branch: master Commit: 0425dc92a33e12a2e2272cc8c85778ef1d7a84b4 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0425dc92a33e12…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Fri Feb 10 17:13:48 2017 +0100 introduced a few more automated web api tests Change-Id: Ied0155e7e1d4e9df8c1c03d3f8bc4cb503c3e8f0 --- tests/testlib/__init__.py | 69 ++++++++++++++++++++++++++++ tests/web/test_webapi.py | 115 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index 918366c..9edf9c7 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -851,6 +851,75 @@ class CMKWebSession(WebSession): 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 + + + def add_group(self, group_type, group_name, attributes, expect_error = False): + request_object = { + "groupname" : group_name + } + request_object.update(attributes) + + result = self._api_request("webapi.py?action=add_%sgroup" % group_type, { + "request": json.dumps(request_object)}, expect_error = expect_error + ) + + assert result == None + + + def edit_group(self, group_type, group_name, attributes, expect_error = False): + request_object = { + "groupname" : group_name + } + request_object.update(attributes) + + result = self._api_request("webapi.py?action=edit_%sgroup" % group_type, { + "request": json.dumps(request_object)}, expect_error = expect_error + ) + + assert result == None + + + def delete_group(self, group_type, group_name, expect_error = False): + result = self._api_request("webapi.py?action=delete_%sgroup" % group_type, { + "request": json.dumps({ + "groupname" : group_name, + })}, expect_error = expect_error + ) + + assert result == None + + + def get_all_users(self): + return self._api_request("webapi.py?action=get_all_users", {}) + + + def add_htpasswd_users(self, users): + result = self._api_request("webapi.py?action=add_users", { + "request": json.dumps({"users": users}) + }) + assert result == None + + + def edit_htpasswd_users(self, users): + result = self._api_request("webapi.py?action=edit_users", { + "request": json.dumps({"users": users}) + }) + + assert result == None + + + def delete_htpasswd_users(self, userlist): + result = self._api_request("webapi.py?action=delete_users", { + "request": json.dumps({ + "users" : userlist + }), + }) + assert result == None + + def discover_services(self, hostname, mode=None): request = { "hostname" : hostname, diff --git a/tests/web/test_webapi.py b/tests/web/test_webapi.py index ad8efe8..06f5d6f 100644 --- a/tests/web/test_webapi.py +++ b/tests/web/test_webapi.py @@ -3,6 +3,7 @@ import pytest import time +import os from testlib import web, APIError @@ -42,6 +43,120 @@ def test_delete_host(web): web.delete_host("test-host-delete") +(a)pytest.mark.parametrize(("group_type"), [ "contact", "host", "service" ]) +def test_add_group(web, group_type): + group_id = "%s_testgroup_id" % group_type + group_alias = "%s_testgroup_alias" % group_type + try: + web.add_group(group_type, group_id, {"alias": group_alias}) + all_groups = web.get_all_groups(group_type) + + assert group_id in all_groups + assert group_alias == all_groups[group_id]["alias"] + finally: + web.delete_group(group_type, group_id) + + +(a)pytest.mark.parametrize(("group_type"), [ "contact", "host", "service" ]) +def test_edit_group(web, group_type): + group_id = "%s_testgroup_id" % group_type + group_alias = "%s_testgroup_alias" % group_type + group_alias2 = "%s_testgroup_otheralias" % group_type + try: + web.add_group(group_type, group_id, {"alias": group_alias}) + web.edit_group(group_type, group_id, {"alias": group_alias2}) + + all_groups = web.get_all_groups(group_type) + assert group_id in all_groups + assert group_alias2 in all_groups[group_id]["alias"] + finally: + web.delete_group(group_type, group_id) + + +(a)pytest.mark.parametrize(("group_type"), [ "contact", "host", "service" ]) +def test_edit_group_missing(web, group_type): + group_id = "%s_testgroup_id" % group_type + group_alias = "%s_testgroup_alias" % group_type + group_alias2 = "%s_testgroup_otheralias" % group_type + try: + web.add_group(group_type, group_id, {"alias": group_alias}) + try: + #web.edit_group(group_type, group_id, {"alias": group_alias2}, expect_error = True) + web.edit_group(group_type, "%s_missing" % group_id, {"alias": group_alias2}, expect_error = True) + except APIError, e: + assert str(e) != str(None) + return + + assert False + finally: + web.delete_group(group_type, group_id) + + +def test_edit_cg_group_with_nagvis_maps(web, site): + dummy_map_filepath1 = "%s/etc/nagvis/maps/blabla.cfg" % site.root + dummy_map_filepath2 = "%s/etc/nagvis/maps/bloblo.cfg" % site.root + try: + file(dummy_map_filepath1, "w") + file(dummy_map_filepath2, "w") + web.add_group("contact", "nagvis_test", {"alias": "nagvis_test_alias", "nagvis_maps": ["blabla"]}) + web.edit_group("contact", "nagvis_test", {"alias": "nagvis_test_alias", "nagvis_maps": ["bloblo"]}) + + all_groups = web.get_all_groups("contact") + assert "nagvis_test" in all_groups + assert "bloblo" in all_groups["nagvis_test"]["nagvis_maps"] + finally: + web.delete_group("contact", "nagvis_test") + os.unlink(dummy_map_filepath1) + os.unlink(dummy_map_filepath2) + + + +(a)pytest.mark.parametrize(("group_type"), [ "contact", "host", "service" ]) +def test_delete_group(web, group_type): + group_id = "%s_testgroup_id" % group_type + group_alias = "%s_testgroup_alias" % group_type + try: + web.add_group(group_type, group_id, {"alias": group_alias}) + finally: + web.delete_group(group_type, group_id) + + +def test_get_all_users(web): + users = {"klaus": {"alias": "mr. klaus", "pager": "99221199", "password": "1234"}, + "monroe": {"alias": "mr. monroe"}} + expected_users = set(["omdadmin", "automation"] + users.keys()) + try: + response = web.add_htpasswd_users(users) + all_users = web.get_all_users() + assert not expected_users - set(all_users.keys()) + finally: + web.delete_htpasswd_users(users.keys()) + + +def test_add_htpasswd_users(web): + users = {"klaus": {"alias": "mr. klaus", "pager": "99221199", "password": "1234"}, + "monroe": {"alias": "mr. monroe"}} + try: + web.add_htpasswd_users(users) + finally: + web.delete_htpasswd_users(users.keys()) + + +def test_edit_htpasswd_users(web): + users = {"klaus": {"alias": "mr. klaus", "pager": "99221199", "password": "1234"}, + "monroe": {"alias": "mr. monroe"}} + try: + web.add_htpasswd_users(users) + web.edit_htpasswd_users({"monroe": {"set_attributes": {"alias": "ms. monroe"}}, + "klaus": {"unset_attributes": ["pager"]}}) + all_users = web.get_all_users() + assert not "pager" in all_users["klaus"] + assert all_users["monroe"]["alias"] == "ms. monroe" + finally: + web.delete_htpasswd_users(users.keys()) + pass + + def test_discover_servics(web): try: web.add_host("test-host-discovery", attributes={
7 years, 7 months
1
0
0
0
4358 FIX wmi_cpuload: fixed exception handling
by Simon Betz
Module: check_mk Branch: master Commit: 2bfc488a78abd1bffe74849a9784e0528f4ff733 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2bfc488a78abd1…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Fri Feb 10 16:59:41 2017 +0100 4358 FIX wmi_cpuload: fixed exception handling Change-Id: I2748b268a0d4739df3f8030a431abff93385ab6e --- .werks/4358 | 10 ++++++++++ ChangeLog | 2 ++ checks/wmi_cpuload | 6 +++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.werks/4358 b/.werks/4358 new file mode 100644 index 0000000..5239da3 --- /dev/null +++ b/.werks/4358 @@ -0,0 +1,10 @@ +Title: wmi_cpuload: fixed exception handling +Level: 1 +Component: checks +Class: fix +Compatible: compat +State: unknown +Version: 1.4.0i4 +Date: 1486742363 + + diff --git a/ChangeLog b/ChangeLog index 3b44b98..5f8b5ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -103,11 +103,13 @@ * 4340 FIX: blade_bays: cleanup and some improvements... * 4341 FIX: cisco_wlc: fixed invalid parameters during service discovery * 4024 FIX: netapp_api_volumes: fixed incorrect computation of read/write latency + * 4192 FIX: df: Fixed handling of incomplete information about inodes... * 4342 FIX: hp_proliant: fixed empty status handling * 4216 FIX: cmciii.phase: Fix wrong scaling of power and energy values * 4345 FIX: hp_proliant_temp: Ignore device levels of 0 * 4356 FIX: brocade_fcport: since FW 8.0.* tx/rxwords are no longer available, use values from FCMGMT-MIB instead * 4125 FIX: kaspersky_av_client: made fullscan state optional, simplified plugin... + * 4358 FIX: wmi_cpuload: fixed exception handling Multisite: * 4169 View action: Default values of sticky, notification and persistent options can now be configured via global settings.... diff --git a/checks/wmi_cpuload b/checks/wmi_cpuload index 76d2d49..bac9089 100644 --- a/checks/wmi_cpuload +++ b/checks/wmi_cpuload @@ -31,9 +31,9 @@ def check_wmi_cpuload(item, params, parsed): # unlike cpu load this does not include processes currently being processed, # so unless to cpu is (almost) fully utilized, this will be 0. - load = int(parsed["system_perf"].get(0, "ProcessorQueueLength")) + load = int(parsed["system_perf"].get(0, "ProcessorQueueLength")) this_time = get_wmi_time(parsed["system_perf"], 0) - load5min = get_average("load_5min", this_time, load, 5) + load5min = get_average("load_5min", this_time, load, 5) load15min = get_average("load_15min", this_time, load, 15) try: @@ -43,7 +43,7 @@ def check_wmi_cpuload(item, params, parsed): try: cores = int(computer_system.get(0, "NumberOfLogicalProcessors")) - except ValueError: + except (ValueError, MKGeneralException): # NumberOfLogicalProcessors can be an empty string, not sure why cores = int(computer_system.get(0, "NumberOfProcessors"))
7 years, 7 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
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