if (notify && !IsPaused())
OnNotificationsRequested(this, NotificationAcknowledgement, GetLastCheckResult(), author, comment, nullptr);
+ Log(LogInformation, "Checkable")
+ << "Acknowledgement set for checkable '" << GetName() << "'.";
+
OnAcknowledgementSet(this, author, comment, type, notify, persistent, expiry, origin);
}
SetAcknowledgementRaw(AcknowledgementNone);
SetAcknowledgementExpiry(0);
+ Log(LogInformation, "Checkable")
+ << "Acknowledgement cleared for checkable '" << GetName() << "'.";
+
OnAcknowledgementCleared(this, origin);
}
if (!downtime)
BOOST_THROW_EXCEPTION(std::runtime_error("Could not create downtime object."));
- Log(LogNotice, "Downtime")
+ Log(LogInformation, "Downtime")
<< "Added downtime '" << downtime->GetName()
<< "' between '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", startTime)
- << "' and '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", endTime) << "'.";
+ << "' and '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", endTime) << "', author: '"
+ << author << "', " << (fixed ? "fixed" : "flexible with " + Convert::ToString(duration) + "s duration");
return fullName;
}
downtime->SetWasCancelled(cancelled);
- Log(LogNotice, "Downtime")
- << "Removed downtime '" << downtime->GetName() << "' from object '" << downtime->GetCheckable()->GetName() << "'.";
-
Array::Ptr errors = new Array();
if (!ConfigObjectUtility::DeleteObject(downtime, false, errors, nullptr)) {
BOOST_THROW_EXCEPTION(std::runtime_error("Could not remove downtime."));
}
+
+ String reason;
+
+ if (expired) {
+ reason = "expired at " + Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", downtime->GetEndTime());
+ } else if (cancelled) {
+ reason = "cancelled by user";
+ } else {
+ reason = "<unknown>";
+ }
+
+ Log(LogInformation, "Downtime")
+ << "Removed downtime '" << downtime->GetName() << "' from checkable '"
+ << downtime->GetCheckable()->GetName() << "' (Reason: " << reason << ").";
+
}
bool Downtime::CanBeTriggered()
if (!CanBeTriggered())
return;
- Log(LogNotice, "Downtime")
- << "Triggering downtime '" << GetName() << "'.";
+ Checkable::Ptr checkable = GetCheckable();
+
+ Log(LogInformation, "Downtime")
+ << "Triggering downtime '" << GetName() << "' for checkable '" << checkable->GetName() << "'.";
if (GetTriggerTime() == 0)
SetTriggerTime(Utility::GetTime());