本文整理汇总了C++中service::Ptr::GetDowntimeDepth方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::GetDowntimeDepth方法的具体用法?C++ Ptr::GetDowntimeDepth怎么用?C++ Ptr::GetDowntimeDepth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service::Ptr
的用法示例。
在下文中一共展示了Ptr::GetDowntimeDepth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ScheduledDowntimeDepthAccessor
Value ServicesTable::ScheduledDowntimeDepthAccessor(const Value& row)
{
Service::Ptr service = static_cast<Service::Ptr>(row);
if (!service)
return Empty;
return service->GetDowntimeDepth();
}
示例2: GetStatusFields
Dictionary::Ptr ServiceDbObject::GetStatusFields(void) const
{
Dictionary::Ptr fields = make_shared<Dictionary>();
Service::Ptr service = static_pointer_cast<Service>(GetObject());
CheckResult::Ptr cr = service->GetLastCheckResult();
if (cr) {
fields->Set("output", CompatUtility::GetCheckResultOutput(cr));
fields->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
fields->Set("perfdata", CompatUtility::GetCheckResultPerfdata(cr));
fields->Set("check_source", cr->GetCheckSource());
}
fields->Set("current_state", service->GetState());
fields->Set("has_been_checked", CompatUtility::GetCheckableHasBeenChecked(service));
fields->Set("should_be_scheduled", service->GetEnableActiveChecks());
fields->Set("current_check_attempt", service->GetCheckAttempt());
fields->Set("max_check_attempts", service->GetMaxCheckAttempts());
if (cr)
fields->Set("last_check", DbValue::FromTimestamp(cr->GetScheduleEnd()));
fields->Set("next_check", DbValue::FromTimestamp(service->GetNextCheck()));
fields->Set("check_type", CompatUtility::GetCheckableCheckType(service));
fields->Set("last_state_change", DbValue::FromTimestamp(service->GetLastStateChange()));
fields->Set("last_hard_state_change", DbValue::FromTimestamp(service->GetLastHardStateChange()));
fields->Set("last_time_ok", DbValue::FromTimestamp(static_cast<int>(service->GetLastStateOK())));
fields->Set("last_time_warning", DbValue::FromTimestamp(static_cast<int>(service->GetLastStateWarning())));
fields->Set("last_time_critical", DbValue::FromTimestamp(static_cast<int>(service->GetLastStateCritical())));
fields->Set("last_time_unknown", DbValue::FromTimestamp(static_cast<int>(service->GetLastStateUnknown())));
fields->Set("state_type", service->GetStateType());
fields->Set("last_notification", DbValue::FromTimestamp(CompatUtility::GetCheckableNotificationLastNotification(service)));
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("acknowledgement_type", CompatUtility::GetCheckableAcknowledgementType(service));
fields->Set("current_notification_number", CompatUtility::GetCheckableNotificationNotificationNumber(service));
fields->Set("passive_checks_enabled", CompatUtility::GetCheckablePassiveChecksEnabled(service));
fields->Set("active_checks_enabled", CompatUtility::GetCheckableActiveChecksEnabled(service));
fields->Set("event_handler_enabled", CompatUtility::GetCheckableEventHandlerEnabled(service));
fields->Set("flap_detection_enabled", CompatUtility::GetCheckableFlapDetectionEnabled(service));
fields->Set("is_flapping", CompatUtility::GetCheckableIsFlapping(service));
fields->Set("percent_state_change", CompatUtility::GetCheckablePercentStateChange(service));
if (cr) {
fields->Set("latency", Convert::ToString(Service::CalculateLatency(cr)));
fields->Set("execution_time", Convert::ToString(Service::CalculateExecutionTime(cr)));
}
fields->Set("scheduled_downtime_depth", service->GetDowntimeDepth());
fields->Set("process_performance_data", CompatUtility::GetCheckableProcessPerformanceData(service));
fields->Set("event_handler", CompatUtility::GetCheckableEventHandler(service));
fields->Set("check_command", CompatUtility::GetCheckableCheckCommand(service));
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("modified_service_attributes", service->GetModifiedAttributes());
return fields;
}