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
November
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 -----
November 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
Improved filename mangling.
by Sven Panne
Module: check_mk Branch: master Commit: 9a3d2a6d7e45f5397db730ee632e2a9a2754e00b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9a3d2a6d7e45f5…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Apr 26 11:34:22 2019 +0200 Improved filename mangling. Change-Id: I67a09128ad41a567a15990468dcd165f5661b34a --- livestatus/src/Makefile.am | 2 +- livestatus/src/test/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/livestatus/src/Makefile.am b/livestatus/src/Makefile.am index 399857f..f011256 100644 --- a/livestatus/src/Makefile.am +++ b/livestatus/src/Makefile.am @@ -193,7 +193,7 @@ cppcheck: compile_commands.json # We need to mangle the result a bit to make Jenkins' Cppcheck plugin happy cppcheck-xml: compile_commands.json $(CPPCHECK) -UCMC --enable=all --suppressions-list=cppcheck-suppressions.txt --inline-suppr --project=compile_commands.json --quiet --template=gcc --xml --xml-version=2 2> cppcheck-result.xml - sed -i "s%\\(<location file=\"\\)%\\1$(subdir)/%" cppcheck-result.xml + sed -i "s%\\(<location.* file=\"\\)\\([^/]\\)%\\1$(subdir)/\\2%" cppcheck-result.xml documentation: $(DOXYGEN) doc/Doxyfile diff --git a/livestatus/src/test/Makefile.am b/livestatus/src/test/Makefile.am index 1a5df70..ced6ea9 100644 --- a/livestatus/src/test/Makefile.am +++ b/livestatus/src/test/Makefile.am @@ -94,4 +94,4 @@ cppcheck: compile_commands.json # We need to mangle the result a bit to make Jenkins' Cppcheck plugin happy cppcheck-xml: compile_commands.json $(CPPCHECK) -UCMC --enable=all --suppressions-list=../cppcheck-suppressions.txt --inline-suppr --project=compile_commands.json --quiet --template=gcc --xml --xml-version=2 2> cppcheck-result.xml - sed -i "s%\\(<location file=\"\\)%\\1$(subdir)/%" cppcheck-result.xml + sed -i "s%\\(<location.* file=\"\\)\\([^/]\\)%\\1$(subdir)/\\2%" cppcheck-result.xml
5 years, 6 months
1
0
0
0
Use compiledb's default compile_command.json format.
by Sven Panne
Module: check_mk Branch: master Commit: 63ea39d9c3de3bfa946e786a3564648dc64e182e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=63ea39d9c3de3b…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Apr 26 10:56:30 2019 +0200 Use compiledb's default compile_command.json format. We need to use a very recent cppcheck because of other bugs, anyway. Change-Id: Ib19d532942ac034e43e07e9b8aaaa2f67bcf5d1d --- livestatus/src/Makefile.am | 4 +--- livestatus/src/test/Makefile.am | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/livestatus/src/Makefile.am b/livestatus/src/Makefile.am index a387340..bdd3256 100644 --- a/livestatus/src/Makefile.am +++ b/livestatus/src/Makefile.am @@ -176,11 +176,9 @@ livestatus.o: $(liblivestatus_a_OBJECTS) $(CXX) $(liblivestatus_a_CXXFLAGS) $(CXXFLAGS) NagiosMockup.o $@ -o NagiosMockup $(RM) NagiosMockup -# NOTE: cppcheck up to 7287ffe (2019-04-15) understands only the old "command -# style", so we have to stick with that for now. :-/ compile_commands.json: Makefile $(wildcard *.cc *.h) $(MAKE) -C $(top_srcdir) .venv - $(MAKE) -Bnwk | pipenv run compiledb --command-style + $(MAKE) -Bnwk | pipenv run compiledb tidy: compile_commands.json $(RUN_CLANG_TIDY) -quiet -j6 $(FILES_TO_CHECK) diff --git a/livestatus/src/test/Makefile.am b/livestatus/src/test/Makefile.am index fcc0be9..e8a4ab5 100644 --- a/livestatus/src/test/Makefile.am +++ b/livestatus/src/test/Makefile.am @@ -76,12 +76,10 @@ $(test_neb_SOURCES): build_googletest build_googletest: bash -c "make -C $(GOOGLETEST) build" > /dev/null -# NOTE: cppcheck up to 7287ffe (2019-04-15) understands only the old "command -# style", so we have to stick with that for now. :-/ compile_commands.json: Makefile $(wildcard *.cc *.h) $(MAKE) -C $(top_srcdir) .venv $(MAKE) -j4 -C .. - $(MAKE) -Bnwk | PIPENV_MAX_DEPTH=4 pipenv run compiledb --command-style + $(MAKE) -Bnwk | PIPENV_MAX_DEPTH=4 pipenv run compiledb tidy: compile_commands.json $(RUN_CLANG_TIDY) -quiet -j6 $(FILES_TO_CHECK)
5 years, 6 months
1
0
0
0
Make Jenkins' Cppcheck plugin happy again.
by Sven Panne
Module: check_mk Branch: master Commit: bce7576fc3f851615080b9dfef2d839d464ec201 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bce7576fc3f851…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Apr 26 11:19:11 2019 +0200 Make Jenkins' Cppcheck plugin happy again. Change-Id: I4112e6582982ddef06b893e422b8f586fe2fdc88 --- livestatus/src/Makefile.am | 2 ++ livestatus/src/test/Makefile.am | 2 ++ 2 files changed, 4 insertions(+) diff --git a/livestatus/src/Makefile.am b/livestatus/src/Makefile.am index bdd3256..399857f 100644 --- a/livestatus/src/Makefile.am +++ b/livestatus/src/Makefile.am @@ -190,8 +190,10 @@ iwyu: compile_commands.json cppcheck: compile_commands.json $(CPPCHECK) -UCMC --enable=all --suppressions-list=cppcheck-suppressions.txt --inline-suppr --project=compile_commands.json --quiet --template=gcc +# We need to mangle the result a bit to make Jenkins' Cppcheck plugin happy cppcheck-xml: compile_commands.json $(CPPCHECK) -UCMC --enable=all --suppressions-list=cppcheck-suppressions.txt --inline-suppr --project=compile_commands.json --quiet --template=gcc --xml --xml-version=2 2> cppcheck-result.xml + sed -i "s%\\(<location file=\"\\)%\\1$(subdir)/%" cppcheck-result.xml documentation: $(DOXYGEN) doc/Doxyfile diff --git a/livestatus/src/test/Makefile.am b/livestatus/src/test/Makefile.am index e8a4ab5..1a5df70 100644 --- a/livestatus/src/test/Makefile.am +++ b/livestatus/src/test/Makefile.am @@ -91,5 +91,7 @@ iwyu: compile_commands.json cppcheck: compile_commands.json $(CPPCHECK) -UCMC --enable=all --suppressions-list=../cppcheck-suppressions.txt --inline-suppr --project=compile_commands.json --quiet --template=gcc +# We need to mangle the result a bit to make Jenkins' Cppcheck plugin happy cppcheck-xml: compile_commands.json $(CPPCHECK) -UCMC --enable=all --suppressions-list=../cppcheck-suppressions.txt --inline-suppr --project=compile_commands.json --quiet --template=gcc --xml --xml-version=2 2> cppcheck-result.xml + sed -i "s%\\(<location file=\"\\)%\\1$(subdir)/%" cppcheck-result.xml
5 years, 6 months
1
0
0
0
postgres_stats: refactoring 3
by Florian Kromer
Module: check_mk Branch: master Commit: 69f0ea53bee57d6d2b85789ef7cb5c2172de887a URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69f0ea53bee57d…
Author: Florian Kromer <fk(a)mathias-kettner.de> Date: Thu Apr 25 14:55:38 2019 +0200 postgres_stats: refactoring 3 Change-Id: Ie3a0b33aeaac032f647b8b91e07429be64024ff6 --- checks/postgres_stats | 34 +++++++++------------- .../checks/generictests/datasets/postgres_stats.py | 7 +++-- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/checks/postgres_stats b/checks/postgres_stats index 13d1841..9104f85 100644 --- a/checks/postgres_stats +++ b/checks/postgres_stats @@ -93,31 +93,23 @@ def check_postgres_stats(item, params, parsed): return count = len(never_checked) + levels = params.get("never_analyze_vacuum") infotext = "%d tables were never %s: %s%s" % (count, text, "/".join(never_checked[:5]), " (first 5 shown)" if count > 5 else "") - if "never_analyze_vacuum" in params: - last_ts = get_item_state(key) - if last_ts is None: - set_item_state(key, now) - yield 0, infotext - return - - age = now - last_ts - warn, crit = params["never_analyze_vacuum"] - state = 0 - if age >= crit: - state = 2 - elif age >= warn: - state = 1 - if state: - infotext += " (warn/crit at %s/%s)" % \ - (get_age_human_readable(warn), - get_age_human_readable(crit),) - yield state, infotext + yield int(levels is None), infotext - else: - yield 1, infotext + last_ts = get_item_state(key) + if last_ts is None: + set_item_state(key, now) + return + yield check_levels( + now - last_ts, + None, + levels, + human_readable_func=get_age_human_readable, + infoname='Unhandled tables for', + ) check_info['postgres_stats'] = { diff --git a/tests/unit/checks/generictests/datasets/postgres_stats.py b/tests/unit/checks/generictests/datasets/postgres_stats.py index 087e883..647eed2 100644 --- a/tests/unit/checks/generictests/datasets/postgres_stats.py +++ b/tests/unit/checks/generictests/datasets/postgres_stats.py @@ -36,12 +36,14 @@ checks = { (u'ANALYZE adwebconnect', {'never_analyze_vacuum': (1000, 1100)}, [ (0, u'Table: auftrag', []), (0, 'Time since last vacuum: 674 d', []), - (2, u'2 tables were never analyzed: anrede/auftrag_mediadaten (warn/crit at 16 m/18 m)', []), + (0, '2 tables were never analyzed: anrede/auftrag_mediadaten', []), + (2, u'Unhandled tables for: 20 m (warn/crit at 16 m/18 m)', []), ]), (u'ANALYZE adwebconnect', {}, [ (0, u'Table: auftrag', []), (0, 'Time since last vacuum: 674 d', []), (1, u'2 tables were never analyzed: anrede/auftrag_mediadaten', []), + (0, u'Unhandled tables for: 20 m', []), ]), (u'ANALYZE postgres', {}, [ (0, 'No never checked tables', []), @@ -49,7 +51,8 @@ checks = { (u'VACUUM adwebconnect', {}, [ (0, u'Table: auftrag', []), (0, 'Time since last vacuum: 674 d', []), - (1, u'2 tables were never vacuumed: anrede/auftrag_mediadaten', []), + (1, '2 tables were never vacuumed: anrede/auftrag_mediadaten', []), + (0, u'Unhandled tables for: 20 m', []), ]), (u'VACUUM postgres', {}, [ (0, 'No never checked tables', []),
5 years, 6 months
1
0
0
0
GUI CSS: Refactored wato styles to nested structure meeting sasslint reqs (CMK-1171)
by Kenneth Okoh
Module: check_mk Branch: master Commit: e61ea114386aad10c705807eda4607b6e2124ba4 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e61ea114386aad…
Author: Kenneth Okoh <ko(a)mathias-kettner.de> Date: Wed Apr 24 13:48:01 2019 +0200 GUI CSS: Refactored wato styles to nested structure meeting sasslint reqs (CMK-1171) Change-Id: I17b5b87a19481b260e1b4ad59e6ef4f11d3cbb83 --- web/htdocs/themes/facelift/scss/_wato.scss | 443 ++++++++++++++--------------- 1 file changed, 219 insertions(+), 224 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=e61ea11438…
5 years, 6 months
1
0
0
0
postgres_stats: refactoring 2
by Florian Kromer
Module: check_mk Branch: master Commit: 67325fa196778bdb5d9ed9435131944400e01762 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=67325fa196778b…
Author: Florian Kromer <fk(a)mathias-kettner.de> Date: Thu Apr 25 13:51:50 2019 +0200 postgres_stats: refactoring 2 Change-Id: I808f2f7bbc3cc4eb37971e7b0f61c3eabbf0758b --- checks/postgres_stats | 54 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/checks/postgres_stats b/checks/postgres_stats index 52a9469..13d1841 100644 --- a/checks/postgres_stats +++ b/checks/postgres_stats @@ -90,34 +90,34 @@ def check_postgres_stats(item, params, parsed): if not never_checked: set_item_state(key, now) yield 0, "No never checked tables" + return + + count = len(never_checked) + infotext = "%d tables were never %s: %s%s" % (count, text, "/".join(never_checked[:5]), + " (first 5 shown)" if count > 5 else "") + + if "never_analyze_vacuum" in params: + last_ts = get_item_state(key) + if last_ts is None: + set_item_state(key, now) + yield 0, infotext + return + + age = now - last_ts + warn, crit = params["never_analyze_vacuum"] + state = 0 + if age >= crit: + state = 2 + elif age >= warn: + state = 1 + if state: + infotext += " (warn/crit at %s/%s)" % \ + (get_age_human_readable(warn), + get_age_human_readable(crit),) + yield state, infotext - elif never_checked: - infotext = "%d tables were never %s: %s%s" % \ - (len(never_checked), text, "/".join(never_checked[:5]), - len(never_checked) > 5 and " (first %d shown)" % min(5, len(never_checked)) or "") - - if "never_analyze_vacuum" in params: - last_ts = get_item_state(key) - if last_ts is None: - set_item_state(key, now) - yield 0, infotext - return - - age = now - last_ts - warn, crit = params["never_analyze_vacuum"] - state = 0 - if age >= crit: - state = 2 - elif age >= warn: - state = 1 - if state: - infotext += " (warn/crit at %s/%s)" % \ - (get_age_human_readable(warn), - get_age_human_readable(crit),) - yield state, infotext - - else: - yield 1, infotext + else: + yield 1, infotext check_info['postgres_stats'] = {
5 years, 6 months
1
0
0
0
postgres_stats: refactoring 1
by Florian Kromer
Module: check_mk Branch: master Commit: 57f584f9786b91cba4046ce8f7e9effae3a32d42 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=57f584f9786b91…
Author: Florian Kromer <fk(a)mathias-kettner.de> Date: Thu Apr 25 13:36:12 2019 +0200 postgres_stats: refactoring 1 CMK-2037 Change-Id: I8389724e6d2425888d21cea5f42590a9eebda938 --- checks/postgres_stats | 22 +++++++--------------- .../checks/generictests/datasets/postgres_stats.py | 6 +++--- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/checks/postgres_stats b/checks/postgres_stats index 7238b3a..52a9469 100644 --- a/checks/postgres_stats +++ b/checks/postgres_stats @@ -77,22 +77,14 @@ def check_postgres_stats(item, params, parsed): now = time.time() if oldest_element: - oldest_time = int(oldest_element[stats_field]) - warn, crit = params.get("last_%s" % paramskey, (None, None)) yield 0, "Table: %s" % oldest_element["tname"] - - state = 0 - if crit and now - crit > oldest_time: - state = 2 - elif warn and now - warn > oldest_time: - state = 1 - - extra_info = "" - if state: - extra_info = " (warn/crit at %s/%s)" % (get_age_human_readable(warn), - get_age_human_readable(crit)) - yield state, "Time since last vacuum %s%s" % (get_age_human_readable(now - oldest_time), - extra_info) + oldest_age = time.time() - int(oldest_element[stats_field]) + yield check_levels( + oldest_age, + None, + params.get("last_%s" % paramskey), + human_readable_func=get_age_human_readable, + infoname='Time since last vacuum') key = "postgres_stats.%s" % item if not never_checked: diff --git a/tests/unit/checks/generictests/datasets/postgres_stats.py b/tests/unit/checks/generictests/datasets/postgres_stats.py index 686a11f..087e883 100644 --- a/tests/unit/checks/generictests/datasets/postgres_stats.py +++ b/tests/unit/checks/generictests/datasets/postgres_stats.py @@ -35,12 +35,12 @@ checks = { '': [ (u'ANALYZE adwebconnect', {'never_analyze_vacuum': (1000, 1100)}, [ (0, u'Table: auftrag', []), - (0, 'Time since last vacuum 674 d', []), + (0, 'Time since last vacuum: 674 d', []), (2, u'2 tables were never analyzed: anrede/auftrag_mediadaten (warn/crit at 16 m/18 m)', []), ]), (u'ANALYZE adwebconnect', {}, [ (0, u'Table: auftrag', []), - (0, 'Time since last vacuum 674 d', []), + (0, 'Time since last vacuum: 674 d', []), (1, u'2 tables were never analyzed: anrede/auftrag_mediadaten', []), ]), (u'ANALYZE postgres', {}, [ @@ -48,7 +48,7 @@ checks = { ]), (u'VACUUM adwebconnect', {}, [ (0, u'Table: auftrag', []), - (0, 'Time since last vacuum 674 d', []), + (0, 'Time since last vacuum: 674 d', []), (1, u'2 tables were never vacuumed: anrede/auftrag_mediadaten', []), ]), (u'VACUUM postgres', {}, [
5 years, 6 months
1
0
0
0
Suppress false positives from cppcheck.
by Sven Panne
Module: check_mk Branch: master Commit: 407b7999ee04f74ab4562522a2470a1b3d8d4a5d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=407b7999ee04f7…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Fri Apr 26 08:59:31 2019 +0200 Suppress false positives from cppcheck. Change-Id: I5a997d00eb81122cf22b67da797317557f7db206 --- livestatus/src/TableHostsByGroup.cc | 2 ++ livestatus/src/TableServicesByGroup.cc | 2 ++ livestatus/src/TableServicesByHostGroup.cc | 2 ++ 3 files changed, 6 insertions(+) diff --git a/livestatus/src/TableHostsByGroup.cc b/livestatus/src/TableHostsByGroup.cc index 8e10ee6..9b7a0e3 100644 --- a/livestatus/src/TableHostsByGroup.cc +++ b/livestatus/src/TableHostsByGroup.cc @@ -37,6 +37,8 @@ extern hostgroup *hostgroup_list; namespace { struct hostbygroup { host _host; + // cppcheck is too dumb to see usage in the DANGEROUS_OFFSETOF macro + // cppcheck-suppress unusedStructMember hostgroup *_hostgroup; }; } // namespace diff --git a/livestatus/src/TableServicesByGroup.cc b/livestatus/src/TableServicesByGroup.cc index eb96b1e..55062c6 100644 --- a/livestatus/src/TableServicesByGroup.cc +++ b/livestatus/src/TableServicesByGroup.cc @@ -36,6 +36,8 @@ extern servicegroup *servicegroup_list; namespace { struct servicebygroup { service _service; + // cppcheck is too dumb to see usage in the DANGEROUS_OFFSETOF macro + // cppcheck-suppress unusedStructMember servicegroup *_servicegroup; }; } // namespace diff --git a/livestatus/src/TableServicesByHostGroup.cc b/livestatus/src/TableServicesByHostGroup.cc index 5aff696..97887bd 100644 --- a/livestatus/src/TableServicesByHostGroup.cc +++ b/livestatus/src/TableServicesByHostGroup.cc @@ -35,6 +35,8 @@ extern hostgroup *hostgroup_list; namespace { struct servicebyhostgroup { service _service; + // cppcheck is too dumb to see usage in the DANGEROUS_OFFSETOF macro + // cppcheck-suppress unusedStructMember hostgroup *_hostgroup; }; } // namespace
5 years, 6 months
1
0
0
0
AWS instance creators: Shortened class names
by Simon Betz
Module: check_mk Branch: master Commit: e375532bbceaf63719ca798c8a1b8bceda077ad7 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e375532bbceaf6…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Thu Apr 25 10:04:31 2019 +0200 AWS instance creators: Shortened class names Change-Id: I64d95bbfbd5b9349be468ba40e67826e0f5cbe56 --- .../agent_aws/agent_aws_fake_clients.py | 20 ++++++++++---------- .../agent_aws/test_agent_aws_costs_and_usage.py | 4 ++-- .../special_agents/agent_aws/test_agent_aws_elb.py | 15 ++++++--------- .../special_agents/agent_aws/test_agent_aws_rds.py | 4 ++-- .../special_agents/agent_aws/test_agent_aws_s3.py | 10 +++++----- 5 files changed, 25 insertions(+), 28 deletions(-) diff --git a/tests/unit/cmk/special_agents/agent_aws/agent_aws_fake_clients.py b/tests/unit/cmk/special_agents/agent_aws/agent_aws_fake_clients.py index 0bf6d65..b4d72c6 100644 --- a/tests/unit/cmk/special_agents/agent_aws/agent_aws_fake_clients.py +++ b/tests/unit/cmk/special_agents/agent_aws/agent_aws_fake_clients.py @@ -150,13 +150,13 @@ class InstanceCreator(object): # .--S3------------------------------------------------------------------- -class S3ListBucketsInstanceCreator(InstanceCreator): +class S3ListBucketsIC(InstanceCreator): def _fill_instance(self): self.add(Str('Name')) self.add(Timestamp('CreationDate')) -class S3BucketTaggingInstanceCreator(InstanceCreator): +class S3BucketTaggingIC(InstanceCreator): def _fill_instance(self): self.add(Str('Key')) self.add(Str('Value')) @@ -166,7 +166,7 @@ class S3BucketTaggingInstanceCreator(InstanceCreator): # .--Cloudwatch----------------------------------------------------------- -class CloudwatchDescribeAlarmsInstanceCreator(InstanceCreator): +class CloudwatchDescribeAlarmsIC(InstanceCreator): def _fill_instance(self): self.add(Str('AlarmName')) self.add(Str('AlarmArn')) @@ -291,7 +291,7 @@ class CloudwatchDescribeAlarmsInstanceCreator(InstanceCreator): # .--CE------------------------------------------------------------------- -class CEGetCostsAndUsageInstanceCreator(InstanceCreator): +class CEGetCostsAndUsageIC(InstanceCreator): def _fill_instance(self): self.add(Dict('TimePeriod', [ Str('Start'), @@ -316,7 +316,7 @@ class CEGetCostsAndUsageInstanceCreator(InstanceCreator): # .--RDS------------------------------------------------------------------ -class RDSDescribeAccountAttributesInstanceCreator(InstanceCreator): +class RDSDescribeAccountAttributesIC(InstanceCreator): def _fill_instance(self): # TODO for each choice one entry self.add( @@ -341,7 +341,7 @@ class RDSDescribeAccountAttributesInstanceCreator(InstanceCreator): self.add(Int('Max')) -class RDSDescribeDBInstancesInstanceCreator(InstanceCreator): +class RDSDescribeDBInstancesIC(InstanceCreator): def _fill_instance(self): self.add(Str('DBInstanceIdentifier')) self.add(Str('DBInstanceClass')) @@ -483,7 +483,7 @@ class RDSDescribeDBInstancesInstanceCreator(InstanceCreator): # .--ELB------------------------------------------------------------------ -class ELBDescribeLoadBalancersInstanceCreator(InstanceCreator): +class ELBDescribeLoadBalancersIC(InstanceCreator): def _fill_instance(self): self.add(Str('LoadBalancerName')) self.add(Str('DNSName')) @@ -543,7 +543,7 @@ class ELBDescribeLoadBalancersInstanceCreator(InstanceCreator): ])) -class ELBDescribeTagsInstanceCreator(InstanceCreator): +class ELBDescribeTagsIC(InstanceCreator): def _fill_instance(self): self.add(Str('LoadBalancerName')) self.add(List('Tags', [ @@ -552,7 +552,7 @@ class ELBDescribeTagsInstanceCreator(InstanceCreator): ])) -class ELBDescribeInstanceHealthInstanceCreator(InstanceCreator): +class ELBDescribeInstanceHealthIC(InstanceCreator): def _fill_instance(self): self.add(Str('InstanceId')) self.add(Choice('State', ["InService", "OutOfServic", "Unknown"])) @@ -574,7 +574,7 @@ class ELBDescribeInstanceHealthInstanceCreator(InstanceCreator): class FakeCloudwatchClient(object): def describe_alarms(self, AlarmNames=None): - alarms = CloudwatchDescribeAlarmsInstanceCreator.create_instances(amount=2) + alarms = CloudwatchDescribeAlarmsIC.create_instances(amount=2) if AlarmNames: alarms = [alarm for alarm in alarms if alarm['AlarmName'] in AlarmNames] return {'MetricAlarms': alarms, 'NextToken': 'string'} diff --git a/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_costs_and_usage.py b/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_costs_and_usage.py index e85a6d2..950614c 100644 --- a/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_costs_and_usage.py +++ b/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_costs_and_usage.py @@ -1,7 +1,7 @@ # encoding: utf-8 from agent_aws_fake_clients import ( - CEGetCostsAndUsageInstanceCreator,) + CEGetCostsAndUsageIC,) from cmk.special_agents.agent_aws import ( AWSConfig, @@ -17,7 +17,7 @@ class FakeCEClient(object): 'Type': "'DIMENSION' | 'TAG'", 'Key': 'string' },], - 'ResultsByTime': CEGetCostsAndUsageInstanceCreator.create_instances(amount=1), + 'ResultsByTime': CEGetCostsAndUsageIC.create_instances(amount=1), } diff --git a/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_elb.py b/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_elb.py index b71dc29..66c5617 100644 --- a/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_elb.py +++ b/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_elb.py @@ -3,9 +3,9 @@ import pytest from agent_aws_fake_clients import ( FakeCloudwatchClient, - ELBDescribeLoadBalancersInstanceCreator, - ELBDescribeTagsInstanceCreator, - ELBDescribeInstanceHealthInstanceCreator, + ELBDescribeLoadBalancersIC, + ELBDescribeTagsIC, + ELBDescribeInstanceHealthIC, ) from cmk.special_agents.agent_aws import ( @@ -22,8 +22,7 @@ from cmk.special_agents.agent_aws import ( class FakeELBClient(object): def describe_load_balancers(self, LoadBalancerNames=None): return { - 'LoadBalancerDescriptions': - ELBDescribeLoadBalancersInstanceCreator.create_instances(amount=3), + 'LoadBalancerDescriptions': ELBDescribeLoadBalancersIC.create_instances(amount=3), 'NextMarker': 'string', } @@ -51,13 +50,11 @@ class FakeELBClient(object): for lb_name in LoadBalancerNames: if lb_name not in ["LoadBalancerName-0", "LoadBalancerName-1"]: continue - tag_descrs.extend(ELBDescribeTagsInstanceCreator.create_instances(amount=1)) + tag_descrs.extend(ELBDescribeTagsIC.create_instances(amount=1)) return {'TagDescriptions': tag_descrs} def describe_instance_health(self, LoadBalancerName=None): - return { - 'InstanceStates': ELBDescribeInstanceHealthInstanceCreator.create_instances(amount=1) - } + return {'InstanceStates': ELBDescribeInstanceHealthIC.create_instances(amount=1)} @pytest.fixture() diff --git a/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_rds.py b/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_rds.py index a62fcff..4136160 100644 --- a/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_rds.py +++ b/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_rds.py @@ -2,7 +2,7 @@ import pytest from agent_aws_fake_clients import ( - RDSDescribeDBInstancesInstanceCreator, + RDSDescribeDBInstancesIC, FakeCloudwatchClient, ) @@ -105,7 +105,7 @@ class FakeRDSClient(object): def describe_db_instances(self, DBInstanceIdentifier=None, Filters=None): return { 'Marker': 'string', - 'DBInstances': RDSDescribeDBInstancesInstanceCreator.create_instances(amount=2), + 'DBInstances': RDSDescribeDBInstancesIC.create_instances(amount=2), } diff --git a/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_s3.py b/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_s3.py index eb217be..2a84f99 100644 --- a/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_s3.py +++ b/tests/unit/cmk/special_agents/agent_aws/test_agent_aws_s3.py @@ -3,8 +3,8 @@ import pytest from agent_aws_fake_clients import ( FakeCloudwatchClient, - S3ListBucketsInstanceCreator, - S3BucketTaggingInstanceCreator, + S3ListBucketsIC, + S3BucketTaggingIC, ) from cmk.special_agents.agent_aws import ( @@ -20,7 +20,7 @@ from cmk.special_agents.agent_aws import ( class FakeS3Client(object): def list_buckets(self): return { - 'Buckets': S3ListBucketsInstanceCreator.create_instances(amount=4), + 'Buckets': S3ListBucketsIC.create_instances(amount=4), 'Owner': { 'DisplayName': 'string', 'ID': 'string', @@ -37,11 +37,11 @@ class FakeS3Client(object): def get_bucket_tagging(self, Bucket=''): if Bucket == 'Name-0': return { - 'TagSet': S3BucketTaggingInstanceCreator.create_instances(amount=1), + 'TagSet': S3BucketTaggingIC.create_instances(amount=1), } elif Bucket == 'Name-1': return { - 'TagSet': S3BucketTaggingInstanceCreator.create_instances(amount=2), + 'TagSet': S3BucketTaggingIC.create_instances(amount=2), } return {}
5 years, 6 months
1
0
0
0
Cleaned up AWS ELB test
by Simon Betz
Module: check_mk Branch: master Commit: 08bf7887f9ad22df8fb631db634a0a74b097e9ea URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=08bf7887f9ad22…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Wed Apr 24 15:51:05 2019 +0200 Cleaned up AWS ELB test Change-Id: I2f6866374318c325ba242df9f73b19727d3c58d3 --- .../agent_aws/agent_aws_fake_clients.py | 81 ++++ .../special_agents/agent_aws/test_agent_aws_elb.py | 436 +++++---------------- 2 files changed, 170 insertions(+), 347 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=08bf7887f9…
5 years, 6 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
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