From a8d46e6d476d0baa312ff1352950d28333157478 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 4 Nov 2022 10:19:26 +0100 Subject: [PATCH] Use service short name for evaluating targeted service rules --- lib/icinga/dependency-apply.cpp | 2 +- lib/icinga/notification-apply.cpp | 2 +- lib/icinga/scheduleddowntime-apply.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/icinga/dependency-apply.cpp b/lib/icinga/dependency-apply.cpp index 015254b9d..8f8840c19 100644 --- a/lib/icinga/dependency-apply.cpp +++ b/lib/icinga/dependency-apply.cpp @@ -156,7 +156,7 @@ void Dependency::EvaluateApplyRules(const Service::Ptr& service) rule->AddMatch(); } - for (auto& rule : ApplyRule::GetTargetedServiceRules(Dependency::TypeInstance, service->GetHost()->GetName(), service->GetName())) { + for (auto& rule : ApplyRule::GetTargetedServiceRules(Dependency::TypeInstance, service->GetHost()->GetName(), service->GetShortName())) { if (EvaluateApplyRule(service, *rule, true)) rule->AddMatch(); } diff --git a/lib/icinga/notification-apply.cpp b/lib/icinga/notification-apply.cpp index 072998dc5..0983077f0 100644 --- a/lib/icinga/notification-apply.cpp +++ b/lib/icinga/notification-apply.cpp @@ -156,7 +156,7 @@ void Notification::EvaluateApplyRules(const Service::Ptr& service) rule->AddMatch(); } - for (auto& rule : ApplyRule::GetTargetedServiceRules(Notification::TypeInstance, service->GetHost()->GetName(), service->GetName())) { + for (auto& rule : ApplyRule::GetTargetedServiceRules(Notification::TypeInstance, service->GetHost()->GetName(), service->GetShortName())) { if (EvaluateApplyRule(service, *rule, true)) rule->AddMatch(); } diff --git a/lib/icinga/scheduleddowntime-apply.cpp b/lib/icinga/scheduleddowntime-apply.cpp index 7c0166c20..9571706a2 100644 --- a/lib/icinga/scheduleddowntime-apply.cpp +++ b/lib/icinga/scheduleddowntime-apply.cpp @@ -154,7 +154,7 @@ void ScheduledDowntime::EvaluateApplyRules(const Service::Ptr& service) rule->AddMatch(); } - for (auto& rule : ApplyRule::GetTargetedServiceRules(ScheduledDowntime::TypeInstance, service->GetHost()->GetName(), service->GetName())) { + for (auto& rule : ApplyRule::GetTargetedServiceRules(ScheduledDowntime::TypeInstance, service->GetHost()->GetName(), service->GetShortName())) { if (EvaluateApplyRule(service, *rule, true)) rule->AddMatch(); }