Module: check_mk
Branch: master
Commit: 951221416577f9b03c136178b8d508fe9be140d8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=951221416577f9…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Aug 25 15:28:10 2017 +0200
Various simplifications.
Change-Id: I5c48ee3c194e6c2b1332b8b98464ebdce800e1a5
---
livestatus/src/pnp4nagios.cc | 26 +++-----------------------
livestatus/src/pnp4nagios.h | 13 +------------
2 files changed, 4 insertions(+), 35 deletions(-)
diff --git a/livestatus/src/pnp4nagios.cc b/livestatus/src/pnp4nagios.cc
index 50b7aeb..46d9204 100644
--- a/livestatus/src/pnp4nagios.cc
+++ b/livestatus/src/pnp4nagios.cc
@@ -24,14 +24,11 @@
#include "pnp4nagios.h"
#include <cstddef>
-#include <system_error>
-#include "MonitoringCore.h"
-#ifdef CMC
-#include "Object.h"
-#include "Host.h"
-#else
+#ifndef CMC
+#include <system_error>
#include "FileSystem.h"
+#include "MonitoringCore.h"
#endif
using std::string;
@@ -68,20 +65,3 @@ int pnpgraph_present(MonitoringCore* mc, const string& host,
return ec ? 0 : 1;
}
#endif
-
-#ifdef CMC
-// TODO(sp) Merge this with Perfdatabase::getPNPRRDPath
-fs::path rrd_path(MonitoringCore* mc, const Object* object,
- const string& varname) {
- fs::path pnp_path = mc->pnpPath();
- if (pnp_path.empty()) {
- return "";
- }
- fs::path path = pnp_path / pnp_cleanup(object->host()->name()) /
- (pnp_cleanup(object->serviceDescription()) + "_" +
- pnp_cleanup(varname) + ".rrd");
- std::error_code ec;
- fs::status(path, ec);
- return ec ? "" : path;
-}
-#endif
diff --git a/livestatus/src/pnp4nagios.h b/livestatus/src/pnp4nagios.h
index 5990223..3800d76 100644
--- a/livestatus/src/pnp4nagios.h
+++ b/livestatus/src/pnp4nagios.h
@@ -27,11 +27,8 @@
#include "config.h" // IWYU pragma: keep
#include <string>
+#ifndef CMC
class MonitoringCore;
-
-#ifdef CMC
-#include "FileSystem.h"
-class Object;
#endif
inline std::string dummy_service_description() { return "_HOST_"; }
@@ -43,12 +40,4 @@ int pnpgraph_present(MonitoringCore* mc, const std::string& host,
const std::string& service);
#endif
-#ifdef CMC
-// Determines if a RRD database exists and returns its path name. Returns an
-// empty string otherwise. This assumes paths created in the PNP4Nagios style
-// with storage type MULTIPLE.
-fs::path rrd_path(MonitoringCore* mc, const Object* object,
- const std::string& varname);
-#endif
-
#endif // pnp4nagios_h