Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/src/alertconfiguration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,6 @@ int AlertConfiguration::addRule(std::istream& newRuleString, std::set<std::strin
return -5;
}

// PQSWMBT-3723, don't instanciate sensor temp./humidity rules directly
if ((temp_rule->name().find("humidity.default@sensor-") == 0) // starts with...
|| (temp_rule->name().find("temperature.default@sensor-") == 0)) {
log_debug("rule instanciation rejected (%s)", temp_rule->name().c_str());
return -100;
}
// end PQSWMBT-3723

// PQSWMBT-4921 Xphase rule exceptions (see templateruleconfigurator.cc)
auto asset = temp_rule->name().substr(temp_rule->name().find("@") + 1);
if (!ruleXphaseIsApplicable(temp_rule->name(), getAssetInfoFromAutoconfig(asset))) {
Expand Down
6 changes: 2 additions & 4 deletions lib/src/fty_alert_engine_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -276,19 +276,17 @@ static void list_rules2(mlm_client_t* client, const char* jsonFilters, AlertConf
{ "sts-voltage", { T_STS } },
{ "ambient.humidity", { T_HUMIDITY } },
{ "ambient.temperature", { T_TEMPERATURE } },
{ "humidity.default", { T_HUMIDITY } },
{ "temperature.default", { T_TEMPERATURE } },
// enumerated rules (see RULES_1_N)
{ "outlet.group.1.current", { T_OUTPUT_CURRENT } },
{ "outlet.group.1.voltage", { T_OUTPUT_VOLTAGE } },
{ "ambient.1.humidity", { T_HUMIDITY } },
{ "ambient.1.temperature", { T_TEMPERATURE } },
}; // CAT_TOKENS

// enumerated rules redirections
static const std::vector<std::pair<std::regex, std::string>> RULES_1_N = {
{ std::regex{R"(outlet\.group\.\d{1,4}\.current)"}, "outlet.group.1.current"},
{ std::regex{R"(outlet\.group\.\d{1,4}\.voltage)"}, "outlet.group.1.voltage"},
{ std::regex{R"(ambient\.\d{1,4}\.humidity)"}, "ambient.1.humidity"},
{ std::regex{R"(ambient\.\d{1,4}\.temperature)"}, "ambient.1.temperature"},
};

std::string ruleNamePrefix{ruleName};
Expand Down