if (!service)
return Empty;
- return CompatUtility::GetServiceNotificationNotificationPeriod(service);
+ return CompatUtility::GetCheckableNotificationNotificationPeriod(service);
}
Value ServicesTable::CheckPeriodAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceCheckPeriod(service);
+ return CompatUtility::GetCheckableCheckPeriod(service);
}
Value ServicesTable::NotesAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCustomAttributeConfig(service, "notes");
+ return service->GetNotes();
}
Value ServicesTable::NotesExpandedAccessor(const Value& row)
if (!service)
return Empty;
- std::vector<MacroResolver::Ptr> resolvers;
- resolvers.push_back(service);
- resolvers.push_back(service->GetHost());
- resolvers.push_back(IcingaApplication::GetInstance());
+ MacroProcessor::ResolverList resolvers;
+ resolvers.push_back(std::make_pair("service", service));
+ resolvers.push_back(std::make_pair("host", service->GetHost()));
+ resolvers.push_back(std::make_pair("icinga", IcingaApplication::GetInstance()));
- Value value = CompatUtility::GetCustomAttributeConfig(service, "notes");
-
- return MacroProcessor::ResolveMacros(value, resolvers, CheckResult::Ptr(), Utility::EscapeShellCmd);
+ return MacroProcessor::ResolveMacros(service->GetNotes(), resolvers, CheckResult::Ptr(), Utility::EscapeShellCmd);
}
Value ServicesTable::NotesUrlAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCustomAttributeConfig(service, "notes_url");
+ return service->GetNotesUrl();
}
Value ServicesTable::NotesUrlExpandedAccessor(const Value& row)
if (!service)
return Empty;
- std::vector<MacroResolver::Ptr> resolvers;
- resolvers.push_back(service);
- resolvers.push_back(service->GetHost());
- resolvers.push_back(IcingaApplication::GetInstance());
-
- Value value = CompatUtility::GetCustomAttributeConfig(service, "notes_url");
+ MacroProcessor::ResolverList resolvers;
+ resolvers.push_back(std::make_pair("service", service));
+ resolvers.push_back(std::make_pair("host", service->GetHost()));
+ resolvers.push_back(std::make_pair("icinga", IcingaApplication::GetInstance()));
- return MacroProcessor::ResolveMacros(value, resolvers, CheckResult::Ptr(), Utility::EscapeShellCmd);
+ return MacroProcessor::ResolveMacros(service->GetNotesUrl(), resolvers, CheckResult::Ptr(), Utility::EscapeShellCmd);
}
Value ServicesTable::ActionUrlAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCustomAttributeConfig(service, "action_url");
+ return service->GetActionUrl();
}
Value ServicesTable::ActionUrlExpandedAccessor(const Value& row)
if (!service)
return Empty;
- std::vector<MacroResolver::Ptr> resolvers;
- resolvers.push_back(service);
- resolvers.push_back(service->GetHost());
- resolvers.push_back(IcingaApplication::GetInstance());
-
- Value value = CompatUtility::GetCustomAttributeConfig(service, "action_url");
+ MacroProcessor::ResolverList resolvers;
+ resolvers.push_back(std::make_pair("service", service));
+ resolvers.push_back(std::make_pair("host", service->GetHost()));
+ resolvers.push_back(std::make_pair("icinga", IcingaApplication::GetInstance()));
- return MacroProcessor::ResolveMacros(value, resolvers, CheckResult::Ptr(), Utility::EscapeShellCmd);
+ return MacroProcessor::ResolveMacros(service->GetActionUrl(), resolvers, CheckResult::Ptr(), Utility::EscapeShellCmd);
}
Value ServicesTable::IconImageAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCustomAttributeConfig(service, "icon_image");
+ return service->GetIconImage();
}
Value ServicesTable::IconImageExpandedAccessor(const Value& row)
if (!service)
return Empty;
- std::vector<MacroResolver::Ptr> resolvers;
- resolvers.push_back(service);
- resolvers.push_back(service->GetHost());
- resolvers.push_back(IcingaApplication::GetInstance());
+ MacroProcessor::ResolverList resolvers;
+ resolvers.push_back(std::make_pair("service", service));
+ resolvers.push_back(std::make_pair("host", service->GetHost()));
+ resolvers.push_back(std::make_pair("icinga", IcingaApplication::GetInstance()));
- Value value = CompatUtility::GetCustomAttributeConfig(service, "icon_image");
-
- return MacroProcessor::ResolveMacros(value, resolvers, CheckResult::Ptr(), Utility::EscapeShellCmd);
+ return MacroProcessor::ResolveMacros(service->GetIconImage(), resolvers, CheckResult::Ptr(), Utility::EscapeShellCmd);
}
Value ServicesTable::IconImageAltAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCustomAttributeConfig(service, "icon_image_alt");
+ return service->GetIconImageAlt();
}
Value ServicesTable::MaxCheckAttemptsAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceCurrentState(service);
+ return service->GetState();
}
Value ServicesTable::HasBeenCheckedAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceHasBeenChecked(service);
+ return CompatUtility::GetCheckableHasBeenChecked(service);
}
Value ServicesTable::LastStateAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceCheckType(service);
+ return CompatUtility::GetCheckableCheckType(service);
}
Value ServicesTable::AcknowledgedAccessor(const Value& row)
if (!service)
return Empty;
-
- return CompatUtility::GetServiceIsAcknowledged(service);
+ return CompatUtility::GetCheckableIsAcknowledged(service);
}
Value ServicesTable::AcknowledgementTypeAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceNoMoreNotifications(service);
+ return CompatUtility::GetCheckableNoMoreNotifications(service);
}
Value ServicesTable::LastTimeOkAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceNotificationLastNotification(service);
+ return CompatUtility::GetCheckableNotificationLastNotification(service);
}
Value ServicesTable::NextNotificationAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceNotificationNextNotification(service);
+ return CompatUtility::GetCheckableNotificationNextNotification(service);
}
Value ServicesTable::CurrentNotificationNumberAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceNotificationNotificationNumber(service);
+ return CompatUtility::GetCheckableNotificationNotificationNumber(service);
}
Value ServicesTable::LastStateChangeAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceActiveChecksEnabled(service);
+ return CompatUtility::GetCheckableActiveChecksEnabled(service);
}
Value ServicesTable::AcceptPassiveChecksAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServicePassiveChecksEnabled(service);
+ return CompatUtility::GetCheckablePassiveChecksEnabled(service);
}
Value ServicesTable::EventHandlerEnabledAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceEventHandlerEnabled(service);
+ return CompatUtility::GetCheckableEventHandlerEnabled(service);
}
Value ServicesTable::NotificationsEnabledAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceNotificationsEnabled(service);
+ return CompatUtility::GetCheckableNotificationsEnabled(service);
}
Value ServicesTable::ProcessPerformanceDataAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceProcessPerformanceData(service);
+ return CompatUtility::GetCheckableProcessPerformanceData(service);
}
Value ServicesTable::ActiveChecksEnabledAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceActiveChecksEnabled(service);
+ return CompatUtility::GetCheckableActiveChecksEnabled(service);
}
Value ServicesTable::CheckOptionsAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceFlapDetectionEnabled(service);
+ return CompatUtility::GetCheckableFlapDetectionEnabled(service);
}
Value ServicesTable::CheckFreshnessAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceFreshnessChecksEnabled(service);
+ return CompatUtility::GetCheckableFreshnessChecksEnabled(service);
}
Value ServicesTable::ModifiedAttributesAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceStaleness(service);
+ return CompatUtility::GetCheckableStaleness(service);
}
Value ServicesTable::CheckIntervalAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceCheckInterval(service);
+ return CompatUtility::GetCheckableCheckInterval(service);
}
Value ServicesTable::RetryIntervalAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceRetryInterval(service);
+ return CompatUtility::GetCheckableRetryInterval(service);
}
Value ServicesTable::NotificationIntervalAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceNotificationNotificationInterval(service);
+ return CompatUtility::GetCheckableNotificationNotificationInterval(service);
}
Value ServicesTable::LowFlapThresholdAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceLowFlapThreshold(service);
+ return CompatUtility::GetCheckableLowFlapThreshold(service);
}
Value ServicesTable::HighFlapThresholdAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceHighFlapThreshold(service);
+ return CompatUtility::GetCheckableHighFlapThreshold(service);
}
Value ServicesTable::LatencyAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServicePercentStateChange(service);
+ return CompatUtility::GetCheckablePercentStateChange(service);
}
Value ServicesTable::InCheckPeriodAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceInCheckPeriod(service);
+ return CompatUtility::GetCheckableInCheckPeriod(service);
}
Value ServicesTable::InNotificationPeriodAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetServiceInNotificationPeriod(service);
+ return CompatUtility::GetCheckableInNotificationPeriod(service);
}
Value ServicesTable::ContactsAccessor(const Value& row)
Array::Ptr contact_names = make_shared<Array>();
- BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetServiceNotificationUsers(service)) {
+ BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetCheckableNotificationUsers(service)) {
contact_names->Add(user->GetName());
}
String id;
Downtime::Ptr downtime;
- BOOST_FOREACH(boost::tie(id, downtime), downtimes) {
+ BOOST_FOREACH(tie(id, downtime), downtimes) {
if (!downtime)
continue;
String id;
Downtime::Ptr downtime;
- BOOST_FOREACH(boost::tie(id, downtime), downtimes) {
+ BOOST_FOREACH(tie(id, downtime), downtimes) {
if (!downtime)
continue;
String id;
Comment::Ptr comment;
- BOOST_FOREACH(boost::tie(id, comment), comments) {
+ BOOST_FOREACH(tie(id, comment), comments) {
if (!comment)
continue;
String id;
Comment::Ptr comment;
- BOOST_FOREACH(boost::tie(id, comment), comments) {
+ BOOST_FOREACH(tie(id, comment), comments) {
if (!comment)
continue;
String id;
Comment::Ptr comment;
- BOOST_FOREACH(boost::tie(id, comment), comments) {
+ BOOST_FOREACH(tie(id, comment), comments) {
if (!comment)
continue;
String key;
Value value;
- BOOST_FOREACH(boost::tie(key, value), vars) {
+ BOOST_FOREACH(tie(key, value), vars) {
cv->Add(key);
}
String key;
Value value;
- BOOST_FOREACH(boost::tie(key, value), vars) {
+ BOOST_FOREACH(tie(key, value), vars) {
cv->Add(value);
}
String key;
Value value;
- BOOST_FOREACH(boost::tie(key, value), vars) {
+ BOOST_FOREACH(tie(key, value), vars) {
Array::Ptr key_val = make_shared<Array>();
key_val->Add(key);
key_val->Add(value);
Array::Ptr contactgroup_names = make_shared<Array>();
- BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetServiceNotificationUserGroups(service)) {
+ BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetCheckableNotificationUserGroups(service)) {
contactgroup_names->Add(usergroup->GetName());
}