mirror of https://github.com/Icinga/icinga2.git
DB IDO: Update Host/Service state 'scheduled_downtime_depth' on DowntimeTriggered.
Refs #6051
This commit is contained in:
parent
fc44798b8d
commit
3d586b2b80
|
@ -521,6 +521,34 @@ void DbEvents::TriggerDowntime(const Checkable::Ptr& checkable, const Downtime::
|
||||||
query3.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
query3.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||||
|
|
||||||
DbObject::OnQuery(query3);
|
DbObject::OnQuery(query3);
|
||||||
|
|
||||||
|
/* host/service status */
|
||||||
|
Host::Ptr host;
|
||||||
|
Service::Ptr service;
|
||||||
|
tie(host, service) = GetHostService(checkable);
|
||||||
|
|
||||||
|
DbQuery query4;
|
||||||
|
if (service)
|
||||||
|
query4.Table = "servicestatus";
|
||||||
|
else
|
||||||
|
query4.Table = "hoststatus";
|
||||||
|
|
||||||
|
query4.Type = DbQueryUpdate;
|
||||||
|
|
||||||
|
Dictionary::Ptr fields4 = make_shared<Dictionary>();
|
||||||
|
fields4->Set("scheduled_downtime_depth", checkable->GetDowntimeDepth());
|
||||||
|
|
||||||
|
query4.Fields = fields4;
|
||||||
|
|
||||||
|
query4.WhereCriteria = make_shared<Dictionary>();
|
||||||
|
if (service)
|
||||||
|
query4.WhereCriteria->Set("service_object_id", service);
|
||||||
|
else
|
||||||
|
query4.WhereCriteria->Set("host_object_id", host);
|
||||||
|
|
||||||
|
query4.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||||
|
|
||||||
|
DbObject::OnQuery(query4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* acknowledgements */
|
/* acknowledgements */
|
||||||
|
|
Loading…
Reference in New Issue