mirror of https://github.com/Icinga/icinga2.git
Drop dead code in Livestatus feature
This commit is contained in:
parent
2d1f772a6e
commit
b4af0971af
|
@ -385,8 +385,8 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl
|
|||
"\t" "active_checks_enabled=" << Convert::ToLong(checkable->GetEnableActiveChecks()) << "\n"
|
||||
"\t" "passive_checks_enabled=" << Convert::ToLong(checkable->GetEnablePassiveChecks()) << "\n"
|
||||
"\t" "flap_detection_enabled=" << Convert::ToLong(checkable->GetEnableFlapping()) << "\n"
|
||||
"\t" "is_flapping=" << CompatUtility::GetCheckableIsFlapping(checkable) << "\n"
|
||||
"\t" "percent_state_change=" << CompatUtility::GetCheckablePercentStateChange(checkable) << "\n"
|
||||
"\t" "is_flapping=" << Convert::ToLong(checkable->IsFlapping()) << "\n"
|
||||
"\t" "percent_state_change=" << checkable->GetFlappingCurrent() << "\n"
|
||||
"\t" "problem_has_been_acknowledged=" << (checkable->GetAcknowledgement() != AcknowledgementNone ? 1 : 0) << "\n"
|
||||
"\t" "acknowledgement_type=" << checkable->GetAcknowledgement() << "\n"
|
||||
"\t" "acknowledgement_end_time=" << checkable->GetAcknowledgementExpiry() << "\n"
|
||||
|
@ -394,7 +394,7 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl
|
|||
"\t" "last_notification=" << CompatUtility::GetCheckableNotificationLastNotification(checkable) << "\n"
|
||||
"\t" "next_notification=" << CompatUtility::GetCheckableNotificationNextNotification(checkable) << "\n"
|
||||
"\t" "current_notification_number=" << CompatUtility::GetCheckableNotificationNotificationNumber(checkable) << "\n"
|
||||
"\t" "is_reachable=" << CompatUtility::GetCheckableIsReachable(checkable) << "\n";
|
||||
"\t" "is_reachable=" << Convert::ToLong(checkable->IsReachable()) << "\n";
|
||||
}
|
||||
|
||||
void StatusDataWriter::DumpServiceStatus(std::ostream& fp, const Service::Ptr& service)
|
||||
|
|
|
@ -137,8 +137,8 @@ void DbEvents::FlappingChangedHandler(const Checkable::Ptr& checkable)
|
|||
query1.Object = DbObject::GetOrCreateByObject(checkable);
|
||||
|
||||
Dictionary::Ptr fields1 = new Dictionary();
|
||||
fields1->Set("is_flapping", CompatUtility::GetCheckableIsFlapping(checkable));
|
||||
fields1->Set("percent_state_change", CompatUtility::GetCheckablePercentStateChange(checkable));
|
||||
fields1->Set("is_flapping", checkable->IsFlapping());
|
||||
fields1->Set("percent_state_change", checkable->GetFlappingCurrent());
|
||||
|
||||
query1.Fields = fields1;
|
||||
|
||||
|
|
|
@ -160,8 +160,8 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
|
|||
fields->Set("active_checks_enabled", host->GetEnableActiveChecks());
|
||||
fields->Set("event_handler_enabled", host->GetEnableEventHandler());
|
||||
fields->Set("flap_detection_enabled", host->GetEnableFlapping());
|
||||
fields->Set("is_flapping", CompatUtility::GetCheckableIsFlapping(host));
|
||||
fields->Set("percent_state_change", CompatUtility::GetCheckablePercentStateChange(host));
|
||||
fields->Set("is_flapping", host->IsFlapping());
|
||||
fields->Set("percent_state_change", host->GetFlappingCurrent());
|
||||
|
||||
if (cr) {
|
||||
fields->Set("latency", Convert::ToString(cr->CalculateLatency()));
|
||||
|
@ -177,7 +177,7 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
|
|||
fields->Set("normal_check_interval", CompatUtility::GetCheckableCheckInterval(host));
|
||||
fields->Set("retry_check_interval", CompatUtility::GetCheckableRetryInterval(host));
|
||||
fields->Set("check_timeperiod_object_id", host->GetCheckPeriod());
|
||||
fields->Set("is_reachable", CompatUtility::GetCheckableIsReachable(host));
|
||||
fields->Set("is_reachable", host->IsReachable());
|
||||
|
||||
fields->Set("original_attributes", JsonEncode(host->GetOriginalAttributes()));
|
||||
|
||||
|
|
|
@ -148,8 +148,8 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
|
|||
fields->Set("active_checks_enabled", service->GetEnableActiveChecks());
|
||||
fields->Set("event_handler_enabled", service->GetEnableEventHandler());
|
||||
fields->Set("flap_detection_enabled", service->GetEnableFlapping());
|
||||
fields->Set("is_flapping", CompatUtility::GetCheckableIsFlapping(service));
|
||||
fields->Set("percent_state_change", CompatUtility::GetCheckablePercentStateChange(service));
|
||||
fields->Set("is_flapping", service->IsFlapping());
|
||||
fields->Set("percent_state_change", service->GetFlappingCurrent());
|
||||
|
||||
if (cr) {
|
||||
fields->Set("latency", Convert::ToString(cr->CalculateLatency()));
|
||||
|
@ -163,7 +163,7 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
|
|||
fields->Set("normal_check_interval", CompatUtility::GetCheckableCheckInterval(service));
|
||||
fields->Set("retry_check_interval", CompatUtility::GetCheckableRetryInterval(service));
|
||||
fields->Set("check_timeperiod_object_id", service->GetCheckPeriod());
|
||||
fields->Set("is_reachable", CompatUtility::GetCheckableIsReachable(service));
|
||||
fields->Set("is_reachable", service->IsReachable());
|
||||
|
||||
fields->Set("original_attributes", JsonEncode(service->GetOriginalAttributes()));
|
||||
|
||||
|
|
|
@ -202,21 +202,6 @@ String CompatUtility::GetCheckableCheckPeriod(const Checkable::Ptr& checkable)
|
|||
return "24x7";
|
||||
}
|
||||
|
||||
int CompatUtility::GetCheckableIsFlapping(const Checkable::Ptr& checkable)
|
||||
{
|
||||
return (checkable->IsFlapping() ? 1 : 0);
|
||||
}
|
||||
|
||||
int CompatUtility::GetCheckableIsReachable(const Checkable::Ptr& checkable)
|
||||
{
|
||||
return (checkable->IsReachable() ? 1 : 0);
|
||||
}
|
||||
|
||||
double CompatUtility::GetCheckablePercentStateChange(const Checkable::Ptr& checkable)
|
||||
{
|
||||
return checkable->GetFlappingCurrent();
|
||||
}
|
||||
|
||||
String CompatUtility::GetCheckableEventHandler(const Checkable::Ptr& checkable)
|
||||
{
|
||||
String event_command_str;
|
||||
|
|
|
@ -54,9 +54,6 @@ public:
|
|||
static double GetCheckableCheckInterval(const Checkable::Ptr& checkable);
|
||||
static double GetCheckableRetryInterval(const Checkable::Ptr& checkable);
|
||||
static String GetCheckableCheckPeriod(const Checkable::Ptr& checkable);
|
||||
static int GetCheckableIsFlapping(const Checkable::Ptr& checkable);
|
||||
static int GetCheckableIsReachable(const Checkable::Ptr& checkable);
|
||||
static double GetCheckablePercentStateChange(const Checkable::Ptr& checkable);
|
||||
|
||||
static String GetCheckableEventHandler(const Checkable::Ptr& checkable);
|
||||
static String GetCheckableCheckCommand(const Checkable::Ptr& checkable);
|
||||
|
|
|
@ -108,7 +108,7 @@ void HostsTable::AddColumns(Table *table, const String& prefix,
|
|||
table->AddColumn(prefix + "scheduled_downtime_depth", Column(&HostsTable::ScheduledDowntimeDepthAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "is_executing", Column(&Table::ZeroAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "active_checks_enabled", Column(&HostsTable::ActiveChecksEnabledAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "check_options", Column(&HostsTable::CheckOptionsAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "check_options", Column(&Table::EmptyStringAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "obsess_over_host", Column(&Table::ZeroAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "modified_attributes", Column(&Table::ZeroAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "modified_attributes_list", Column(&Table::ZeroAccessor, objectAccessor));
|
||||
|
@ -776,12 +776,6 @@ Value HostsTable::ActiveChecksEnabledAccessor(const Value& row)
|
|||
return Convert::ToLong(host->GetEnableActiveChecks());
|
||||
}
|
||||
|
||||
Value HostsTable::CheckOptionsAccessor(const Value&)
|
||||
{
|
||||
/* TODO - forcexec, freshness, orphan, none */
|
||||
return Empty;
|
||||
}
|
||||
|
||||
Value HostsTable::CheckIntervalAccessor(const Value& row)
|
||||
{
|
||||
Host::Ptr host = static_cast<Host::Ptr>(row);
|
||||
|
@ -869,7 +863,7 @@ Value HostsTable::PercentStateChangeAccessor(const Value& row)
|
|||
if (!host)
|
||||
return Empty;
|
||||
|
||||
return CompatUtility::GetCheckablePercentStateChange(host);
|
||||
return host->GetFlappingCurrent();
|
||||
}
|
||||
|
||||
Value HostsTable::InNotificationPeriodAccessor(const Value& row)
|
||||
|
|
|
@ -99,7 +99,6 @@ protected:
|
|||
static Value IsFlappingAccessor(const Value& row);
|
||||
static Value ScheduledDowntimeDepthAccessor(const Value& row);
|
||||
static Value ActiveChecksEnabledAccessor(const Value& row);
|
||||
static Value CheckOptionsAccessor(const Value& row);
|
||||
static Value CheckIntervalAccessor(const Value& row);
|
||||
static Value RetryIntervalAccessor(const Value& row);
|
||||
static Value NotificationIntervalAccessor(const Value& row);
|
||||
|
|
|
@ -103,7 +103,7 @@ void ServicesTable::AddColumns(Table *table, const String& prefix,
|
|||
table->AddColumn(prefix + "process_performance_data", Column(&ServicesTable::ProcessPerformanceDataAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "is_executing", Column(&Table::ZeroAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "active_checks_enabled", Column(&ServicesTable::ActiveChecksEnabledAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "check_options", Column(&ServicesTable::CheckOptionsAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "check_options", Column(&Table::EmptyStringAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "flap_detection_enabled", Column(&ServicesTable::FlapDetectionEnabledAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "check_freshness", Column(&ServicesTable::CheckFreshnessAccessor, objectAccessor));
|
||||
table->AddColumn(prefix + "obsess_over_service", Column(&Table::ZeroAccessor, objectAccessor));
|
||||
|
@ -774,12 +774,6 @@ Value ServicesTable::ActiveChecksEnabledAccessor(const Value& row)
|
|||
return Convert::ToLong(service->GetEnableActiveChecks());
|
||||
}
|
||||
|
||||
Value ServicesTable::CheckOptionsAccessor(const Value& row)
|
||||
{
|
||||
/* TODO - forcexec, freshness, orphan, none */
|
||||
return Empty;
|
||||
}
|
||||
|
||||
Value ServicesTable::FlapDetectionEnabledAccessor(const Value& row)
|
||||
{
|
||||
Service::Ptr service = static_cast<Service::Ptr>(row);
|
||||
|
@ -897,7 +891,7 @@ Value ServicesTable::PercentStateChangeAccessor(const Value& row)
|
|||
if (!service)
|
||||
return Empty;
|
||||
|
||||
return CompatUtility::GetCheckablePercentStateChange(service);
|
||||
return service->GetFlappingCurrent();
|
||||
}
|
||||
|
||||
Value ServicesTable::InCheckPeriodAccessor(const Value& row)
|
||||
|
|
|
@ -98,7 +98,6 @@ protected:
|
|||
static Value NotificationsEnabledAccessor(const Value& row);
|
||||
static Value ProcessPerformanceDataAccessor(const Value& row);
|
||||
static Value ActiveChecksEnabledAccessor(const Value& row);
|
||||
static Value CheckOptionsAccessor(const Value& row);
|
||||
static Value FlapDetectionEnabledAccessor(const Value& row);
|
||||
static Value CheckFreshnessAccessor(const Value& row);
|
||||
static Value StalenessAccessor(const Value& row);
|
||||
|
|
Loading…
Reference in New Issue