mirror of https://github.com/Icinga/icinga2.git
parent
360e0ad548
commit
23ab6cf78b
|
@ -181,7 +181,7 @@ void StatusDataWriter::DumpDowntimes(std::ostream& fp, const Checkable::Ptr& che
|
||||||
"\t" "triggered_by=" << triggeredByLegacy << "\n"
|
"\t" "triggered_by=" << triggeredByLegacy << "\n"
|
||||||
"\t" "fixed=" << static_cast<long>(downtime->GetFixed()) << "\n"
|
"\t" "fixed=" << static_cast<long>(downtime->GetFixed()) << "\n"
|
||||||
"\t" "duration=" << static_cast<long>(downtime->GetDuration()) << "\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" "author=" << downtime->GetAuthor() << "\n"
|
||||||
"\t" "comment=" << downtime->GetComment() << "\n"
|
"\t" "comment=" << downtime->GetComment() << "\n"
|
||||||
"\t" "trigger_time=" << downtime->GetTriggerTime() << "\n"
|
"\t" "trigger_time=" << downtime->GetTriggerTime() << "\n"
|
||||||
|
|
|
@ -506,7 +506,7 @@ void DbEvents::AddDowntimeInternal(std::vector<DbQuery>& queries, const Downtime
|
||||||
fields1->Set("scheduled_start_time", DbValue::FromTimestamp(downtime->GetStartTime()));
|
fields1->Set("scheduled_start_time", DbValue::FromTimestamp(downtime->GetStartTime()));
|
||||||
fields1->Set("scheduled_end_time", DbValue::FromTimestamp(downtime->GetEndTime()));
|
fields1->Set("scheduled_end_time", DbValue::FromTimestamp(downtime->GetEndTime()));
|
||||||
fields1->Set("was_started", ((downtime->GetStartTime() <= Utility::GetTime()) ? 1 : 0));
|
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("trigger_time", DbValue::FromTimestamp(downtime->GetTriggerTime()));
|
||||||
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||||
|
|
||||||
|
@ -658,7 +658,7 @@ void DbEvents::TriggerDowntime(const Downtime::Ptr& downtime)
|
||||||
fields1->Set("was_started", 1);
|
fields1->Set("was_started", 1);
|
||||||
fields1->Set("actual_start_time", DbValue::FromTimestamp(time_bag.first));
|
fields1->Set("actual_start_time", DbValue::FromTimestamp(time_bag.first));
|
||||||
fields1->Set("actual_start_time_usec", time_bag.second);
|
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("trigger_time", DbValue::FromTimestamp(downtime->GetTriggerTime()));
|
||||||
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ void Checkable::TriggerDowntimes(void)
|
||||||
bool Checkable::IsInDowntime(void) const
|
bool Checkable::IsInDowntime(void) const
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(const Downtime::Ptr& downtime, GetDowntimes()) {
|
BOOST_FOREACH(const Downtime::Ptr& downtime, GetDowntimes()) {
|
||||||
if (downtime->IsActive())
|
if (downtime->IsInEffect())
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ int Checkable::GetDowntimeDepth(void) const
|
||||||
int downtime_depth = 0;
|
int downtime_depth = 0;
|
||||||
|
|
||||||
BOOST_FOREACH(const Downtime::Ptr& downtime, GetDowntimes()) {
|
BOOST_FOREACH(const Downtime::Ptr& downtime, GetDowntimes()) {
|
||||||
if (downtime->IsActive())
|
if (downtime->IsInEffect())
|
||||||
downtime_depth++;
|
downtime_depth++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,6 +244,7 @@ void Comment::CommentsExpireTimerHandler(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_FOREACH(const Comment::Ptr& comment, comments) {
|
BOOST_FOREACH(const Comment::Ptr& comment, comments) {
|
||||||
|
/* Only remove comment which are activated after daemon start. */
|
||||||
if (comment->IsActive() && comment->IsExpired())
|
if (comment->IsActive() && comment->IsExpired())
|
||||||
RemoveComment(comment->GetName());
|
RemoveComment(comment->GetName());
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ Checkable::Ptr Downtime::GetCheckable(void) const
|
||||||
return static_pointer_cast<Checkable>(m_Checkable);
|
return static_pointer_cast<Checkable>(m_Checkable);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Downtime::IsActive(void) const
|
bool Downtime::IsInEffect(void) const
|
||||||
{
|
{
|
||||||
double now = Utility::GetTime();
|
double now = Utility::GetTime();
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ void Downtime::RemoveDowntime(const String& id, bool cancelled, bool expired, co
|
||||||
|
|
||||||
void Downtime::TriggerDowntime(void)
|
void Downtime::TriggerDowntime(void)
|
||||||
{
|
{
|
||||||
if (IsActive() && IsTriggered()) {
|
if (IsInEffect() && IsTriggered()) {
|
||||||
Log(LogDebug, "Downtime")
|
Log(LogDebug, "Downtime")
|
||||||
<< "Not triggering downtime '" << GetName() << "': already triggered.";
|
<< "Not triggering downtime '" << GetName() << "': already triggered.";
|
||||||
return;
|
return;
|
||||||
|
@ -358,6 +358,7 @@ void Downtime::DowntimesExpireTimerHandler(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_FOREACH(const Downtime::Ptr& downtime, downtimes) {
|
BOOST_FOREACH(const Downtime::Ptr& downtime, downtimes) {
|
||||||
|
/* Only remove downtimes which are activated after daemon start. */
|
||||||
if (downtime->IsActive() && downtime->IsExpired())
|
if (downtime->IsActive() && downtime->IsExpired())
|
||||||
RemoveDowntime(downtime->GetName(), false, true);
|
RemoveDowntime(downtime->GetName(), false, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
|
|
||||||
intrusive_ptr<Checkable> GetCheckable(void) const;
|
intrusive_ptr<Checkable> GetCheckable(void) const;
|
||||||
|
|
||||||
bool IsActive(void) const;
|
bool IsInEffect(void) const;
|
||||||
bool IsTriggered(void) const;
|
bool IsTriggered(void) const;
|
||||||
bool IsExpired(void) const;
|
bool IsExpired(void) const;
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ Value DowntimesTable::TypeAccessor(const Value& row)
|
||||||
{
|
{
|
||||||
Downtime::Ptr downtime = static_cast<Downtime::Ptr>(row);
|
Downtime::Ptr downtime = static_cast<Downtime::Ptr>(row);
|
||||||
// 1 .. active, 0 .. pending
|
// 1 .. active, 0 .. pending
|
||||||
return (downtime->IsActive() ? 1 : 0);
|
return (downtime->IsInEffect() ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Value DowntimesTable::IsServiceAccessor(const Value& row)
|
Value DowntimesTable::IsServiceAccessor(const Value& row)
|
||||||
|
|
Loading…
Reference in New Issue