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 2018
----- 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
255 discussions
Start a n
N
ew thread
Use the local compilation database for cppcheck, too.
by Sven Panne
Module: check_mk Branch: master Commit: 8b418a0ca0724df67fed48cf5fb5b30d2a417a7d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8b418a0ca0724d…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Tue Jan 2 13:49:59 2018 +0100 Use the local compilation database for cppcheck, too. Change-Id: I141eae2a8fce6d809bf7cfd19d2f400453cc6837 --- .gitignore | 1 - Makefile | 34 +++++++------------------------- livestatus/.gitignore | 1 - livestatus/src/.gitignore | 10 ++++++---- livestatus/src/Makefile.am | 12 +++++++++-- livestatus/src/cppcheck-suppressions.txt | 9 +++++++++ scripts/compiled_sources | 7 ------- 7 files changed, 32 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 6f604ed..5cd8ee9 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ clang-analyzer/ cmc-*.tar.gz cme-*.tar.gz compile -compile_commands.json config.guess config.h config.h.in diff --git a/Makefile b/Makefile index 27b6b63..e7eae1d 100644 --- a/Makefile +++ b/Makefile @@ -374,7 +374,7 @@ install-minified-js: $(JAVASCRIPT_MINI) # GNU standards here (see "Standard Targets for Users", #
https://www.gnu.org/prep/standards/html_node/Standard-Targets.html
). clean: - rm -rf api clang-analyzer compile_commands.json dist.tmp rpm.topdir *.rpm *.deb *.exe \ + rm -rf api clang-analyzer dist.tmp rpm.topdir *.rpm *.deb *.exe \ mk-livestatus-*.tar.gz \ $(NAME)-*.tar.gz *~ counters autochecks \ precompiled cache web/htdocs/js/*_min.js \ @@ -461,14 +461,6 @@ GTAGS: config.h # to configure.ac). $(MAKE) -C livestatus GTAGS -compile_commands.json: config.h $(FILES_TO_FORMAT) - $(MAKE) -C livestatus clean - $(BEAR) $(MAKE) -C livestatus -j4 -ifeq ($(ENTERPRISE),yes) - $(MAKE) -C enterprise/core clean - $(BEAR) --append $(MAKE) -C enterprise/core -j4 -endif - compile-neb-cmc: config.status $(MAKE) -C livestatus -j4 ifeq ($(ENTERPRISE),yes) @@ -496,29 +488,17 @@ analyze: config.h # fragile. # GCC-like output on stderr intended for human consumption. -cppcheck: compile_commands.json - @scripts/compiled_sources | \ - grep /livestatus/src/ |\ - sed 's/^"\(.*\)"$$/\1/' | \ - ( cd livestatus && $(CPPCHECK) -DHAVE_CONFIG_H -UCMC --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=passedByValue --inline-suppr -I src -I .. -I . --file-list=- --quiet --template=gcc ) +cppcheck: config.h + $(MAKE) -C livestatus/src cppcheck ifeq ($(ENTERPRISE),yes) - @scripts/compiled_sources | \ - grep /enterprise/core/ |\ - sed 's/^"\(.*\)"$$/\1/' | \ - ( cd enterprise/core/src && $(CPPCHECK) -DHAVE_CONFIG_H -DCMC --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=passedByValue --inline-suppr -I . -I ../../.. -I livestatus -I checkhelper --file-list=- --quiet --template=gcc ) + $(MAKE) -C enterprise/core/src cppcheck endif # XML output into file intended for machine processing. -cppcheck-xml: compile_commands.json - scripts/compiled_sources | \ - grep /livestatus/src/ |\ - sed 's/^"\(.*\)"$$/\1/' | \ - ( cd livestatus && $(CPPCHECK) -DHAVE_CONFIG_H -UCMC --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=passedByValue --inline-suppr -I src -I .. -I . --file-list=- --quiet --template=gcc --xml --xml-version=2 2> cppcheck-result.xml ) +cppcheck-xml: config.h + $(MAKE) -C livestatus/src cppcheck-xml ifeq ($(ENTERPRISE),yes) - scripts/compiled_sources | \ - grep /enterprise/core/ |\ - sed 's/^"\(.*\)"$$/\1/' | \ - ( cd enterprise/core/src && $(CPPCHECK) -DHAVE_CONFIG_H -DCMC --enable=all --suppress=missingIncludeSystem --suppress=unusedFunction --suppress=passedByValue --inline-suppr -I . -I ../../.. -I livestatus -I checkhelper --file-list=- --quiet --template=gcc --xml --xml-version=2 2> cppcheck-result.xml ) + $(MAKE) -C enterprise/core/src cppcheck-xml endif # TODO: We should probably handle this rule via AM_EXTRA_RECURSIVE_TARGETS in diff --git a/livestatus/.gitignore b/livestatus/.gitignore index 349f3b8..0acdced 100644 --- a/livestatus/.gitignore +++ b/livestatus/.gitignore @@ -1,4 +1,3 @@ -cppcheck-result.xml .cproject cscope.files Debug diff --git a/livestatus/src/.gitignore b/livestatus/src/.gitignore index 431d451..d39fed4 100644 --- a/livestatus/src/.gitignore +++ b/livestatus/src/.gitignore @@ -1,10 +1,12 @@ *.a +*.la +*.o +*.so .cproject .deps -*.la -livecheck Makefile Makefile.in -*.o -*.so +compile_commands.json +cppcheck-result.xml +livecheck unixcat diff --git a/livestatus/src/Makefile.am b/livestatus/src/Makefile.am index 84ead24..9fef8b1 100644 --- a/livestatus/src/Makefile.am +++ b/livestatus/src/Makefile.am @@ -23,9 +23,11 @@ # Boston, MA 02110-1301 USA. CLANG_VERSION ?= 5.0 -RUN_CLANG_TIDY ?= run-clang-tidy-$(CLANG_VERSION).py -IWYU_TOOL ?= iwyu_tool + BEAR ?= bear +CPPCHECK ?= cppcheck +IWYU_TOOL ?= iwyu_tool +RUN_CLANG_TIDY ?= run-clang-tidy-$(CLANG_VERSION).py bin_PROGRAMS = unixcat @@ -177,6 +179,12 @@ tidy: compile_commands.json iwyu: compile_commands.json $(IWYU_TOOL) --output-format=clang -p . -- --mapping_file=$(abs_top_srcdir)/tests/iwyu-mappings/check_mk.imp +cppcheck: compile_commands.json + $(CPPCHECK) -UCMC --enable=all --suppressions-list=cppcheck-suppressions.txt --inline-suppr --project=compile_commands.json --quiet --template=gcc + +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 + all-local: livestatus.o install-data-local: diff --git a/livestatus/src/cppcheck-suppressions.txt b/livestatus/src/cppcheck-suppressions.txt new file mode 100644 index 0000000..987a260 --- /dev/null +++ b/livestatus/src/cppcheck-suppressions.txt @@ -0,0 +1,9 @@ +missingIncludeSystem +passedByValue +unusedFunction +// cppcheck doesn't undestand uniform initialization yet. +constStatement +// This is nonsense, but otherwise cppcheck complains even if it shouldn't. +unmatchedSuppression +// cppcheck is simply too dumb about macros... +*:/usr/include/boost/config.hpp diff --git a/scripts/compiled_sources b/scripts/compiled_sources deleted file mode 100755 index 89c6d23..0000000 --- a/scripts/compiled_sources +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/python - -import json - -with open('compile_commands.json') as cc: - for command_object in json.load(cc): - print('"%s"' % command_object['file'])
6 years, 8 months
1
0
0
0
removed print statement
by Simon Betz
Module: check_mk Branch: master Commit: 9b96de0abc573695ad19288f9a80f958c5c43421 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b96de0abc5736…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Tue Jan 2 13:17:23 2018 +0100 removed print statement Change-Id: Ie40a109e13c1b65d233eed05bbc29975a165c887 --- checks/if.include | 4 ---- 1 file changed, 4 deletions(-) diff --git a/checks/if.include b/checks/if.include index 2bff526..42312af 100644 --- a/checks/if.include +++ b/checks/if.include @@ -304,10 +304,6 @@ def inventory_if_common(info, has_nodeinfo = False): return False group_patterns = _prepare_if_group_patterns_from_conf() - - - print settings_sets - for settings in settings_sets: uses_description = settings.get('use_desc', if_inventory_uses_description) uses_alias = settings.get('use_alias', if_inventory_uses_alias)
6 years, 8 months
1
0
0
0
Added some basic tests for check plugin 'if'
by Simon Betz
Module: check_mk Branch: master Commit: ca9d6828a6cd3f1f6db455b0208fbd10b5cb8d74 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ca9d6828a6cd3f…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Wed Dec 6 17:18:19 2017 +0100 Added some basic tests for check plugin 'if' Change-Id: If0ac4210cc5f04754b2ea51cb3a2ee4d7b986e69 --- checks/if.include | 3 +++ tests/checks/test_if_check.py | 50 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/checks/if.include b/checks/if.include index 2331844..2bff526 100644 --- a/checks/if.include +++ b/checks/if.include @@ -305,6 +305,9 @@ def inventory_if_common(info, has_nodeinfo = False): group_patterns = _prepare_if_group_patterns_from_conf() + + print settings_sets + for settings in settings_sets: uses_description = settings.get('use_desc', if_inventory_uses_description) uses_alias = settings.get('use_alias', if_inventory_uses_alias) diff --git a/tests/checks/test_if_check.py b/tests/checks/test_if_check.py new file mode 100644 index 0000000..4098e87 --- /dev/null +++ b/tests/checks/test_if_check.py @@ -0,0 +1,50 @@ +import pytest +import pprint +import ast +from testlib import cmk_path + +# Mark all tests in this file as check related tests +pytestmark = pytest.mark.checks + + +# line in info: +# [NODE_INFO] +# ifIndex +# ifDescr +# ifType +# ifSpeed +# ifOperStatus +# ifInOctets +# inucast +# inmcast +# inbcast +# ifInDiscards +# ifInErrors +# ifOutOctets +# outucast +# outmcast +# outbcast +# ifOutDiscards +# ifOutErrors, +# ifOutQLen +# ifAlias +# ifPhysAddress + + +(a)pytest.mark.parametrize("info,inventory_if_rules,result", [ + ([], [], 0), + ([20*[""]], [], 0), + ([20*["0"]], [], 0), + ([21*[""]], [], 0), + ([21*["0"]], [], 0), + ([["1", "EINS", "6", "10", "1"] + 13*["0"] + ["EINS-ALIAS", "00:00:00:00:00:00"]], [], 1), + ([["1", "EINS", "6", "10", "2"] + 13*["0"] + ["EINS-ALIAS", "00:00:00:00:00:00"]], [], 0), + ([["1", "EINS", "00000", "10", "1"] + 13*["0"] + ["EINS-ALIAS", "00:00:00:00:00:00"]], [], 0), + ([["1", "EINS", "6", "10", "1"] + 13*["0"] + ["EINS-ALIAS", "00:00:00:00:00:00"], + ["1", "EINS-DUPLICATE", "6", "10", "1"] + 13*["0",] + ["EINS-ALIAS-DUPLICATE", "00:00:00:00:00:00"]], [], 2), +]) +def test_if_inventory_if_common_count_interfaces(check_manager, monkeypatch, info, inventory_if_rules, result): + check = check_manager.get_check("if") + #TODO How to handle several "host_extra_conf"s? + #monkeypatch.setitem(check.context, "host_extra_conf", lambda _, __: inventory_if_rules) + assert len(check.run_discovery(info)) == result
6 years, 8 months
1
0
0
0
IWYU fixes.
by Sven Panne
Module: check_mk Branch: master Commit: 8b56b9f8321700ab0a16fe65331b7dcb09ab3719 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8b56b9f8321700…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Tue Jan 2 10:29:19 2018 +0100 IWYU fixes. Change-Id: I94bfdb69381cb88883d851776326e390824f6404 --- livestatus/src/AttributeListColumn.cc | 2 +- livestatus/src/InputBuffer.cc | 1 - livestatus/src/OutputBuffer.cc | 1 - livestatus/src/module.cc | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/livestatus/src/AttributeListColumn.cc b/livestatus/src/AttributeListColumn.cc index 0deafa9..6ed6382 100644 --- a/livestatus/src/AttributeListColumn.cc +++ b/livestatus/src/AttributeListColumn.cc @@ -25,7 +25,7 @@ #include "AttributeListColumn.h" #include <memory> #include <vector> -#include "Filter.h" +#include "Filter.h" // IWYU pragma: keep #include "Row.h" std::unique_ptr<Filter> AttributeListColumn::createFilter( diff --git a/livestatus/src/InputBuffer.cc b/livestatus/src/InputBuffer.cc index 8ae699b..be0e1f8 100644 --- a/livestatus/src/InputBuffer.cc +++ b/livestatus/src/InputBuffer.cc @@ -27,7 +27,6 @@ #include <cctype> #include <cstring> #include <ostream> -#include <ratio> #include <type_traits> #include "Logger.h" #include "Poller.h" diff --git a/livestatus/src/OutputBuffer.cc b/livestatus/src/OutputBuffer.cc index bcc4b86..5f95f8a 100644 --- a/livestatus/src/OutputBuffer.cc +++ b/livestatus/src/OutputBuffer.cc @@ -27,7 +27,6 @@ #include <chrono> #include <cstddef> #include <iomanip> -#include <ratio> #include "Logger.h" #include "Poller.h" diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc index 90b6a8a..b33bc21 100644 --- a/livestatus/src/module.cc +++ b/livestatus/src/module.cc @@ -42,7 +42,6 @@ #include <cstring> #include <ctime> #include <memory> -#include <ratio> #include <sstream> #include <string> #include <unordered_map>
6 years, 8 months
1
0
0
0
Minor cleanup
by Simon Betz
Module: check_mk Branch: master Commit: 0f31532adb258bc5e702d716b94e923f71b66f9f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0f31532adb258b…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Tue Jan 2 09:50:54 2018 +0100 Minor cleanup Change-Id: Idfb740978a4eb660dbdee54d216f83f679c0fd83 --- checks/salesforce_instances | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/checks/salesforce_instances b/checks/salesforce_instances index 6e09451..7a08bfa 100644 --- a/checks/salesforce_instances +++ b/checks/salesforce_instances @@ -31,16 +31,21 @@ def parse_salesforce(info): except ImportError: import json - parsed = [] + pre_parsed = [] for line in info: - parsed.append(json.loads(" ".join(line))) + pre_parsed.append(json.loads(" ".join(line))) + + parsed = {} + for entry in pre_parsed: + if entry.get("key"): + parsed.setdefault(entry.get("key"), entry) return parsed def inventory_salesforce_instances(parsed): - for entry in parsed: - if entry.get("key") and entry.get("isActive"): - yield entry["key"], {} + for instance, attrs in parsed.iteritems(): + if attrs.get("isActive"): + yield instance, {} def check_salesforce_instances(item, params, parsed): @@ -56,20 +61,19 @@ def check_salesforce_instances(item, params, parsed): "INFORMATIONAL_NONCORE": (0, "informational noncore"), } - for entry in parsed: - if entry.get("key") == item: - status = entry.get("status") - state, state_readable = map_states.get(status, (3, "unknown[%s]" % status)) - yield state, "Status: %s" % state_readable - if entry.get("environment"): - yield 0, "Environment: %s" % entry["environment"] - release_info = [] - if entry.get("releaseNumber"): - release_info.append("Number: %s" % entry["releaseNumber"]) - if entry.get("releaseVersion"): - release_info.append("Version: %s" % entry["releaseVersion"]) - if release_info: - yield 0, "Release %s" % ", ".join(release_info) + if item in parsed: + data = parsed[item] + status = data.get("status") + state, state_readable = map_states.get(status, (3, "unknown[%s]" % status)) + yield state, "Status: %s" % state_readable + + for key, title in [ + ("environment", "Environment"), + ("releaseNumber", "Release Number"), + ("releaseVersion", "Release Version") + ]: + if data.get(key): + yield 0, "%s: %s" % (title, data[key]) check_info['salesforce_instances'] = {
6 years, 8 months
1
0
0
0
← Newer
1
...
23
24
25
26
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
Results per page:
10
25
50
100
200