本文整理汇总了C++中host::Ptr::GetRetryInterval方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::GetRetryInterval方法的具体用法?C++ Ptr::GetRetryInterval怎么用?C++ Ptr::GetRetryInterval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类host::Ptr
的用法示例。
在下文中一共展示了Ptr::GetRetryInterval方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DumpHostObject
void StatusDataWriter::DumpHostObject(std::ostream& fp, const Host::Ptr& host)
{
String notes = host->GetNotes();
String notes_url = host->GetNotesUrl();
String action_url = host->GetActionUrl();
String icon_image = host->GetIconImage();
String icon_image_alt = host->GetIconImageAlt();
String display_name = host->GetDisplayName();
String address = host->GetAddress();
String address6 = host->GetAddress6();
fp << "define host {" "\n"
"\t" "host_name" "\t" << host->GetName() << "\n";
if (!display_name.IsEmpty()) {
fp << "\t" "display_name" "\t" << host->GetDisplayName() << "\n"
"\t" "alias" "\t" << host->GetDisplayName() << "\n";
}
if (!address.IsEmpty())
fp << "\t" "address" "\t" << address << "\n";
if (!address6.IsEmpty())
fp << "\t" "address6" "\t" << address6 << "\n";
if (!notes.IsEmpty())
fp << "\t" "notes" "\t" << notes << "\n";
if (!notes_url.IsEmpty())
fp << "\t" "notes_url" "\t" << notes_url << "\n";
if (!action_url.IsEmpty())
fp << "\t" "action_url" "\t" << action_url << "\n";
if (!icon_image.IsEmpty())
fp << "\t" "icon_image" "\t" << icon_image << "\n";
if (!icon_image_alt.IsEmpty())
fp << "\t" "icon_image_alt" "\t" << icon_image_alt << "\n";
std::set<Checkable::Ptr> parents = host->GetParents();
if (!parents.empty()) {
fp << "\t" "parents" "\t";
DumpNameList(fp, parents);
fp << "\n";
}
ObjectLock olock(host);
fp << "\t" "check_interval" "\t" << (host->GetCheckInterval() / 60.0) << "\n"
"\t" "retry_interval" "\t" << (host->GetRetryInterval() / 60.0) << "\n"
"\t" "max_check_attempts" "\t" << host->GetMaxCheckAttempts() << "\n"
"\t" "active_checks_enabled" "\t" << Convert::ToLong(host->GetEnableActiveChecks()) << "\n"
"\t" "passive_checks_enabled" "\t" << Convert::ToLong(host->GetEnablePassiveChecks()) << "\n"
"\t" "notifications_enabled" "\t" << Convert::ToLong(host->GetEnableNotifications()) << "\n"
"\t" "notification_options" "\t" << GetNotificationOptions(host) << "\n"
"\t" "notification_interval" "\t" << CompatUtility::GetCheckableNotificationNotificationInterval(host) << "\n"
"\t" "event_handler_enabled" "\t" << Convert::ToLong(host->GetEnableEventHandler()) << "\n";
CheckCommand::Ptr checkcommand = host->GetCheckCommand();
if (checkcommand)
fp << "\t" "check_command" "\t" << CompatUtility::GetCommandName(checkcommand) << "!" << CompatUtility::GetCheckableCommandArgs(host) << "\n";
EventCommand::Ptr eventcommand = host->GetEventCommand();
if (eventcommand && host->GetEnableEventHandler())
fp << "\t" "event_handler" "\t" << CompatUtility::GetCommandName(eventcommand) << "\n";
TimePeriod::Ptr checkPeriod = host->GetCheckPeriod();
if (checkPeriod)
fp << "\t" "check_period" "\t" << checkPeriod->GetName() << "\n";
fp << "\t" "contacts" "\t";
DumpNameList(fp, CompatUtility::GetCheckableNotificationUsers(host));
fp << "\n";
fp << "\t" "contact_groups" "\t";
DumpNameList(fp, CompatUtility::GetCheckableNotificationUserGroups(host));
fp << "\n";
fp << "\t" << "initial_state" "\t" "o" "\n"
"\t" "low_flap_threshold" "\t" << host->GetFlappingThresholdLow() << "\n"
"\t" "high_flap_threshold" "\t" << host->GetFlappingThresholdHigh() << "\n"
"\t" "process_perf_data" "\t" << Convert::ToLong(host->GetEnablePerfdata()) << "\n"
"\t" "check_freshness" "\t" "1" "\n";
fp << "\t" "host_groups" "\t";
bool first = true;
Array::Ptr groups = host->GetGroups();
if (groups) {
ObjectLock olock(groups);
for (const String& name : groups) {
HostGroup::Ptr hg = HostGroup::GetByName(name);
if (hg) {
if (!first)
fp << ",";
else
first = false;
fp << hg->GetName();
}
}
}
//.........这里部分代码省略.........