"\t" "active_checks_enabled" "\t" << Convert::ToLong(service->GetEnableActiveChecks()) << "\n"
"\t" "passive_checks_enabled" "\t" << Convert::ToLong(service->GetEnablePassiveChecks()) << "\n"
"\t" "flap_detection_enabled" "\t" << Convert::ToLong(service->GetEnableFlapping()) << "\n"
- "\t" "is_volatile" "\t" << CompatUtility::GetCheckableIsVolatile(service) << "\n"
+ "\t" "is_volatile" "\t" << Convert::ToLong(service->GetVolatile()) << "\n"
"\t" "notifications_enabled" "\t" << Convert::ToLong(service->GetEnableNotifications()) << "\n"
"\t" "notification_options" "\t" << CompatUtility::GetCheckableNotificationNotificationOptions(service) << "\n"
"\t" "notification_interval" "\t" << CompatUtility::GetCheckableNotificationNotificationInterval(service) << "\n"
fields->Set("flap_detection_on_up", Empty);
fields->Set("flap_detection_on_down", Empty);
fields->Set("flap_detection_on_unreachable", Empty);
- fields->Set("low_flap_threshold", CompatUtility::GetCheckableLowFlapThreshold(host));
- fields->Set("high_flap_threshold", CompatUtility::GetCheckableHighFlapThreshold(host));
+ fields->Set("low_flap_threshold", host->GetFlappingThresholdLow());
+ fields->Set("high_flap_threshold", host->GetFlappingThresholdLow());
fields->Set("process_performance_data", host->GetEnablePerfdata());
fields->Set("stalk_on_warning", 0);
fields->Set("stalk_on_unknown", 0);
fields->Set("stalk_on_critical", 0);
- fields->Set("is_volatile", CompatUtility::GetCheckableIsVolatile(service));
+ fields->Set("is_volatile", service->GetVolatile());
fields->Set("flap_detection_enabled", service->GetEnableFlapping());
fields->Set("flap_detection_on_ok", Empty);
fields->Set("flap_detection_on_warning", Empty);
fields->Set("flap_detection_on_unknown", Empty);
fields->Set("flap_detection_on_critical", Empty);
- fields->Set("low_flap_threshold", CompatUtility::GetCheckableLowFlapThreshold(service));
- fields->Set("high_flap_threshold", CompatUtility::GetCheckableHighFlapThreshold(service));
+ fields->Set("low_flap_threshold", service->GetFlappingThresholdLow());
+ fields->Set("high_flap_threshold", service->GetFlappingThresholdLow());
fields->Set("process_performance_data", service->GetEnablePerfdata());
fields->Set("freshness_checks_enabled", CompatUtility::GetCheckableFreshnessChecksEnabled(service));
fields->Set("freshness_threshold", CompatUtility::GetCheckableFreshnessThreshold(service));
return "24x7";
}
-int CompatUtility::GetCheckableIsVolatile(const Checkable::Ptr& checkable)
-{
- return (checkable->GetVolatile() ? 1 : 0);
-}
-
-double CompatUtility::GetCheckableLowFlapThreshold(const Checkable::Ptr& checkable)
-{
- return checkable->GetFlappingThresholdLow();
-}
-
-double CompatUtility::GetCheckableHighFlapThreshold(const Checkable::Ptr& checkable)
-{
- return checkable->GetFlappingThresholdHigh();
-}
-
int CompatUtility::GetCheckableFreshnessChecksEnabled(const Checkable::Ptr& checkable)
{
return (checkable->GetCheckInterval() > 0 ? 1 : 0);
return static_cast<int>(checkable->GetCheckInterval());
}
-double CompatUtility::GetCheckableStaleness(const Checkable::Ptr& checkable)
-{
- if (checkable->HasBeenChecked() && checkable->GetLastCheck() > 0)
- return (Utility::GetTime() - checkable->GetLastCheck()) / (checkable->GetCheckInterval() * 3600);
-
- return 0.0;
-}
-
-int CompatUtility::GetCheckableIsAcknowledged(const Checkable::Ptr& checkable)
-{
- return (checkable->IsAcknowledged() ? 1 : 0);
-}
-
int CompatUtility::GetCheckableNoMoreNotifications(const Checkable::Ptr& checkable)
{
if (CompatUtility::GetCheckableNotificationNotificationInterval(checkable) == 0 && !checkable->GetVolatile())
static double GetCheckableRetryInterval(const Checkable::Ptr& checkable);
static String GetCheckableCheckPeriod(const Checkable::Ptr& checkable);
- static int GetCheckableIsVolatile(const Checkable::Ptr& checkable);
- static double GetCheckableLowFlapThreshold(const Checkable::Ptr& checkable);
- static double GetCheckableHighFlapThreshold(const Checkable::Ptr& checkable);
static int GetCheckableFreshnessChecksEnabled(const Checkable::Ptr& checkable);
static int GetCheckableFreshnessThreshold(const Checkable::Ptr& checkable);
- static double GetCheckableStaleness(const Checkable::Ptr& checkable);
static int GetCheckableIsAcknowledged(const Checkable::Ptr& checkable);
static int GetCheckableNoMoreNotifications(const Checkable::Ptr& checkable);
static int GetCheckableInCheckPeriod(const Checkable::Ptr& checkable);
return Empty;
ObjectLock olock(host);
- return CompatUtility::GetCheckableIsAcknowledged(host);
+ return host->IsAcknowledged();
}
Value HostsTable::StateAccessor(const Value& row)
if (!host)
return Empty;
- return CompatUtility::GetCheckableLowFlapThreshold(host);
+ return host->GetFlappingThresholdLow();
}
Value HostsTable::HighFlapThresholdAccessor(const Value& row)
if (!host)
return Empty;
- return CompatUtility::GetCheckableHighFlapThreshold(host);
+ return host->GetFlappingThresholdHigh();
}
Value HostsTable::LatencyAccessor(const Value& row)
if (!host)
return Empty;
- return CompatUtility::GetCheckableStaleness(host);
+ if (host->HasBeenChecked() && host->GetLastCheck() > 0)
+ return (Utility::GetTime() - host->GetLastCheck()) / (host->GetCheckInterval() * 3600);
+
+ return 0.0;
}
Value HostsTable::GroupsAccessor(const Value& row)
return Empty;
ObjectLock olock(service);
- return CompatUtility::GetCheckableIsAcknowledged(service);
+ return service->IsAcknowledged();
}
Value ServicesTable::AcknowledgementTypeAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCheckableStaleness(service);
+ if (service->HasBeenChecked() && service->GetLastCheck() > 0)
+ return (Utility::GetTime() - service->GetLastCheck()) / (service->GetCheckInterval() * 3600);
+
+ return 0.0;
}
Value ServicesTable::CheckIntervalAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCheckableLowFlapThreshold(service);
+ return service->GetFlappingThresholdLow();
}
Value ServicesTable::HighFlapThresholdAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCheckableHighFlapThreshold(service);
+ return service->GetFlappingThresholdHigh();
}
Value ServicesTable::LatencyAccessor(const Value& row)