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
September 2016
----- 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
9 participants
301 discussions
Start a n
N
ew thread
Reserved 1 bug IDS
by Sven Rueß
Module: check_mk Branch: master Commit: 8ea63dba1db91d7e9a6ff3ee572e3e3c8046b5be URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ea63dba1db91d…
Author: Sven Rueß <sr(a)mathias-kettner.de> Date: Thu Sep 22 17:03:29 2016 +0200 Reserved 1 bug IDS --- .bugs/first_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bugs/first_free b/.bugs/first_free index 5cf52bb..b1f48fb 100644 --- a/.bugs/first_free +++ b/.bugs/first_free @@ -1 +1 @@ -2520 +2521
7 years, 12 months
1
0
0
0
check_parameters.py: Sorted a number of rules into their appropriate sections
by Konstantin Büttner
Module: check_mk Branch: master Commit: 7e71665aba873016fdb5aea3410309bde600cc7c URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7e71665aba8730…
Author: Konstantin Büttner <kb(a)mathias-kettner.de> Date: Thu Sep 22 10:30:52 2016 +0200 check_parameters.py: Sorted a number of rules into their appropriate sections --- web/plugins/wato/check_parameters.py | 4178 +++++++++++++++++----------------- 1 file changed, 2089 insertions(+), 2089 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=7e71665aba…
7 years, 12 months
1
0
0
0
3888 FIX df checks: Fixed invalid displayed WARN / CRIT lines in graphs when using "bytes left" thresholds
by Lars Michelsen
Module: check_mk Branch: master Commit: 5cf69a3267768273533112521413e2d735cee778 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5cf69a32677682…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 22 09:43:26 2016 +0200 3888 FIX df checks: Fixed invalid displayed WARN / CRIT lines in graphs when using "bytes left" thresholds --- .werks/3888 | 10 ++++++++++ ChangeLog | 1 + checks/df.include | 34 +++++++++++++++------------------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.werks/3888 b/.werks/3888 new file mode 100644 index 0000000..d643c77 --- /dev/null +++ b/.werks/3888 @@ -0,0 +1,10 @@ +Title: df checks: Fixed invalid displayed WARN / CRIT lines in graphs when using "bytes left" thresholds +Level: 1 +Component: checks +Class: fix +Compatible: compat +State: unknown +Version: 1.4.0i1 +Date: 1474530137 + + diff --git a/ChangeLog b/ChangeLog index 8b98b42..d5986dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -403,6 +403,7 @@ * 3810 FIX: windows agent: no longer truncates plugin output, no longer freezes when plugin produces too much output... * 3812 FIX: winperf_phydisk: reintroduced read and write queue length performance data... * 3813 FIX: check_mail: fixed missing base64 decoding on multipart mails + * 3888 FIX: df checks: Fixed invalid displayed WARN / CRIT lines in graphs when using "bytes left" thresholds Multisite: * 3187 notification view: new filter for log command via regex diff --git a/checks/df.include b/checks/df.include index c9bfdee..4e73135 100644 --- a/checks/df.include +++ b/checks/df.include @@ -304,11 +304,6 @@ def df_check_filesystem_single(hostname, mountpoint, size_mb, avail_mb, reserved # bigger than 100 GB and lowers it for file systems smaller than 100 GB. # Please run df_magic_factor.py to understand how it works. - # TODO: In some future version use a fixed name as perf variable - perf_var = mountpoint.replace(" ", "_") - perfdata = [(perf_var, str(used_mb) + 'MB', warn_mb, crit_mb, 0, size_mb)] - perfdata.append(('fs_size', str(size_mb) + 'MB')) - used_hr = get_bytes_human_readable(used_mb * 1024 * 1024) size_hr = get_bytes_human_readable(size_mb * 1024 * 1024) # If both numbers end with both MB or GB or TB, then drop the first one @@ -320,21 +315,22 @@ def df_check_filesystem_single(hostname, mountpoint, size_mb, avail_mb, reserved infotext = "%s used (%s of %s)" % ( get_percent_human_readable(used_perc), used_hr, size_hr) + if warn_mb < 0.0: + # Negative levels, so user configured thresholds based on space left. Calculate the + # upper thresholds based on the size of the filesystem + crit_mb = size_mb + crit_mb + warn_mb = size_mb + warn_mb + status = 0 - if warn_mb < 0: - # Negative levels, so calculate MB left - rest_mb = size_mb - used_mb - crit_mb = crit_mb * -1 - warn_mb = warn_mb * -1 - if rest_mb <= crit_mb: - status = 2 - elif rest_mb <= warn_mb: - status = max(1, status) - else: - if used_mb >= crit_mb: - status = 2 - elif used_mb >= warn_mb: - status = max(1, status) + if used_mb >= crit_mb: + status = 2 + elif used_mb >= warn_mb: + status = max(1, status) + + # TODO: In some future version use a fixed name as perf variable + perf_var = mountpoint.replace(" ", "_") + perfdata = [(perf_var, str(used_mb) + 'MB', warn_mb, crit_mb, 0, size_mb)] + perfdata.append(('fs_size', str(size_mb) + 'MB')) if type(params) == dict: show_levels = params.get("show_levels")
7 years, 12 months
1
0
0
0
Fixed path variables used in checks/inventory plugins
by Lars Michelsen
Module: check_mk Branch: master Commit: db0ab99e6fb1348f67a82624d00cc80dda722a69 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=db0ab99e6fb134…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 22 08:37:24 2016 +0200 Fixed path variables used in checks/inventory plugins --- checks/logwatch | 2 +- inventory/export_software_csv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/checks/logwatch b/checks/logwatch index 21f66a7..30e0958 100644 --- a/checks/logwatch +++ b/checks/logwatch @@ -238,7 +238,7 @@ def logwatch_parse_line(line): # ignored. def check_logwatch(item, params, info): def cachefile_path(node): - return tcp_cache_dir + "/" + node + return cmk.paths.tcp_cache_dir + "/" + node now = time.time() last_run = get_item_state("logwatch_last_run_%s" % item, 0) diff --git a/inventory/export_software_csv b/inventory/export_software_csv index ac04b6c..a80f04e 100644 --- a/inventory/export_software_csv +++ b/inventory/export_software_csv @@ -43,7 +43,7 @@ def inv_export_software_csv(hostname, params, tree): filename = params["filename"].replace("<HOST>", hostname) if not filename.startswith("/"): - filename = var_dir + "/" + filename + filename = cmk.paths.var_dir + "/" + filename dirname = filename.rsplit("/", 1)[0] if not os.path.exists(dirname): try:
7 years, 12 months
1
0
0
0
Cleaned up references to old defaults file
by Lars Michelsen
Module: check_mk Branch: master Commit: cf99e99c1b87477251cc7fa08ccdee2b4f7127df URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cf99e99c1b8747…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 22 08:08:54 2016 +0200 Cleaned up references to old defaults file --- modules/localize.py | 8 ++++---- tests/testlib/pylint_cmk.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/localize.py b/modules/localize.py index 4ae3f1c..690fa9e 100644 --- a/modules/localize.py +++ b/modules/localize.py @@ -246,8 +246,8 @@ def localize_update(lang): # Maybe initialize the file in the local hierarchy with the file in # the default hierarchy if not os.path.exists(po_file) \ - and os.path.exists(locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang, domain)): - file(po_file, 'w').write(file(locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang, domain)).read()) + and os.path.exists(cmk.paths.locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang, domain)): + file(po_file, 'w').write(file(cmk.paths.locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang, domain)).read()) sys.stdout.write('Initialize %s with the file in the default hierarchy\n' % po_file) localize_sniff() @@ -271,8 +271,8 @@ def localize_compile(lang): # Maybe initialize the file in the local hierarchy with the file in # the default hierarchy if not os.path.exists(po_file) \ - and os.path.exists(locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang, domain)): - file(po_file, 'w').write(file(locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang, domain)).read()) + and os.path.exists(cmk.paths.locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang, domain)): + file(po_file, 'w').write(file(cmk.paths.locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang, domain)).read()) sys.stdout.write('Initialize %s with the file in the default hierarchy\n' % po_file) if not os.path.exists(po_file): diff --git a/tests/testlib/pylint_cmk.py b/tests/testlib/pylint_cmk.py index 40e55c2..e9795ea 100644 --- a/tests/testlib/pylint_cmk.py +++ b/tests/testlib/pylint_cmk.py @@ -16,7 +16,6 @@ from testlib import repo_path def ordered_module_files(): ordered_modules = [ - "defaults", "modules/check_mk_base.py", "modules/check_mk.py", "modules/config.py",
7 years, 12 months
1
0
0
0
Changed manpage tests to be executed in OMD site context
by Lars Michelsen
Module: check_mk Branch: master Commit: fcd1ee61c6b4ef0a2b779d30d6ee37f9a4bde349 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fcd1ee61c6b4ef…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Sep 21 16:44:11 2016 +0200 Changed manpage tests to be executed in OMD site context --- check_mk | 7 ------- defaults | 34 ---------------------------------- tests/checkman/test_manpages.py | 20 ++++++++++++++------ 3 files changed, 14 insertions(+), 47 deletions(-) diff --git a/check_mk b/check_mk deleted file mode 100755 index ce29853..0000000 --- a/check_mk +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python -# Small wrapper for being able to start check_mk from git directory - -import sys -sys.path.insert(0, "") - -execfile("modules/check_mk.py") diff --git a/defaults b/defaults deleted file mode 100644 index 05f2fd8..0000000 --- a/defaults +++ /dev/null @@ -1,34 +0,0 @@ -# These defaults are used for running check_mk directly -# from the source directory without installing it. - -default_config_dir = '.' -check_mk_configdir = 'conf.d' -checks_dir = 'checks' -notifications_dir = 'notifications' -inventory_dir = 'inventory' -check_manpages_dir = 'checkman' -agents_dir = 'agents' -modules_dir = 'modules' -locale_dir = 'locale' -var_dir = 'var' -log_dir = 'var/log' -autochecksdir = 'var/autochecks' -precompiled_hostchecks_dir = 'var/precompiled' -counters_directory = 'var/counters' -tcp_cache_dir = 'var/cache' -rrd_path = 'var/rrd' -nagios_command_pipe_path = 'nagios/nagios.cmd' -nagios_conf_dir = '' -nagios_objects_file = 'var/check_mk_objects.cfg' -nagios_user = 'nagios' -web_dir = 'web' -lib_dir = 'livestatus' -python_lib_dir = '/usr/lib/python2.7' -apache_config_dir = '/etc/apache2/conf.d/' -nagios_status_file = '/var/lib/nagios/status.dat' -htpasswd_file = 'webusers' -livestatus_unix_socket = 'nagios/live' -web_dir = 'web' -pnp_templates_dir = 'pnp-templates' -doc_dir = 'checkman' -tmp_dir = 'var/tmp' diff --git a/tests/checkman/test_manpages.py b/tests/checkman/test_manpages.py index 8522abc..1437f73 100644 --- a/tests/checkman/test_manpages.py +++ b/tests/checkman/test_manpages.py @@ -3,6 +3,7 @@ import os import sys +import subprocess from testlib import cmk_path @@ -28,22 +29,29 @@ def _check_manpage(name): assert found_catalog, "Did not find \"catalog:\" header in manpage \"%s\"" % name -def test_manpage_list(): - result = os.popen("cd %s ; ./check_mk --list-man 2>&1" % cmk_path()).read() +def test_manpage_list(site): + p = site.execute(["check_mk", "--list-man"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + result = p.communicate()[0] + + assert p.returncode == 0 assert result != "" - assert not "ERROR" in result, "Manpage list broken \"./check_mk --list-man\": %s\"" % result + assert not "ERROR" in result, "Manpage list broken \"check_mk --list-man\": %s\"" % result assert type(eval(result)) == dict -def test_missing_manpage(): +def test_missing_manpage(site): missing = [] + p = site.execute(["check_mk", "--list-checks"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + result = p.communicate()[0] + assert p.returncode == 0 + checks = 0 - for line in os.popen('cd %s ; ./check_mk --list-checks' % cmk_path()).readlines(): + for line in result.split("\n"): checks += 1 line = line.strip() check_name = line.split(" ", 1)[0] assert '(no man page present)' not in line, "Manpage missing: %s" % check_name if checks == 0: - raise Exception("\"./check_mk --list-checks\" Did not output a checks") + raise Exception("\"check_mk --list-checks\" Did not output a checks")
7 years, 12 months
1
0
0
0
Replaced automatically generated defaults module with cmk.paths
by Lars Michelsen
Module: check_mk Branch: master Commit: c1b0695cd2e5228a7cd7e796c3007f74183d346b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c1b0695cd2e522…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Sep 21 15:49:15 2016 +0200 Replaced automatically generated defaults module with cmk.paths Developer note: The defaults module was created during setup of Check_MK and contained mainly path definitions and other Check_MK installation specific definitions. The file has been replaced by the "cmk.paths" module which is now the central place which serves path informations for Check_MK. If you find any usage of the defaults module, you will have to replace it by that module. You will have to replace the <tt>import defaults</tt> call with <tt>import cmk.paths</tt> and then replace e.g. <tt>defaults.var_dir</tt> with <tt>cmk.paths.var_dir</tt>. Some vars have completely been removed or moved to other places. For example <tt>defaults.check_mk_version</tt> has been renamed to <tt>cmk.__version__</tt>. --- .bugs/2468 | 7 + checks/logwatch | 2 +- doc/treasures/wato_hook_cleanup_folders.py | 10 +- doc/treasures/wato_remove_nonsite_folders.py | 8 +- doc/treasures/wiki_painter.py | 6 +- lib/paths.py | 172 ++++++++++++ make_package_info | 3 - modules/automation.py | 125 ++++----- modules/check_mk.py | 398 +++++++++++---------------- modules/check_mk_base.py | 51 ++-- modules/config.py | 2 +- modules/discovery.py | 21 +- modules/events.py | 5 +- modules/inventory.py | 9 +- modules/localize.py | 23 +- modules/nagios.py | 55 ++-- modules/notify.py | 31 +-- modules/packaging.py | 40 +-- modules/prediction.py | 2 +- modules/snmp.py | 6 +- scripts/setup.sh | 120 +------- tests/lib/test_paths.py | 34 +++ web/.f12 | 1 - web/htdocs/availability.py | 7 +- web/htdocs/backup.py | 1 - web/htdocs/config.py | 45 +-- web/htdocs/crash_reporting.py | 4 +- web/htdocs/cron.py | 4 +- web/htdocs/dashboard.py | 2 +- web/htdocs/guitester.py | 8 +- web/htdocs/html_mod_python.py | 54 ++-- web/htdocs/i18n.py | 23 +- web/htdocs/index.py | 20 +- web/htdocs/inventory.py | 17 +- web/htdocs/key_mgmt.py | 2 +- web/htdocs/lib.py | 67 ++--- web/htdocs/login.py | 31 +-- web/htdocs/logwatch.py | 2 +- web/htdocs/main.py | 4 +- web/htdocs/metrics.py | 2 +- web/htdocs/mkeventd.py | 23 +- web/htdocs/multitar.py | 11 +- web/htdocs/notifications.py | 1 - web/htdocs/prediction.py | 4 +- web/htdocs/sidebar.py | 13 +- web/htdocs/sites.py | 2 - web/htdocs/userdb.py | 33 +-- web/htdocs/valuespec.py | 17 +- web/htdocs/views.py | 10 +- web/htdocs/wato.py | 76 +++-- web/htdocs/watolib.py | 127 +++------ web/htdocs/werks.py | 11 +- web/plugins/dashboard/builtin.py | 60 ++-- web/plugins/sidebar/nagvis_maps.py | 11 +- web/plugins/sidebar/shipped.py | 113 ++++---- web/plugins/userdb/hook_auth.py | 4 +- web/plugins/userdb/htpasswd.py | 9 +- web/plugins/userdb/ldap.py | 13 +- web/plugins/views/painters.py | 52 ++-- web/plugins/visuals/wato.py | 3 +- web/plugins/wato/backup_domains.py | 118 +++----- web/plugins/wato/check_mk_configuration.py | 11 +- web/plugins/wato/globals_notification.py | 4 +- web/plugins/wato/inventory.py | 4 +- web/plugins/wato/mkeventd.py | 45 ++- web/plugins/wato/notifications.py | 4 +- web/plugins/webapi/webapi.py | 6 +- 67 files changed, 1035 insertions(+), 1174 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=c1b0695cd2…
7 years, 12 months
1
0
0
0
3813 FIX check_mail: fixed missing base64 decoding on multipart mails
by Andreas Boesl
Module: check_mk Branch: master Commit: 788b2a0c5648220e52a31e51435813d888584a20 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=788b2a0c564822…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Wed Sep 21 16:11:54 2016 +0200 3813 FIX check_mail: fixed missing base64 decoding on multipart mails --- .werks/3813 | 9 +++++++++ ChangeLog | 1 + doc/treasures/active_checks/check_mail | 1 + 3 files changed, 11 insertions(+) diff --git a/.werks/3813 b/.werks/3813 new file mode 100644 index 0000000..0cba006 --- /dev/null +++ b/.werks/3813 @@ -0,0 +1,9 @@ +Title: check_mail: fixed missing base64 decoding on multipart mails +Level: 1 +Component: checks +Compatible: compat +Version: 1.4.0i1 +Date: 1474467090 +Class: fix + + diff --git a/ChangeLog b/ChangeLog index 3f4d4f6..8b98b42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -402,6 +402,7 @@ * 3808 FIX: df.include: fixed incorrect levels calculations on very small filesystems... * 3810 FIX: windows agent: no longer truncates plugin output, no longer freezes when plugin produces too much output... * 3812 FIX: winperf_phydisk: reintroduced read and write queue length performance data... + * 3813 FIX: check_mail: fixed missing base64 decoding on multipart mails Multisite: * 3187 notification view: new filter for log command via regex diff --git a/doc/treasures/active_checks/check_mail b/doc/treasures/active_checks/check_mail index f4e96c1..8b2fe79 100755 --- a/doc/treasures/active_checks/check_mail +++ b/doc/treasures/active_checks/check_mail @@ -306,6 +306,7 @@ def forward_to_ec(mails): for part in msg.walk(): content_type = part.get_content_type() disposition = str(part.get('Content-Disposition')) + encoding = part.get('Content-Transfer-Encoding', 'None') if content_type == 'text/plain' and 'attachment' not in disposition: payload = part.get_payload() if encoding == "base64":
7 years, 12 months
1
0
0
0
mkeventd: refactored answering of query and supressing broken pipe error message when client closed connection
by Lars Michelsen
Module: check_mk Branch: master Commit: c8b5839beaf2e4c1c621ee5761bb1b6f5a5788d8 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c8b5839beaf2e4…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Sep 21 13:52:33 2016 +0200 mkeventd: refactored answering of query and supressing broken pipe error message when client closed connection --- bin/mkeventd | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/bin/mkeventd b/bin/mkeventd index bee4b63..a76e69b 100755 --- a/bin/mkeventd +++ b/bin/mkeventd @@ -2996,8 +2996,8 @@ class StatusServer: client_socket = None # close without danger of exception - def handle_client(self, socket, allow_commands, client_ip): - for query in Queries(socket): + def handle_client(self, client_socket, allow_commands, client_ip): + for query in Queries(client_socket): verbose("Query: %s" % "\\n".join(query)) parts = query[0].split(None, 1) if len(parts) != 2: @@ -3023,24 +3023,33 @@ class StatusServer: raise MKClientError("Invalid method %s (allowed are GET, COMMAND " "and REPLICATE)" % method) - if output_format == "plain": - for line in response: - socket.sendall("\t".join([to_utf8(quote_tab(c)) for c in line])) - socket.sendall("\n") + try: + self._answer_query(client_socket, output_format, response) + except socket.error, e: + if e.errno == 32: # Broken pipe -> ignore this + pass - elif output_format == "json": - socket.sendall(json.dumps(response)) - socket.sendall("\n") + client_socket.close() - elif output_format == "python": - socket.sendall(repr(response)) - socket.sendall("\n") - else: - raise MKClientError("Invalid output format \"%s\" " - "(allowed are python, json and plain)" % output_format) + def _answer_query(self, client_socket, output_format, response): + if output_format == "plain": + for line in response: + client_socket.sendall("\t".join([to_utf8(quote_tab(c)) for c in line])) + client_socket.sendall("\n") + + elif output_format == "json": + client_socket.sendall(json.dumps(response)) + client_socket.sendall("\n") + + elif output_format == "python": + client_socket.sendall(repr(response)) + client_socket.sendall("\n") + + else: + raise MKClientError("Invalid output format \"%s\" " + "(allowed are python, json and plain)" % output_format) - socket.close() # locked with lock_eventstatus def handle_command_request(self, commandline):
7 years, 12 months
1
0
0
0
updated werk 3877
by Simon Betz
Module: check_mk Branch: master Commit: ba188b5a877259fc15c737fd034c6e86f4772c96 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba188b5a877259…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Wed Sep 21 13:33:42 2016 +0200 updated werk 3877 --- .werks/3877 | 2 +- ChangeLog | 2 +- checkman/ibm_tl_scsi_prot_ctrl | 16 ----- checks/ibm_tl_media_access_devices | 127 ++++++++++++++++++------------------- checks/ibm_tl_scsi_prot_ctrl | 60 ------------------ 5 files changed, 65 insertions(+), 142 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=ba188b5a87…
7 years, 12 months
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
31
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
Results per page:
10
25
50
100
200