mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Downtime::AddDowntime(): place Downtimes in the same zone as the origin ScheduledDowntimes
(cherry picked from commit ce847324bc8abe4f36071633b999fa88ba2213f3)
This commit is contained in:
parent
ee915ed5d2
commit
fb72633c5e
@ -267,7 +267,23 @@ String Downtime::AddDowntime(const Checkable::Ptr& checkable, const String& auth
|
|||||||
if (service)
|
if (service)
|
||||||
attrs->Set("service_name", service->GetShortName());
|
attrs->Set("service_name", service->GetShortName());
|
||||||
|
|
||||||
String zone = checkable->GetZoneName();
|
String zone;
|
||||||
|
|
||||||
|
if (!scheduledDowntime.IsEmpty()) {
|
||||||
|
auto sdt (ScheduledDowntime::GetByName(scheduledDowntime));
|
||||||
|
|
||||||
|
if (sdt) {
|
||||||
|
auto sdtZone (sdt->GetZone());
|
||||||
|
|
||||||
|
if (sdtZone) {
|
||||||
|
zone = sdtZone->GetName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zone.IsEmpty()) {
|
||||||
|
zone = checkable->GetZoneName();
|
||||||
|
}
|
||||||
|
|
||||||
if (!zone.IsEmpty())
|
if (!zone.IsEmpty())
|
||||||
attrs->Set("zone", zone);
|
attrs->Set("zone", zone);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user