From 9c5023ab1acf2297e4bbcc3bcb008bbc818a1972 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 5 Oct 2022 17:38:36 +0100 Subject: [PATCH] monitor desc improvements --- src/config/ConfigManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 88569c5a..07d31e2c 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1300,7 +1300,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(std::string name, std::string dis SMonitorRule* found = nullptr; for (auto& r : m_dMonitorRules) { - if (r.name == name) { + if (r.name == name || (r.name.find("desc:") == 0 && (r.name.substr(5) == displayName || r.name.substr(5) == removeBeginEndSpacesTabs(displayName.substr(0, displayName.find_first_of('(')))))) { found = &r; break; } @@ -1312,7 +1312,7 @@ SMonitorRule CConfigManager::getMonitorRuleFor(std::string name, std::string dis Debug::log(WARN, "No rule found for %s, trying to use the first.", name.c_str()); for (auto& r : m_dMonitorRules) { - if (r.name == "" || (r.name.find("desc:") == 0 && r.name.substr(5) == displayName)) { + if (r.name == "") { found = &r; break; }