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
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
June 2017
----- 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
13 participants
266 discussions
Start a n
N
ew thread
4869 FIX apc_symmetra, apc_symmetra_input, apc_symmetra_output: Fixed wrong WATO rulesets
by Simon Betz
Module: check_mk Branch: master Commit: 4a556bde08db1eb283d6e2af6e1f01b36e934207 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4a556bde08db1e…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Jun 19 16:50:56 2017 +0200 4869 FIX apc_symmetra, apc_symmetra_input, apc_symmetra_output: Fixed wrong WATO rulesets Change-Id: Idabccfdfd7d4acdefacb66147ce550893824866c --- .werks/4869 | 11 +++++++++++ checks/apc_symmetra | 2 +- checks/apc_symmetra_input | 2 +- checks/apc_symmetra_output | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.werks/4869 b/.werks/4869 new file mode 100644 index 0000000..3af3a30 --- /dev/null +++ b/.werks/4869 @@ -0,0 +1,11 @@ +Title: apc_symmetra, apc_symmetra_input, apc_symmetra_output: Fixed wrong WATO rulesets +Level: 1 +Component: checks +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.5.0i1 +Date: 1497883828 + + diff --git a/checks/apc_symmetra b/checks/apc_symmetra index 4a1ef0b..9ebe706 100644 --- a/checks/apc_symmetra +++ b/checks/apc_symmetra @@ -335,6 +335,6 @@ check_info['apc_symmetra.elphase'] = { 'service_description' : "Phase %s", 'has_perfdata' : True, 'default_levels_variable' : 'apc_symmetra_elphase_default_levels', - 'group' : 'elphase', + 'group' : 'ups_outphase', 'includes' : [ 'elphase.include' ], } diff --git a/checks/apc_symmetra_input b/checks/apc_symmetra_input index dd2ae9c..a27b19e 100644 --- a/checks/apc_symmetra_input +++ b/checks/apc_symmetra_input @@ -44,6 +44,6 @@ check_info['apc_symmetra_input'] = { ]), "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.318.1.3"), 'has_perfdata' : True, - 'group' : 'elphase', + 'group' : 'el_inphase', 'includes' : [ 'elphase.include' ], } diff --git a/checks/apc_symmetra_output b/checks/apc_symmetra_output index 05a3e41..9e94d93 100644 --- a/checks/apc_symmetra_output +++ b/checks/apc_symmetra_output @@ -59,6 +59,6 @@ check_info['apc_symmetra_output'] = { "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.318.1.3"), 'has_perfdata' : True, 'default_levels_variable' : 'apc_symmetra_output_default_levels', - 'group' : 'elphase', + 'group' : 'ups_outphase', 'includes' : [ 'elphase.include' ], }
7 years
1
0
0
0
4833 FIX Windows Agent: Fixed pipe handle leak whenever plugin/
by Andreas Boesl
mrpe scripts raised an error Message-ID: <5947cd76.6z8aW3ZDZpsgsLjL%ab(a)mathias-kettner.de> User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Module: check_mk Branch: master Commit: 7945c19a03a79a6d7887c3aad8437f9bef0d1f8c URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7945c19a03a79a…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Mon Jun 19 14:44:15 2017 +0200 4833 FIX Windows Agent: Fixed pipe handle leak whenever plugin/mrpe scripts raised an error Change-Id: I28275c83b153aeef9e355123238388d880c9a088 --- .werks/4833 | 10 +++++++++ agents/windows/ExternalCmd.cc | 27 +++++++++-------------- agents/windows/ExternalCmd.h | 9 ++++---- agents/windows/build_version | 2 +- agents/windows/check_mk_agent-64.exe | Bin 1339392 -> 1339392 bytes agents/windows/check_mk_agent-64.unstripped.exe | Bin 15811578 -> 15811521 bytes agents/windows/check_mk_agent-64.unversioned.exe | Bin 1339392 -> 1339392 bytes agents/windows/check_mk_agent.exe | Bin 1316864 -> 1316864 bytes agents/windows/check_mk_agent.msi | Bin 2926080 -> 2926080 bytes agents/windows/check_mk_agent.unstripped.exe | Bin 13671970 -> 13670888 bytes agents/windows/check_mk_agent.unversioned.exe | Bin 1316864 -> 1316864 bytes agents/windows/crash.exe | Bin 101624 -> 101624 bytes agents/windows/install_agent-64.exe | Bin 591609 -> 591635 bytes agents/windows/install_agent.exe | Bin 589028 -> 589053 bytes agents/windows/nowin.exe | Bin 103760 -> 103760 bytes agents/windows/plugins/mk_logwatch.exe | Bin 4555443 -> 4563981 bytes agents/windows/sections/SectionMRPE.cc | 1 - agents/windows/sections/SectionPluginGroup.cc | 2 -- agents/windows/types.h | 1 + 19 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.werks/4833 b/.werks/4833 new file mode 100644 index 0000000..3adf166 --- /dev/null +++ b/.werks/4833 @@ -0,0 +1,10 @@ +Title: Windows Agent: Fixed pipe handle leak whenever plugin/mrpe scripts raised an error +Level: 1 +Component: checks +Compatible: compat +Edition: cre +Version: 1.5.0i1 +Date: 1497876183 +Class: fix + + diff --git a/agents/windows/ExternalCmd.cc b/agents/windows/ExternalCmd.cc index 8287536..cbc4663 100644 --- a/agents/windows/ExternalCmd.cc +++ b/agents/windows/ExternalCmd.cc @@ -48,12 +48,13 @@ ExternalCmd::ExternalCmd(const char *cmdline) { // child process needs to be able to inherit the pipe handles security_attributes.bInheritHandle = true; - if (!CreatePipe(&_stdout, &_script_stdout, &security_attributes, 0)) { + if (!CreatePipe(_stdout.ptr(), _script_stdout.ptr(), &security_attributes, 0)) { throw win_exception("failed to create pipe"); } + if (with_stderr) { - if (!CreatePipe(&_stderr, &_script_stderr, &security_attributes, 0)) { + if (!CreatePipe(_stderr.ptr(), _script_stderr.ptr(), &security_attributes, 0)) { throw win_exception("failed to create pipe"); } } @@ -65,8 +66,8 @@ ExternalCmd::ExternalCmd(const char *cmdline) { GetStartupInfo(&si); si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; - si.hStdOutput = _script_stdout; - si.hStdError = with_stderr ? _script_stdout : _script_stderr; + si.hStdOutput = (HANDLE)_script_stdout; + si.hStdError = with_stderr ? (HANDLE)_script_stdout : (HANDLE)_script_stderr; PROCESS_INFORMATION pi; ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); @@ -74,7 +75,7 @@ ExternalCmd::ExternalCmd(const char *cmdline) { free); if (!CreateProcess(nullptr, cmdline_buf.get(), nullptr, nullptr, TRUE, CREATE_NEW_CONSOLE, nullptr, nullptr, &si, &pi)) { - throw win_exception(std::string("failed to spawn process ") + cmdline); + throw win_exception(std::string("failed to spawn process ") + cmdline); } _process = pi.hProcess; @@ -88,8 +89,6 @@ ExternalCmd::ExternalCmd(const char *cmdline) { } ExternalCmd::~ExternalCmd() { - ::CloseHandle(_stdout); - ::CloseHandle(_stderr); if (_job_object != INVALID_HANDLE_VALUE) { ::TerminateJobObject(_job_object, 1); ::CloseHandle(_job_object); @@ -97,17 +96,13 @@ ExternalCmd::~ExternalCmd() { ::CloseHandle(_process); } + void ExternalCmd::terminateJob(DWORD exit_code) { ::TerminateJobObject(_job_object, exit_code); ::CloseHandle(_job_object); _job_object = INVALID_HANDLE_VALUE; } -void ExternalCmd::closeScriptHandles() { - ::CloseHandle(_script_stderr); - ::CloseHandle(_script_stdout); -} - DWORD ExternalCmd::exitCode() { DWORD res; GetExitCodeProcess(_process, &res); @@ -116,23 +111,23 @@ DWORD ExternalCmd::exitCode() { DWORD ExternalCmd::stdoutAvailable() { DWORD available; - PeekNamedPipe(_stdout, nullptr, 0, nullptr, &available, nullptr); + PeekNamedPipe((HANDLE)_stdout, nullptr, 0, nullptr, &available, nullptr); return available; } DWORD ExternalCmd::stderrAvailable() { DWORD available; - PeekNamedPipe(_stderr, nullptr, 0, nullptr, &available, nullptr); + PeekNamedPipe((HANDLE)_stderr, nullptr, 0, nullptr, &available, nullptr); return available; } DWORD ExternalCmd::readStdout(char *buffer, size_t buffer_size, bool block) { - return readPipe(_stdout, buffer, buffer_size, block); + return readPipe((HANDLE)_stdout, buffer, buffer_size, block); } DWORD ExternalCmd::readStderr(char *buffer, size_t buffer_size, bool block) { if (!with_stderr) { - return readPipe(_stderr, buffer, buffer_size, block); + return readPipe((HANDLE)_stderr, buffer, buffer_size, block); } else { return 0; } diff --git a/agents/windows/ExternalCmd.h b/agents/windows/ExternalCmd.h index 89939c3..6593022 100644 --- a/agents/windows/ExternalCmd.h +++ b/agents/windows/ExternalCmd.h @@ -26,6 +26,7 @@ #define ExternalCmd_h #include <windows.h> +#include "types.h" class ExternalCmd { public: @@ -51,12 +52,12 @@ private: DWORD readPipe(HANDLE pipe, char *buffer, size_t buffer_size, bool block); private: - HANDLE _script_stderr{INVALID_HANDLE_VALUE}; - HANDLE _script_stdout{INVALID_HANDLE_VALUE}; + WinHandle _script_stderr{INVALID_HANDLE_VALUE}; + WinHandle _script_stdout{INVALID_HANDLE_VALUE}; HANDLE _process{INVALID_HANDLE_VALUE}; HANDLE _job_object{INVALID_HANDLE_VALUE}; - HANDLE _stdout{INVALID_HANDLE_VALUE}; - HANDLE _stderr{INVALID_HANDLE_VALUE}; + WinHandle _stdout{INVALID_HANDLE_VALUE}; + WinHandle _stderr{INVALID_HANDLE_VALUE}; }; #endif // ExternalCmd_h diff --git a/agents/windows/build_version b/agents/windows/build_version index 4633262..dc1d7d0 100644 --- a/agents/windows/build_version +++ b/agents/windows/build_version @@ -1 +1 @@ -2663 +2711 diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe index d3a9573..fcff221 100755 Binary files a/agents/windows/check_mk_agent-64.exe and b/agents/windows/check_mk_agent-64.exe differ diff --git a/agents/windows/check_mk_agent-64.unstripped.exe b/agents/windows/check_mk_agent-64.unstripped.exe index 0891779..95096dd 100755 Binary files a/agents/windows/check_mk_agent-64.unstripped.exe and b/agents/windows/check_mk_agent-64.unstripped.exe differ diff --git a/agents/windows/check_mk_agent-64.unversioned.exe b/agents/windows/check_mk_agent-64.unversioned.exe index 0a9551c..86953d6 100755 Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and b/agents/windows/check_mk_agent-64.unversioned.exe differ diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe index 1f699ac..2b15763 100755 Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe differ diff --git a/agents/windows/check_mk_agent.msi b/agents/windows/check_mk_agent.msi index a7a3f27..398eabf 100755 Binary files a/agents/windows/check_mk_agent.msi and b/agents/windows/check_mk_agent.msi differ diff --git a/agents/windows/check_mk_agent.unstripped.exe b/agents/windows/check_mk_agent.unstripped.exe index b0da6dc..69c4e60 100755 Binary files a/agents/windows/check_mk_agent.unstripped.exe and b/agents/windows/check_mk_agent.unstripped.exe differ diff --git a/agents/windows/check_mk_agent.unversioned.exe b/agents/windows/check_mk_agent.unversioned.exe index 10251ff..235143b 100755 Binary files a/agents/windows/check_mk_agent.unversioned.exe and b/agents/windows/check_mk_agent.unversioned.exe differ diff --git a/agents/windows/crash.exe b/agents/windows/crash.exe index c40e5e5..7a9e64a 100755 Binary files a/agents/windows/crash.exe and b/agents/windows/crash.exe differ diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe index 41eb2d7..8f55da0 100755 Binary files a/agents/windows/install_agent-64.exe and b/agents/windows/install_agent-64.exe differ diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe index 030b11e..1be05ce 100755 Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe differ diff --git a/agents/windows/nowin.exe b/agents/windows/nowin.exe index 7d41981..856afb5 100755 Binary files a/agents/windows/nowin.exe and b/agents/windows/nowin.exe differ diff --git a/agents/windows/plugins/mk_logwatch.exe b/agents/windows/plugins/mk_logwatch.exe index 3407f7b..3acbda1 100755 Binary files a/agents/windows/plugins/mk_logwatch.exe and b/agents/windows/plugins/mk_logwatch.exe differ diff --git a/agents/windows/sections/SectionMRPE.cc b/agents/windows/sections/SectionMRPE.cc index 6db231a..f05b87c 100644 --- a/agents/windows/sections/SectionMRPE.cc +++ b/agents/windows/sections/SectionMRPE.cc @@ -163,7 +163,6 @@ bool SectionMRPE::produceOutputInner(std::ostream &out, int nagios_code = command.exitCode(); out << nagios_code << " " << plugin_output << "\n"; crash_log("Script finished"); - command.closeScriptHandles(); } catch (const std::exception &e) { crash_log("mrpe failed: %s", e.what()); out << "3 Unable to execute - plugin may be missing.\n"; diff --git a/agents/windows/sections/SectionPluginGroup.cc b/agents/windows/sections/SectionPluginGroup.cc index 4166f4b..30e52a4 100644 --- a/agents/windows/sections/SectionPluginGroup.cc +++ b/agents/windows/sections/SectionPluginGroup.cc @@ -145,8 +145,6 @@ static int launch_program(script_container *cont) { (char *)HeapAlloc(GetProcessHeap(), 0, buffer_u8.size() + 1); memcpy(cont->buffer_work, buffer_u8.c_str(), buffer_u8.size() + 1); } - - command.closeScriptHandles(); } catch (const std::exception &e) { crash_log("%s", e.what()); result = CANCELED; diff --git a/agents/windows/types.h b/agents/windows/types.h index 084f69a..5386bcd 100644 --- a/agents/windows/types.h +++ b/agents/windows/types.h @@ -359,6 +359,7 @@ public: // wrapper for windows handles that automatically closes the // handle on leaving scope +// FIXME: duplicate of ManagedHandle? class WinHandle { public: WinHandle(HANDLE hdl = INVALID_HANDLE_VALUE) : _handle(hdl) {}
7 years
1
0
0
0
picked WK4708 from 1.4.0
by Andreas Boesl
Module: check_mk Branch: master Commit: 372c6adeab9d67ba3e17ca67a481f6f7bafe41f0 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=372c6adeab9d67…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Mon Jun 19 14:52:54 2017 +0200 picked WK4708 from 1.4.0 Change-Id: Id56a6f3d41503266983d67539e8ce1120270366f --- .werks/4708 | 16 ++++++++++++++ agents/windows/ExternalCmd.cc | 27 +++++++++++++++++++---- agents/windows/build_version | 2 +- agents/windows/check_mk_agent-64.exe | Bin 1339392 -> 1339904 bytes agents/windows/check_mk_agent-64.unstripped.exe | Bin 15811521 -> 15823277 bytes agents/windows/check_mk_agent-64.unversioned.exe | Bin 1339392 -> 1339904 bytes agents/windows/check_mk_agent.exe | Bin 1316864 -> 1317888 bytes agents/windows/check_mk_agent.msi | Bin 2926080 -> 2927616 bytes agents/windows/check_mk_agent.unstripped.exe | Bin 13670888 -> 13681693 bytes agents/windows/check_mk_agent.unversioned.exe | Bin 1316864 -> 1317888 bytes agents/windows/install_agent-64.exe | Bin 591635 -> 591860 bytes agents/windows/install_agent.exe | Bin 589053 -> 589484 bytes 12 files changed, 40 insertions(+), 5 deletions(-) diff --git a/.werks/4708 b/.werks/4708 new file mode 100644 index 0000000..fb0e153 --- /dev/null +++ b/.werks/4708 @@ -0,0 +1,16 @@ +Title: Windows Agent/Agent Updater: Fixed race condition which removed the windows service +Level: 2 +Component: checks +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.5.0i1 +Date: 1496847511 + +The agent updater could kill itself during an update, because the MSI installation process +sent a shutdown signal to the windows service. This shutdown also killed any plugins, +including the agent updater... This has been fixed by detaching the cmk-update-agent.exe +file from the process group of the windows agent. + + diff --git a/agents/windows/ExternalCmd.cc b/agents/windows/ExternalCmd.cc index cbc4663..3d12242 100644 --- a/agents/windows/ExternalCmd.cc +++ b/agents/windows/ExternalCmd.cc @@ -31,6 +31,14 @@ extern bool with_stderr; extern HANDLE g_workers_job_object; + +bool ends_with(std::string const & value, std::string const & ending) +{ + if (ending.size() > value.size()) return false; + return std::equal(ending.rbegin(), ending.rend(), value.rbegin()); +} + + ExternalCmd::ExternalCmd(const char *cmdline) { SECURITY_DESCRIPTOR security_descriptor; SECURITY_ATTRIBUTES security_attributes; @@ -73,9 +81,18 @@ ExternalCmd::ExternalCmd(const char *cmdline) { ZeroMemory(&pi, sizeof(PROCESS_INFORMATION)); std::unique_ptr<char[], decltype(free) *> cmdline_buf(strdup(cmdline), free); + + bool detach_process = ends_with(std::string(cmdline), std::string("cmk-update-agent.exe\"")); + + DWORD dwCreationFlags = CREATE_NEW_CONSOLE; + if (detach_process) { + crash_log("Detaching process: %s, %d", cmdline, detach_process); + dwCreationFlags = CREATE_NEW_PROCESS_GROUP | DETACHED_PROCESS; + } + if (!CreateProcess(nullptr, cmdline_buf.get(), nullptr, nullptr, TRUE, - CREATE_NEW_CONSOLE, nullptr, nullptr, &si, &pi)) { - throw win_exception(std::string("failed to spawn process ") + cmdline); + dwCreationFlags, nullptr, nullptr, &si, &pi)) { + throw win_exception(std::string("failed to spawn process ") + cmdline); } _process = pi.hProcess; @@ -84,8 +101,10 @@ ExternalCmd::ExternalCmd(const char *cmdline) { // Create a job object for this process // Whenever the process ends all of its childs will terminate, too _job_object = CreateJobObject(nullptr, nullptr); - AssignProcessToJobObject(_job_object, pi.hProcess); - AssignProcessToJobObject(g_workers_job_object, pi.hProcess); + if (!detach_process) { + AssignProcessToJobObject(_job_object, pi.hProcess); + AssignProcessToJobObject(g_workers_job_object, pi.hProcess); + } } ExternalCmd::~ExternalCmd() { diff --git a/agents/windows/build_version b/agents/windows/build_version index dc1d7d0..c98e88a 100644 --- a/agents/windows/build_version +++ b/agents/windows/build_version @@ -1 +1 @@ -2711 +2713 diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe index fcff221..a1750d6 100755 Binary files a/agents/windows/check_mk_agent-64.exe and b/agents/windows/check_mk_agent-64.exe differ diff --git a/agents/windows/check_mk_agent-64.unstripped.exe b/agents/windows/check_mk_agent-64.unstripped.exe index 95096dd..d0c42ee 100755 Binary files a/agents/windows/check_mk_agent-64.unstripped.exe and b/agents/windows/check_mk_agent-64.unstripped.exe differ diff --git a/agents/windows/check_mk_agent-64.unversioned.exe b/agents/windows/check_mk_agent-64.unversioned.exe index 86953d6..32229f9 100755 Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and b/agents/windows/check_mk_agent-64.unversioned.exe differ diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe index 2b15763..5b0c4de 100755 Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe differ diff --git a/agents/windows/check_mk_agent.msi b/agents/windows/check_mk_agent.msi index 398eabf..b4de316 100755 Binary files a/agents/windows/check_mk_agent.msi and b/agents/windows/check_mk_agent.msi differ diff --git a/agents/windows/check_mk_agent.unstripped.exe b/agents/windows/check_mk_agent.unstripped.exe index 69c4e60..0b43306 100755 Binary files a/agents/windows/check_mk_agent.unstripped.exe and b/agents/windows/check_mk_agent.unstripped.exe differ diff --git a/agents/windows/check_mk_agent.unversioned.exe b/agents/windows/check_mk_agent.unversioned.exe index 235143b..e77dcc3 100755 Binary files a/agents/windows/check_mk_agent.unversioned.exe and b/agents/windows/check_mk_agent.unversioned.exe differ diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe index 8f55da0..4210301 100755 Binary files a/agents/windows/install_agent-64.exe and b/agents/windows/install_agent-64.exe differ diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe index 1be05ce..867cf5d 100755 Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe differ
7 years
1
0
0
0
4762 FIX Showing correctly formated plugin output in " analyse notifications table"
by Lars Michelsen
Module: check_mk Branch: master Commit: 0138a75a6dfaf3de207a6fb8e95fc0abd0068660 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0138a75a6dfaf3…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Jun 19 11:07:23 2017 +0200 4762 FIX Showing correctly formated plugin output in "analyse notifications table" The plugin output shown in the "analyse notification table" was not being formatted correctly (e.g. state markers were not converted and HTML links were not rendered). Change-Id: If0c62e13d2e5ef44f2b526443af9c5f8dbb7eef1 --- .werks/4762 | 12 ++++++++++++ web/htdocs/wato.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.werks/4762 b/.werks/4762 new file mode 100644 index 0000000..f994344 --- /dev/null +++ b/.werks/4762 @@ -0,0 +1,12 @@ +Title: Showing correctly formated plugin output in "analyse notifications table" +Level: 1 +Component: notifications +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.5.0i1 +Date: 1497863188 + +The plugin output shown in the "analyse notification table" was not being formatted +correctly (e.g. state markers were not converted and HTML links were not rendered). diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 1321f77..4c8e4d1 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -8407,7 +8407,7 @@ def mode_notifications(phase): table.cell(_("Host"), context.get("HOSTNAME", "")) table.cell(_("Service"), context.get("SERVICEDESC", "")) output = context.get("SERVICEOUTPUT", context.get("HOSTOUTPUT")) - table.cell(_("Plugin output"), output) + table.cell(_("Plugin output"), format_plugin_output(output)) table.end() # Do analysis
7 years
1
0
0
0
4763 FIX HTML mails: Fixed wrong rendered state markers in plugin outputs
by Lars Michelsen
Module: check_mk Branch: master Commit: 68379e70986825851def812dcd051ccbba478b3e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=68379e70986825…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Jun 19 13:59:20 2017 +0200 4763 FIX HTML mails: Fixed wrong rendered state markers in plugin outputs The plugin output of hosts/services can contain state markers like "(!!)" which were not rendered colored like in the Web GUI. Change-Id: Iafb85c32bdae7fe5bbe2e484095cc4ca9d622105 --- .werks/4763 | 12 ++++++++++++ modules/events.py | 23 ++++++++++++++++++++++ notifications/mail | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++--- web/htdocs/lib.py | 3 +++ 4 files changed, 91 insertions(+), 3 deletions(-) diff --git a/.werks/4763 b/.werks/4763 new file mode 100644 index 0000000..1160a85 --- /dev/null +++ b/.werks/4763 @@ -0,0 +1,12 @@ +Title: HTML mails: Fixed wrong rendered state markers in plugin outputs +Level: 1 +Component: notifications +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.5.0i1 +Date: 1497873346 + +The plugin output of hosts/services can contain state markers like "(!!)" +which were not rendered colored like in the Web GUI. diff --git a/modules/events.py b/modules/events.py index 3aa9832..3d21fa9 100644 --- a/modules/events.py +++ b/modules/events.py @@ -336,6 +336,12 @@ def complete_raw_context(raw_context, with_dump, event_log): raw_context['SERVICEFORURL'] = urllib.quote(raw_context['SERVICEDESC']) raw_context['HOSTFORURL'] = urllib.quote(raw_context['HOSTNAME']) + # Add HTML formated plugin output + raw_context["HOSTOUTPUT_HTML"] = format_plugin_output(raw_context["HOSTOUTPUT"]) + if raw_context["WHAT"] == "SERVICE": + raw_context["SERVICEOUTPUT_HTML"] = format_plugin_output(raw_context["SERVICEOUTPUT"]) + raw_context["LONGSERVICEOUTPUT_HTML"] = format_plugin_output(raw_context["LONGSERVICEOUTPUT"]) + convert_context_to_unicode(raw_context) except Exception, e: @@ -347,6 +353,23 @@ def complete_raw_context(raw_context, with_dump, event_log): +# There is common code with web/htdocs/lib.py:format_plugin_output(). Please check +# whether or not that function needs to be changed too +# TODO(lm): Find a common place to unify this functionality. +def format_plugin_output(output): + ok_marker = '<b class="stmarkOK">OK</b>' + warn_marker = '<b class="stmarkWARNING">WARN</b>' + crit_marker = '<b class="stmarkCRITICAL">CRIT</b>' + unknown_marker = '<b class="stmarkUNKNOWN">UNKN</b>' + + output = output.replace("(!)", warn_marker) \ + .replace("(!!)", crit_marker) \ + .replace("(?)", unknown_marker) \ + .replace("(.)", ok_marker) + + return output + + def event_match_rule(rule, context): return \ event_match_site(rule, context) or \ diff --git a/notifications/mail b/notifications/mail index 532d959..c5e4fa0 100755 --- a/notifications/mail +++ b/notifications/mail @@ -199,6 +199,54 @@ tr.even3 { background-color: #ffefaf; } background-color: #00aaff; color: #ffffff; } +b.stmarkOK { + margin-left: 2px; + padding: 1px 3px; + border-radius: 4px; + font-size: 7pt; + border: 1px solid #666; + position: relative; + top: -1px; + + background-color: #0b3; color: #ffffff; +} + +b.stmarkWARNING { + margin-left: 2px; + padding: 1px 3px; + border-radius: 4px; + font-size: 7pt; + border: 1px solid #666; + position: relative; + top: -1px; + + background-color: #ffff00; color: #000000; +} + +b.stmarkCRITICAL { + margin-left: 2px; + padding: 1px 3px; + border-radius: 4px; + font-size: 7pt; + border: 1px solid #666; + position: relative; + top: -1px; + + background-color: #ff0000; color: #ffffff; +} + +b.stmarkUNKNOWN { + margin-left: 2px; + padding: 1px 3px; + border-radius: 4px; + font-size: 7pt; + border: 1px solid #666; + position: relative; + top: -1px; + + background-color: #ff8800; color: #ffffff; +} + td.graphs { width: 617px; padding: 10px; @@ -275,7 +323,7 @@ body_elements = [ ( "output", "host", True, "normal", "Plugin Output", "$HOSTOUTPUT$", - "$HOSTOUTPUT$",), + "$HOSTOUTPUT_HTML$",), ( "ack_author", "host", False, "normal", "Acknowledge Author", "$HOSTACKAUTHORNAME$", @@ -296,11 +344,11 @@ body_elements = [ ( "output", "service", True, "normal", "Plugin Output", "$SERVICEOUTPUT$", - "$SERVICEOUTPUT$",), + "$SERVICEOUTPUT_HTML$",), ( "longoutput", "service", False, "normal", "Additional Output", "$LONGSERVICEOUTPUT$", - "$LONGSERVICEOUTPUT$",), + "$LONGSERVICEOUTPUT_HTML$",), ( "ack_author", "service", False, "normal", "Acknowledge Author", "$SERVICEACKAUTHOR$", @@ -846,8 +894,10 @@ def render_elements(context, elements): for name, whence, forced, nottype, title, txt, html in body_elements: if nottype == "alerthandler" and not is_alert_handler: continue + if nottype not in ( "alerthandler", "all" ) and is_alert_handler: continue + if (whence == "both" or whence == what) and \ (forced or (name in elements)): tmpl_txt += "%-20s %s\n" % (title + ":", txt) diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py index 2dd0f55..6c84b40 100644 --- a/web/htdocs/lib.py +++ b/web/htdocs/lib.py @@ -258,6 +258,9 @@ def paint_host_list(site, hosts): h += "<a href=\"%s\">%s</a></div>" % (link, host) return "", h +# There is common code with modules/events.py:format_plugin_output(). Please check +# whether or not that function needs to be changed too +# TODO(lm): Find a common place to unify this functionality. def format_plugin_output(output, row = None): import config if config.escape_plugin_output:
7 years
1
0
0
0
4692 FIX Correctly handle deactivated event console when Nagios core is used.
by Sven Panne
Module: check_mk Branch: master Commit: b5ecd2f5d7e962c1568a7f557c98ed2b22939649 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b5ecd2f5d7e962…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Mon Jun 19 12:06:07 2017 +0200 4692 FIX Correctly handle deactivated event console when Nagios core is used. This fix avoids log entries and exceptions of the form: "[mkeventd at /omd/sites/stable/tmp/run/mkeventd/status] cannot connect: No such file or directory" Change-Id: I090fe902288fa47d64870237870ed55701032f8f --- .werks/4692 | 13 +++++++++++++ livestatus/src/module.cc | 8 ++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.werks/4692 b/.werks/4692 new file mode 100644 index 0000000..19d0080 --- /dev/null +++ b/.werks/4692 @@ -0,0 +1,13 @@ +Title: Correctly handle deactivated event console when Nagios core is used. +Level: 1 +Component: livestatus +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.5.0i1 +Date: 1497866624 + +This fix avoids log entries and exceptions of the form: + + "[mkeventd at /omd/sites/stable/tmp/run/mkeventd/status] cannot connect: No such file or directory" diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc index 2e1f030..c01095f 100644 --- a/livestatus/src/module.cc +++ b/livestatus/src/module.cc @@ -642,8 +642,12 @@ public: return comments_for_object(toImpl(service)->host_ptr, toImpl(service)); } - // TODO(sp) Do we need a separate NEB argument for this? - bool mkeventdEnabled() override { return true; } + bool mkeventdEnabled() override { + if (const char *config_mkeventd = getenv("CONFIG_MKEVENTD")) { + return config_mkeventd == string("on"); + } + return false; + } string mkeventdSocketPath() override { return fl_mkeventd_socket_path; } string mkLogwatchPath() override { return fl_mk_logwatch_path; }
7 years
1
0
0
0
Fixed undefined function in show_breadcrump
by Simon Betz
Module: check_mk Branch: master Commit: b92c2e73bcb62044d59a39f066aa61d554be6875 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b92c2e73bcb620…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Jun 19 10:40:27 2017 +0200 Fixed undefined function in show_breadcrump Change-Id: I29d5fb0040571b649164ebaeb316b6c43e495c09 --- web/htdocs/watolib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py index fdae57b..ccc3b31 100644 --- a/web/htdocs/watolib.py +++ b/web/htdocs/watolib.py @@ -710,8 +710,8 @@ class BaseFolder(WithPermissionsAndAttributes): breadcrump_element_start(z_index = 100 + num) html.open_div(class_=["content"]) html.open_form(name="folderpath", method="GET") - html.sorted_dropdown("folder", [ ("", "") ] + self.subfolder_choices(), - class_="folderpath", onchange = "folderpath.submit();") + html.dropdown("folder", [ ("", "") ] + self.subfolder_choices(), + class_="folderpath", onchange = "folderpath.submit();") if keepvarnames == True: html.hidden_fields() else:
7 years
1
0
0
0
4783 User notifications can now temporarily disabled wihtin configured timerange
by Simon Betz
Module: check_mk Branch: master Commit: 012c87332446c9a8102111c68598ddb59402f757 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=012c87332446c9…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Jun 12 11:04:29 2017 +0200 4783 User notifications can now temporarily disabled wihtin configured timerange Change-Id: I13dc3ba4fe735e1df151030f45df5a2d70234235 --- .werks/4783 | 12 ++++++++++ modules/notify.py | 44 ++++++++++++++++++++++++++++++----- web/htdocs/default_permissions.py | 2 +- web/htdocs/wato.py | 8 ++++++- web/plugins/userdb/user_attributes.py | 24 +++++++++++++++---- 5 files changed, 77 insertions(+), 13 deletions(-) diff --git a/.werks/4783 b/.werks/4783 new file mode 100644 index 0000000..5fe2dcc --- /dev/null +++ b/.werks/4783 @@ -0,0 +1,12 @@ +Title: User notifications can now temporarily disabled within configured timerange +Level: 1 +Component: notifications +Compatible: compat +Edition: cre +Version: 1.5.0i1 +Date: 1497258136 +Class: feature + +So far users could disable notifications "forever" within their user profile. +Now they have additionaly the possibility to customize a timerange where +notifications are disabled. diff --git a/modules/notify.py b/modules/notify.py index 2157a08..57380eb 100644 --- a/modules/notify.py +++ b/modules/notify.py @@ -117,6 +117,24 @@ $LONGSERVICEOUTPUT$ """ #. +# .--helper--------------------------------------------------------------. +# | _ _ | +# | | |__ ___| |_ __ ___ _ __ | +# | | '_ \ / _ \ | '_ \ / _ \ '__| | +# | | | | | __/ | |_) | __/ | | +# | |_| |_|\___|_| .__/ \___|_| | +# | |_| | +# '----------------------------------------------------------------------' + + +def _transform_user_disable_notifications_opts(contact): + if "disable_notifications" in contact and type(contact["disable_notifications"]) == bool: + return {"disable" : contact["disable_notifications"]} + else: + return contact.get("disable_notifications", {}) + + +#. # .--Main----------------------------------------------------------------. # | __ __ _ | # | | \/ | __ _(_)_ __ | @@ -291,9 +309,16 @@ def locally_deliver_raw_context(raw_context, analyse=False): # flexible notifications even if they are enabled. contact = contacts.get(contactname) - if contact.get("disable_notifications", False): - notify_log("Notifications for %s are disabled in personal settings. Skipping." % contactname) - return + disable_notifications_opts = _transform_user_disable_notifications_opts(contact) + if disable_notifications_opts.get("disable", False): + start, end = disable_notifications_opts.get("timerange", (None, None)) + if start is None or end is None: + notify_log("Notifications for %s are disabled in personal settings. Skipping." % contactname) + return + elif start <= time.time() <= end: + notify_log("Notifications for %s are disabled in personal settings from %s to %s. Skipping." % \ + (contactname, start, end)) + return # Get notification settings for the contact in question - if available. if contact: @@ -691,9 +716,16 @@ def rbn_rule_contacts(rule, context): contact = contacts.get(contactname) if contact: - if contact.get("disable_notifications", False): - notify_log(" - skipping contact %s: he/she has disabled notifications" % contactname) - continue + disable_notifications_opts = _transform_user_disable_notifications_opts(contact) + if disable_notifications_opts.get("disable", False): + start, end = disable_notifications_opts.get("timerange", (None, None)) + if start is None or end is None: + notify_log(" - skipping contact %s: he/she has disabled notifications" % contactname) + continue + elif start <= time.time() <= end: + notify_log(" - skipping contact %s: he/she has disabled notifications from %s to %s." % \ + (contactname, start, end)) + continue reason = rbn_match_contact_macros(rule, contactname, contact) or \ rbn_match_contact_groups(rule, contactname, contact) diff --git a/web/htdocs/default_permissions.py b/web/htdocs/default_permissions.py index eeec1d7..4fe4b53 100644 --- a/web/htdocs/default_permissions.py +++ b/web/htdocs/default_permissions.py @@ -107,7 +107,7 @@ def load_plugins(force): config.declare_permission('general.disable_notifications', _('Disable all personal notifications'), - _('This permissions provides a checkbox in the personal settings of the user that ' + _('This permissions provides a checkbox and timerange in the personal settings of the user that ' 'allows him to completely disable all of his notifications. Use with caution.'), [ 'admin', ] ) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index a7b7333..1321f77 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -10331,7 +10331,13 @@ def mode_users(phase): locked = user.get("locked", False) if user.get("locked", False): html.icon(_('The login is currently locked'), 'user_locked') - if user.get("disable_notifications", False): + + if "disable_notifications" in user and type(user["disable_notifications"]) == bool: + disable_notifications_opts = {"disable" : user["disable_notifications"]} + else: + disable_notifications_opts = user.get("disable_notifications", {}) + + if disable_notifications_opts.get("disable", False): html.icon(_('Notifications are disabled'), 'notif_disabled') # Full name / Alias diff --git a/web/plugins/userdb/user_attributes.py b/web/plugins/userdb/user_attributes.py index 9d8cc28..da46cd9 100644 --- a/web/plugins/userdb/user_attributes.py +++ b/web/plugins/userdb/user_attributes.py @@ -52,16 +52,30 @@ declare_user_attribute( ) +def transform_disable_notification(p): + if type(p) is not dict: + return {"disable": True} + else: + return p + + declare_user_attribute( "disable_notifications", - Checkbox( - title = _("Disable Notifications"), - label = _("Temporarily disable <b>all</b> notifications!"), + Transform(Dictionary( + title=_("Disable Notifications"), help = _("When this option is active the you will not get <b>any</b> " "alerts or other notifications via email, SMS or similar. " "This overrides all other notification settings or rules, so make " - "sure that you know what you do."), - ), + "sure that you know what you do. Moreover you can customize a timerange " + "within no notifications are generated."), + elements = [ + ("disable", Checkbox(title=_("Temporarily disable <b>all</b> notifications!"), label=_("Disable"))), + ("timerange", Tuple(title=_("Customize timerange"), elements = [ + AbsoluteDate(title=_("From:"), include_time=True), + AbsoluteDate(title=_("To:"), include_time=True), + ])) + ], + ), forth = transform_disable_notification), permission = "general.disable_notifications", domain = "check_mk", )
7 years
1
0
0
0
4832 FIX Quicksearch: Malformed regular expressions generated no error message when no specific filters were set
by Andreas Boesl
Module: check_mk Branch: master Commit: 1590986d32c982aa80f9b29be6d56205cef7205e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1590986d32c982…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Mon Jun 19 09:16:53 2017 +0200 4832 FIX Quicksearch: Malformed regular expressions generated no error message when no specific filters were set Change-Id: I8da36798fe5983a94da57cfc18ed1f9caf55d6c3 --- .werks/4832 | 11 +++++++++++ web/htdocs/sidebar.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.werks/4832 b/.werks/4832 new file mode 100644 index 0000000..f8bf8c6 --- /dev/null +++ b/.werks/4832 @@ -0,0 +1,11 @@ +Title: Quicksearch: Malformed regular expressions generated no error message when no specific filters were set +Level: 1 +Component: multisite +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.5.0i1 +Date: 1497856541 + + diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py index 91eb971..d5351a9 100644 --- a/web/htdocs/sidebar.py +++ b/web/htdocs/sidebar.py @@ -1080,7 +1080,7 @@ class LivestatusQuicksearch(object): # No explicit filters set. # Use configured quicksearch search order for (filter_name, filter_behaviour) in config.quicksearch_search_order: - self._search_objects.append(LivestatusSearchConductor({filter_name: [self._query]}, filter_behaviour)) + self._search_objects.append(LivestatusSearchConductor({filter_name: [to_regex(self._query)]}, filter_behaviour)) # Collect the raw data from livestatus
7 years
1
0
0
0
Updated bug entries #2855
by Lars Michelsen
Module: check_mk Branch: master Commit: e5d6d28d2bb1f81603180818b4e90c4dcc16df42 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e5d6d28d2bb1f8…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Sun Jun 18 16:34:51 2017 +0200 Updated bug entries #2855 Change-Id: Id2ef72b2a44cf9b6456a7ddae7bce081c618163f --- .bugs/2855 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.bugs/2855 b/.bugs/2855 index a898b31..3984008 100644 --- a/.bugs/2855 +++ b/.bugs/2855 @@ -1,7 +1,10 @@ Title: cmk-update-agent: Needs to protect against parallel executions Component: agents -State: open +Class: bug +State: done Date: 2016-12-22 11:52:28 Targetversion: 1.4.0 -Class: bug + +2017-06-18 16:26:42: changed state open -> done +This has been fixed recently.
7 years
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
27
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
Results per page:
10
25
50
100
200