mirror of https://github.com/Icinga/icinga2.git
Fix scheduling of downtimes for all services on child hosts
The loop iterated over the services of the wrong host resulting in duplicate downtimes scheduled for services of the parent host instead of downtimes for services of the child host.
This commit is contained in:
parent
95cdc00ad4
commit
e556d3c489
|
@ -458,12 +458,12 @@ Dictionary::Ptr ApiActions::ScheduleDowntime(const ConfigObject::Ptr& object,
|
||||||
if (allServices && !childService) {
|
if (allServices && !childService) {
|
||||||
ArrayData childServiceDowntimes;
|
ArrayData childServiceDowntimes;
|
||||||
|
|
||||||
for (const Service::Ptr& hostService : host->GetServices()) {
|
for (const Service::Ptr& childService : childHost->GetServices()) {
|
||||||
Log(LogNotice, "ApiActions")
|
Log(LogNotice, "ApiActions")
|
||||||
<< "Creating downtime for service " << hostService->GetName() << " on child host " << host->GetName();
|
<< "Creating downtime for service " << childService->GetName() << " on child host " << childHost->GetName();
|
||||||
|
|
||||||
Downtime::Ptr serviceDowntime = Downtime::AddDowntime(hostService, author, comment, startTime, endTime,
|
Downtime::Ptr serviceDowntime = Downtime::AddDowntime(childService, author, comment, startTime, endTime,
|
||||||
fixed, triggerName, duration);
|
fixed, triggerName, duration, String(), String(), childDowntimeName);
|
||||||
String serviceDowntimeName = serviceDowntime->GetName();
|
String serviceDowntimeName = serviceDowntime->GetName();
|
||||||
|
|
||||||
childServiceDowntimes.push_back(new Dictionary({
|
childServiceDowntimes.push_back(new Dictionary({
|
||||||
|
|
Loading…
Reference in New Issue