mirror of https://github.com/Icinga/icinga2.git
parent
21f86b9061
commit
34b5a4d9b4
|
@ -73,7 +73,7 @@ String Checkable::AddDowntime(const String& author, const String& comment,
|
|||
|
||||
if (!triggeredBy.IsEmpty()) {
|
||||
Downtime::Ptr triggerDowntime = GetDowntimeByID(triggeredBy);
|
||||
|
||||
|
||||
if (triggerDowntime)
|
||||
downtime->SetTriggeredByLegacyId(triggerDowntime->GetLegacyId());
|
||||
}
|
||||
|
@ -104,6 +104,14 @@ String Checkable::AddDowntime(const String& author, const String& comment,
|
|||
l_DowntimesCache[uid] = this;
|
||||
}
|
||||
|
||||
/* if this object is already in a NOT-OK state trigger this downtime now */
|
||||
if (GetStateRaw() != ServiceOK) {
|
||||
Log(LogNotice, "Checkable")
|
||||
<< "Checkable '" << GetName() << "' already in a NOT-OK state."
|
||||
<< " Triggering downtime now.";
|
||||
TriggerDowntime(uid);
|
||||
}
|
||||
|
||||
Log(LogNotice, "Checkable")
|
||||
<< "Added downtime with ID '" << downtime->GetLegacyId()
|
||||
<< "' between '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", startTime)
|
||||
|
|
Loading…
Reference in New Issue