Module: check_mk
Branch: master
Commit: abfdddda6a1b4f607bbc9dfc2dd2aab19aca025e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abfdddda6a1b4f…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Wed Jan 17 11:51:43 2018 +0100
Windows agent: refactor section MRPE
* Struct mrpe_entry: std::string members instead of C char arrays.
* Do not store mrpe_entry pointers in std::vector.
* Refactor updateIncludes and from_string.
* Use file streams instead of old C file pointers.
* Replace buggy PathIsRelative from Win API with correct and
unit-tested implementation that works also with unix-style paths
with forward slashes and UNC paths.
Change-Id: Ib116b49f4f5a4fe12615395aa7aa90b3ed693800
---
agents/windows/WinApi.cc | 4 -
agents/windows/WinApi.h | 1 -
agents/windows/WinApiAdaptor.h | 1 -
agents/windows/sections/SectionMRPE.cc | 147 +++++++++++----------------------
agents/windows/sections/SectionMRPE.h | 26 ++++--
agents/windows/stringutil.h | 17 ++++
agents/windows/test/MockWinApi.h | 1 -
agents/windows/test/stringutilTest.cc | 56 +++++++++++++
8 files changed, 138 insertions(+), 115 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=abfdddda6a…
Module: check_mk
Branch: master
Commit: 50841c33a841cfe2937b7a9e881e8c9ee1d25701
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=50841c33a841cf…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Mon Jan 22 14:00:55 2018 +0100
5698 FIX Windows agent: space in MRPE plugin path resulted in wrong plugin name
If the path of a(n included) MRPE plugin contained one or more spaces,
the plugin name was parsed incorrectly. Quotes were incorrectly
required for the whole command line including parameters within quotes,
making it impossible to distinguish between a script path containing
space(s) and space-separated script parameters. Now the MRPE plugin
path must be enclosed in double quotes (") in order to be processed
correctly. The same applies for script parameters with whitespace:
also they must be separately enclosed in quotes.
Example:
check_mk.ini:
[mrpe]
include = C:\Temp\my.cfg
C:\Temp\my.cfg:
check = Dummy "C:\Program Files (x86)\check_mk\mrpe\check_crit.bat" some parameter "with space"
---
.werks/5698 | 30 ++++++++
agents/windows/Makefile.am | 3 +-
agents/windows/build_version | 2 +-
agents/windows/check_mk.example.ini | 27 ++++++++
agents/windows/sections/SectionMRPE.cc | 91 +++++++++++++++++--------
agents/windows/stringutil.h | 4 +-
agents/windows/test/sections/SectionMRPETest.cc | 71 +++++++++++++++++++
agents/windows/test/stringutilTest.cc | 39 ++++++++++-
8 files changed, 233 insertions(+), 34 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=50841c33a8…