Module: check_mk
Branch: master
Commit: 11aef693ca8862d6af49ab08d6b449b6d4a56b3c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=11aef693ca8862…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri Feb 2 13:36:28 2018 +0100
Windows agent: fix linkage of Check_MK version str
Rely on preprocessor macro, do not try to redefine it as a global
variable.
---
agents/windows/check_mk_agent.cc | 5 ++---
agents/windows/sections/SectionCheckMK.cc | 3 +--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 564a71c..220cd6f 100644
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -110,7 +110,6 @@ using std::vector;
// | Declarations of macros, structs and function prototypes |
// '----------------------------------------------------------------------'
-const char *check_mk_version = CHECK_MK_VERSION;
static const char RT_PROTOCOL_VERSION[2] = {'0', '0'};
@@ -503,7 +502,7 @@ void usage() {
"of debug output\n"
"check_mk_agent showconfig -- shows the effective "
"configuration used (currently incomplete)\n",
- check_mk_version, *s_config->port);
+ CHECK_MK_VERSION, *s_config->port);
exit(1);
}
@@ -805,7 +804,7 @@ void output_data(OutputProxy &out, const Environment &env,
bool realtime,
out.flush(true);
}
-void show_version() { printf("Check_MK_Agent version %s\n", check_mk_version);
}
+void show_version() { printf("Check_MK_Agent version %s\n", CHECK_MK_VERSION);
}
void show_config() { s_config->parser.outputConfigurables(std::cout); }
diff --git a/agents/windows/sections/SectionCheckMK.cc
b/agents/windows/sections/SectionCheckMK.cc
index a93e60e..be0c7c0 100644
--- a/agents/windows/sections/SectionCheckMK.cc
+++ b/agents/windows/sections/SectionCheckMK.cc
@@ -31,7 +31,6 @@
#include "Logger.h"
#include "stringutil.h"
-extern const char *check_mk_version;
struct script_statistics_t {
int pl_count;
@@ -59,7 +58,7 @@ std::vector<KVPair> SectionCheckMK::createInfoFields() const {
// common fields
std::vector<KVPair> info_fields = {
- {"Version", check_mk_version},
+ {"Version", CHECK_MK_VERSION},
{"BuildDate", __DATE__},
{"AgentOS", "windows"},
{"Hostname", _env.hostname()},