Module: check_mk
Branch: master
Commit: 6173515c4e4c7024e15973780a79186a1151a24a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6173515c4e4c70…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Nov 30 09:23:39 2018 +0100
Output detailed version/build info in NEB, too.
Centralized some #ifdef logic on the way.
Change-Id: Iec4da3bde05ec87e375289366a717d96e38d920d
---
livestatus/src/RegExp.cc | 7 +++++++
livestatus/src/RegExp.h | 2 ++
livestatus/src/module.cc | 9 +++++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/RegExp.cc b/livestatus/src/RegExp.cc
index 71840d7..eff949d 100644
--- a/livestatus/src/RegExp.cc
+++ b/livestatus/src/RegExp.cc
@@ -53,6 +53,8 @@ public:
return RE2::PartialMatch(str, _regex);
}
+ static std::string engine() { return "RE2"; }
+
private:
RE2 _regex;
@@ -98,6 +100,8 @@ public:
return regex_search(str, _regex);
}
+ static std::string engine() { return "C++11"; }
+
private:
std::regex _regex;
};
@@ -124,3 +128,6 @@ std::string RegExp::replace(const std::string &str,
bool RegExp::match(const std::string &str) const { return _impl->match(str); }
bool RegExp::search(const std::string &str) const { return _impl->search(str); }
+
+// static
+std::string RegExp::engine() { return Impl::engine(); }
diff --git a/livestatus/src/RegExp.h b/livestatus/src/RegExp.h
index aae4a9e..c0e82b1 100644
--- a/livestatus/src/RegExp.h
+++ b/livestatus/src/RegExp.h
@@ -49,6 +49,8 @@ public:
bool match(const std::string &str) const;
bool search(const std::string &str) const;
+ static std::string engine();
+
private:
class Impl;
std::unique_ptr<Impl> _impl;
diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc
index 3764223..ceeb3e5 100644
--- a/livestatus/src/module.cc
+++ b/livestatus/src/module.cc
@@ -57,6 +57,7 @@
#include "MonitoringCore.h"
#include "OutputBuffer.h"
#include "Poller.h"
+#include "RegExp.h"
#include "Store.h"
#include "StringUtils.h"
#include "TimeperiodsCache.h"
@@ -1102,8 +1103,12 @@ void livestatus_parse_arguments(const char *args_orig) {
void omd_advertize() {
Notice(fl_logger_nagios)
- << "Livestatus " << VERSION << " by Mathias
Kettner. Socket: '"
- << fl_socket_path << "'";
+ << "Livestatus by Mathias Kettner started with PID " <<
getpid();
+ Notice(fl_logger_nagios) << "version " << VERSION <<
" compiled "
+ << BUILD_DATE << " on " <<
BUILD_HOSTNAME;
+ Notice(fl_logger_nagios) << "built with " << BUILD_CXX <<
", using "
+ << RegExp::engine() << " regex
engine";
+ Notice(fl_logger_nagios) << "Using socket at '" <<
fl_socket_path << "'";
Notice(fl_logger_nagios) << "Please visit us at
http://mathias-kettner.de/"quot;;
if (char *omd_site = getenv("OMD_SITE")) {
Informational(fl_logger_nagios)