diff options
Diffstat (limited to 'ml/ml.cc')
-rw-r--r-- | ml/ml.cc | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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) |