"\t" "triggered_by=" << triggeredByLegacy << "\n"
"\t" "fixed=" << static_cast<long>(downtime->GetFixed()) << "\n"
"\t" "duration=" << static_cast<long>(downtime->GetDuration()) << "\n"
- "\t" "is_in_effect=" << (downtime->IsActive() ? 1 : 0) << "\n"
+ "\t" "is_in_effect=" << (downtime->IsInEffect() ? 1 : 0) << "\n"
"\t" "author=" << downtime->GetAuthor() << "\n"
"\t" "comment=" << downtime->GetComment() << "\n"
"\t" "trigger_time=" << downtime->GetTriggerTime() << "\n"
fields1->Set("scheduled_start_time", DbValue::FromTimestamp(downtime->GetStartTime()));
fields1->Set("scheduled_end_time", DbValue::FromTimestamp(downtime->GetEndTime()));
fields1->Set("was_started", ((downtime->GetStartTime() <= Utility::GetTime()) ? 1 : 0));
- fields1->Set("is_in_effect", (downtime->IsActive() ? 1 : 0));
+ fields1->Set("is_in_effect", (downtime->IsInEffect() ? 1 : 0));
fields1->Set("trigger_time", DbValue::FromTimestamp(downtime->GetTriggerTime()));
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
fields1->Set("was_started", 1);
fields1->Set("actual_start_time", DbValue::FromTimestamp(time_bag.first));
fields1->Set("actual_start_time_usec", time_bag.second);
- fields1->Set("is_in_effect", (downtime->IsActive() ? 1 : 0));
+ fields1->Set("is_in_effect", (downtime->IsInEffect() ? 1 : 0));
fields1->Set("trigger_time", DbValue::FromTimestamp(downtime->GetTriggerTime()));
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
bool Checkable::IsInDowntime(void) const
{
BOOST_FOREACH(const Downtime::Ptr& downtime, GetDowntimes()) {
- if (downtime->IsActive())
+ if (downtime->IsInEffect())
return true;
}
int downtime_depth = 0;
BOOST_FOREACH(const Downtime::Ptr& downtime, GetDowntimes()) {
- if (downtime->IsActive())
+ if (downtime->IsInEffect())
downtime_depth++;
}
}
BOOST_FOREACH(const Comment::Ptr& comment, comments) {
+ /* Only remove comment which are activated after daemon start. */
if (comment->IsActive() && comment->IsExpired())
RemoveComment(comment->GetName());
}
return static_pointer_cast<Checkable>(m_Checkable);
}
-bool Downtime::IsActive(void) const
+bool Downtime::IsInEffect(void) const
{
double now = Utility::GetTime();
void Downtime::TriggerDowntime(void)
{
- if (IsActive() && IsTriggered()) {
+ if (IsInEffect() && IsTriggered()) {
Log(LogDebug, "Downtime")
<< "Not triggering downtime '" << GetName() << "': already triggered.";
return;
}
BOOST_FOREACH(const Downtime::Ptr& downtime, downtimes) {
+ /* Only remove downtimes which are activated after daemon start. */
if (downtime->IsActive() && downtime->IsExpired())
RemoveDowntime(downtime->GetName(), false, true);
}
intrusive_ptr<Checkable> GetCheckable(void) const;
- bool IsActive(void) const;
+ bool IsInEffect(void) const;
bool IsTriggered(void) const;
bool IsExpired(void) const;
{
Downtime::Ptr downtime = static_cast<Downtime::Ptr>(row);
// 1 .. active, 0 .. pending
- return (downtime->IsActive() ? 1 : 0);
+ return (downtime->IsInEffect() ? 1 : 0);
}
Value DowntimesTable::IsServiceAccessor(const Value& row)