mirror of https://github.com/Icinga/icinga2.git
Move CompatUtility::GetCheckableProblemHasBeenAcknowledged() into feature specific dumps
This commit is contained in:
parent
92c565d744
commit
7bf2e07032
|
@ -372,7 +372,7 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl
|
|||
|
||||
if (cr) {
|
||||
fp << "\t" << "check_source=" << cr->GetCheckSource() << "\n"
|
||||
"\t" "last_check=" << static_cast<long>(cr->GetScheduleEnd()) << "\n";
|
||||
"\t" "last_check=" << static_cast<long>(cr->GetScheduleEnd()) << "\n";
|
||||
}
|
||||
|
||||
fp << "\t" << "next_check=" << static_cast<long>(checkable->GetNextCheck()) << "\n"
|
||||
|
@ -380,14 +380,14 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl
|
|||
"\t" "max_attempts=" << checkable->GetMaxCheckAttempts() << "\n"
|
||||
"\t" "last_state_change=" << static_cast<long>(checkable->GetLastStateChange()) << "\n"
|
||||
"\t" "last_hard_state_change=" << static_cast<long>(checkable->GetLastHardStateChange()) << "\n"
|
||||
"\t" "last_update=" << static_cast<long>(time(nullptr)) << "\n"
|
||||
"\t" "last_update=" << static_cast<long>(time(NULL)) << "\n"
|
||||
"\t" "notifications_enabled=" << CompatUtility::GetCheckableNotificationsEnabled(checkable) << "\n"
|
||||
"\t" "active_checks_enabled=" << CompatUtility::GetCheckableActiveChecksEnabled(checkable) << "\n"
|
||||
"\t" "passive_checks_enabled=" << CompatUtility::GetCheckablePassiveChecksEnabled(checkable) << "\n"
|
||||
"\t" "flap_detection_enabled=" << CompatUtility::GetCheckableFlapDetectionEnabled(checkable) << "\n"
|
||||
"\t" "is_flapping=" << CompatUtility::GetCheckableIsFlapping(checkable) << "\n"
|
||||
"\t" "percent_state_change=" << CompatUtility::GetCheckablePercentStateChange(checkable) << "\n"
|
||||
"\t" "problem_has_been_acknowledged=" << CompatUtility::GetCheckableProblemHasBeenAcknowledged(checkable) << "\n"
|
||||
"\t" "problem_has_been_acknowledged=" << (checkable->GetAcknowledgement() != AcknowledgementNone ? 1 : 0) << "\n"
|
||||
"\t" "acknowledgement_type=" << CompatUtility::GetCheckableAcknowledgementType(checkable) << "\n"
|
||||
"\t" "acknowledgement_end_time=" << checkable->GetAcknowledgementExpiry() << "\n"
|
||||
"\t" "scheduled_downtime_depth=" << checkable->GetDowntimeDepth() << "\n"
|
||||
|
|
|
@ -153,7 +153,7 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
|
|||
fields->Set("next_notification", DbValue::FromTimestamp(CompatUtility::GetCheckableNotificationNextNotification(host)));
|
||||
fields->Set("no_more_notifications", Empty);
|
||||
fields->Set("notifications_enabled", CompatUtility::GetCheckableNotificationsEnabled(host));
|
||||
fields->Set("problem_has_been_acknowledged", CompatUtility::GetCheckableProblemHasBeenAcknowledged(host));
|
||||
fields->Set("problem_has_been_acknowledged", host->GetAcknowledgement() != AcknowledgementNone);
|
||||
fields->Set("acknowledgement_type", CompatUtility::GetCheckableAcknowledgementType(host));
|
||||
fields->Set("current_notification_number", CompatUtility::GetCheckableNotificationNotificationNumber(host));
|
||||
fields->Set("passive_checks_enabled", CompatUtility::GetCheckablePassiveChecksEnabled(host));
|
||||
|
|
|
@ -141,7 +141,7 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
|
|||
fields->Set("next_notification", DbValue::FromTimestamp(CompatUtility::GetCheckableNotificationNextNotification(service)));
|
||||
fields->Set("no_more_notifications", Empty);
|
||||
fields->Set("notifications_enabled", CompatUtility::GetCheckableNotificationsEnabled(service));
|
||||
fields->Set("problem_has_been_acknowledged", CompatUtility::GetCheckableProblemHasBeenAcknowledged(service));
|
||||
fields->Set("problem_has_been_acknowledged", service->GetAcknowledgement() != AcknowledgementNone);
|
||||
fields->Set("acknowledgement_type", CompatUtility::GetCheckableAcknowledgementType(service));
|
||||
fields->Set("current_notification_number", CompatUtility::GetCheckableNotificationNotificationNumber(service));
|
||||
fields->Set("passive_checks_enabled", CompatUtility::GetCheckablePassiveChecksEnabled(service));
|
||||
|
|
|
@ -207,12 +207,6 @@ int CompatUtility::GetCheckableHasBeenChecked(const Checkable::Ptr& checkable)
|
|||
return (checkable->GetLastCheckResult() ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
int CompatUtility::GetCheckableProblemHasBeenAcknowledged(const Checkable::Ptr& checkable)
|
||||
{
|
||||
return (checkable->GetAcknowledgement() != AcknowledgementNone ? 1 : 0);
|
||||
}
|
||||
|
||||
int CompatUtility::GetCheckableAcknowledgementType(const Checkable::Ptr& checkable)
|
||||
{
|
||||
return static_cast<int>(checkable->GetAcknowledgement());
|
||||
|
|
|
@ -55,7 +55,6 @@ public:
|
|||
static double GetCheckableRetryInterval(const Checkable::Ptr& checkable);
|
||||
static String GetCheckableCheckPeriod(const Checkable::Ptr& checkable);
|
||||
static int GetCheckableHasBeenChecked(const Checkable::Ptr& checkable);
|
||||
static int GetCheckableProblemHasBeenAcknowledged(const Checkable::Ptr& checkable);
|
||||
static int GetCheckableAcknowledgementType(const Checkable::Ptr& checkable);
|
||||
static int GetCheckablePassiveChecksEnabled(const Checkable::Ptr& checkable);
|
||||
static int GetCheckableActiveChecksEnabled(const Checkable::Ptr& checkable);
|
||||
|
|
Loading…
Reference in New Issue