summaryrefslogtreecommitdiffstats
path: root/ml/ml.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ml/ml.cc')
-rw-r--r--ml/ml.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/ml/ml.cc b/ml/ml.cc
index 857d23d33..cfda3d28f 100644
--- a/ml/ml.cc
+++ b/ml/ml.cc
@@ -75,7 +75,6 @@ char *ml_get_host_info(RRDHOST *RH) {
if (RH && RH->ml_host) {
Host *H = static_cast<Host *>(RH->ml_host);
H->getConfigAsJson(ConfigJson);
- H->getDetectionInfoAsJson(ConfigJson);
} else {
ConfigJson["enabled"] = false;
}
@@ -83,6 +82,19 @@ char *ml_get_host_info(RRDHOST *RH) {
return strdup(ConfigJson.dump(2, '\t').c_str());
}
+char *ml_get_host_runtime_info(RRDHOST *RH) {
+ nlohmann::json ConfigJson;
+
+ if (RH && RH->ml_host) {
+ Host *H = static_cast<Host *>(RH->ml_host);
+ H->getDetectionInfoAsJson(ConfigJson);
+ } else {
+ return nullptr;
+ }
+
+ return strdup(ConfigJson.dump(1, '\t').c_str());
+}
+
bool ml_is_anomalous(RRDDIM *RD, double Value, bool Exists) {
Dimension *D = static_cast<Dimension *>(RD->state->ml_dimension);
if (!D)