config: Rename Host::hostcheck to Host::check.

This commit is contained in:
Gunnar Beutner 2013-09-25 09:12:15 +02:00
parent 28a6db4e81
commit e766b4534f
14 changed files with 134 additions and 138 deletions

View File

@ -145,7 +145,7 @@ void CompatLog::CheckResultHandler(const Service::Ptr& service, const Dictionary
WriteLine(msgbuf.str());
}
if (service == host->GetHostCheckService()) {
if (service == host->GetCheckService()) {
std::ostringstream msgbuf;
msgbuf << "HOST ALERT: "
<< host->GetName() << ";"
@ -194,7 +194,7 @@ void CompatLog::TriggerDowntimeHandler(const Service::Ptr& service, const Dictio
WriteLine(msgbuf.str());
}
if (service == host->GetHostCheckService()) {
if (service == host->GetCheckService()) {
std::ostringstream msgbuf;
msgbuf << "HOST DOWNTIME ALERT: "
<< host->GetName() << ";"
@ -251,7 +251,7 @@ void CompatLog::RemoveDowntimeHandler(const Service::Ptr& service, const Diction
WriteLine(msgbuf.str());
}
if (service == host->GetHostCheckService()) {
if (service == host->GetCheckService()) {
std::ostringstream msgbuf;
msgbuf << "HOST DOWNTIME ALERT: "
<< host->GetName() << ";"
@ -325,7 +325,7 @@ void CompatLog::NotificationSentHandler(const Service::Ptr& service, const User:
WriteLine(msgbuf.str());
}
if (service == host->GetHostCheckService()) {
if (service == host->GetCheckService()) {
std::ostringstream msgbuf;
msgbuf << "HOST NOTIFICATION: "
<< user->GetName() << ";"
@ -392,7 +392,7 @@ void CompatLog::FlappingHandler(const Service::Ptr& service, FlappingState flapp
WriteLine(msgbuf.str());
}
if (service == host->GetHostCheckService()) {
if (service == host->GetCheckService()) {
std::ostringstream msgbuf;
msgbuf << "HOST FLAPPING ALERT: "
<< host->GetName() << ";"
@ -465,7 +465,7 @@ void CompatLog::ReopenFile(bool rotate)
WriteLine("LOG VERSION: 2.0");
BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjects<Host>()) {
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
continue;

View File

@ -246,7 +246,7 @@ void StatusDataWriter::DumpHostStatus(std::ostream& fp, const Host::Ptr& host)
fp << "hoststatus {" << "\n"
<< "\t" << "host_name=" << host->GetName() << "\n";
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
ObjectLock olock(hc);
if (hc)
@ -280,7 +280,7 @@ void StatusDataWriter::DumpHostObject(std::ostream& fp, const Host::Ptr& host)
fp << "\n";
}
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (hc) {
ObjectLock olock(hc);

View File

@ -161,7 +161,7 @@ Value HostGroupsTable::NumHostsPendingAccessor(const Value& row)
int num_hosts = 0;
BOOST_FOREACH(const Host::Ptr& host, static_cast<HostGroup::Ptr>(row)->GetMembers()) {
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
/* no hostcheck service or no checkresult */
if (!hc || !hc->GetLastCheckResult())

View File

@ -205,7 +205,7 @@ Value HostsTable::Address6Accessor(const Value& row)
Value HostsTable::CheckCommandAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -221,7 +221,7 @@ Value HostsTable::CheckCommandExpandedAccessor(const Value& row)
{
/* use hostcheck service */
Host::Ptr host = static_cast<Host::Ptr>(row);
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return Empty;
@ -267,7 +267,7 @@ Value HostsTable::CheckCommandExpandedAccessor(const Value& row)
Value HostsTable::EventHandlerAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -282,7 +282,7 @@ Value HostsTable::EventHandlerAccessor(const Value& row)
Value HostsTable::NotificationPeriodAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -303,7 +303,7 @@ Value HostsTable::NotificationPeriodAccessor(const Value& row)
Value HostsTable::CheckPeriodAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -329,7 +329,7 @@ Value HostsTable::NotesAccessor(const Value& row)
Value HostsTable::NotesExpandedAccessor(const Value& row)
{
Host::Ptr host = static_cast<Host::Ptr>(row);
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
Dictionary::Ptr custom = host->GetCustom();
if (!custom)
@ -364,7 +364,7 @@ Value HostsTable::NotesUrlAccessor(const Value& row)
Value HostsTable::NotesUrlExpandedAccessor(const Value& row)
{
Host::Ptr host = static_cast<Host::Ptr>(row);
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
Dictionary::Ptr custom = host->GetCustom();
if (!custom)
@ -399,7 +399,7 @@ Value HostsTable::ActionUrlAccessor(const Value& row)
Value HostsTable::ActionUrlExpandedAccessor(const Value& row)
{
Host::Ptr host = static_cast<Host::Ptr>(row);
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
Dictionary::Ptr custom = host->GetCustom();
if (!custom)
@ -424,7 +424,7 @@ Value HostsTable::ActionUrlExpandedAccessor(const Value& row)
Value HostsTable::PluginOutputAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
String output;
if(hc)
@ -436,7 +436,7 @@ Value HostsTable::PluginOutputAccessor(const Value& row)
Value HostsTable::PerfDataAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
String perfdata;
if (hc)
@ -458,7 +458,7 @@ Value HostsTable::IconImageAccessor(const Value& row)
Value HostsTable::IconImageExpandedAccessor(const Value& row)
{
Host::Ptr host = static_cast<Host::Ptr>(row);
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
Dictionary::Ptr custom = host->GetCustom();
if (!custom)
@ -503,7 +503,7 @@ Value HostsTable::StatusmapImageAccessor(const Value& row)
Value HostsTable::LongPluginOutputAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
String long_output;
if (hc)
@ -521,7 +521,7 @@ Value HostsTable::InitialStateAccessor(const Value& row)
Value HostsTable::MaxCheckAttemptsAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -532,7 +532,7 @@ Value HostsTable::MaxCheckAttemptsAccessor(const Value& row)
Value HostsTable::FlapDetectionEnabledAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -555,7 +555,7 @@ Value HostsTable::ProcessPerformanceDataAccessor(const Value& row)
Value HostsTable::AcceptPassiveChecksAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -572,7 +572,7 @@ Value HostsTable::EventHandlerEnabledAccessor(const Value& row)
Value HostsTable::AcknowledgementTypeAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -586,7 +586,7 @@ Value HostsTable::AcknowledgementTypeAccessor(const Value& row)
Value HostsTable::CheckTypeAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -607,7 +607,7 @@ Value HostsTable::LastHardStateAccessor(const Value& row)
Value HostsTable::CurrentAttemptAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -618,7 +618,7 @@ Value HostsTable::CurrentAttemptAccessor(const Value& row)
Value HostsTable::LastNotificationAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -636,7 +636,7 @@ Value HostsTable::LastNotificationAccessor(const Value& row)
Value HostsTable::NextNotificationAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -654,7 +654,7 @@ Value HostsTable::NextNotificationAccessor(const Value& row)
Value HostsTable::NextCheckAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -665,7 +665,7 @@ Value HostsTable::NextCheckAccessor(const Value& row)
Value HostsTable::LastHardStateChangeAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -676,7 +676,7 @@ Value HostsTable::LastHardStateChangeAccessor(const Value& row)
Value HostsTable::HasBeenCheckedAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -687,7 +687,7 @@ Value HostsTable::HasBeenCheckedAccessor(const Value& row)
Value HostsTable::CurrentNotificationNumberAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -717,7 +717,7 @@ Value HostsTable::TotalServicesAccessor(const Value& row)
Value HostsTable::ChecksEnabledAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -728,7 +728,7 @@ Value HostsTable::ChecksEnabledAccessor(const Value& row)
Value HostsTable::NotificationsEnabledAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -739,7 +739,7 @@ Value HostsTable::NotificationsEnabledAccessor(const Value& row)
Value HostsTable::AcknowledgedAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -763,7 +763,7 @@ Value HostsTable::StateTypeAccessor(const Value& row)
Value HostsTable::NoMoreNotificationsAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -790,7 +790,7 @@ Value HostsTable::CheckFlappingRecoveryNotificationAccessor(const Value& row)
Value HostsTable::LastCheckAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -821,7 +821,7 @@ Value HostsTable::LastTimeUnreachableAccessor(const Value& row)
Value HostsTable::IsFlappingAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -832,7 +832,7 @@ Value HostsTable::IsFlappingAccessor(const Value& row)
Value HostsTable::ScheduledDowntimeDepthAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -850,7 +850,7 @@ Value HostsTable::ActiveChecksEnabledAccessor(const Value& row)
{
/* duplicate of ChecksEnableAccessor */
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -885,7 +885,7 @@ Value HostsTable::ModifiedAttributesListAccessor(const Value& row)
Value HostsTable::CheckIntervalAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -896,7 +896,7 @@ Value HostsTable::CheckIntervalAccessor(const Value& row)
Value HostsTable::RetryIntervalAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -907,7 +907,7 @@ Value HostsTable::RetryIntervalAccessor(const Value& row)
Value HostsTable::NotificationIntervalAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -934,7 +934,7 @@ Value HostsTable::FirstNotificationDelayAccessor(const Value& row)
Value HostsTable::LowFlapThresholdAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -945,7 +945,7 @@ Value HostsTable::LowFlapThresholdAccessor(const Value& row)
Value HostsTable::HighFlapThresholdAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1010,7 +1010,7 @@ Value HostsTable::Y2dAccessor(const Value& row)
Value HostsTable::LatencyAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1021,7 +1021,7 @@ Value HostsTable::LatencyAccessor(const Value& row)
Value HostsTable::ExecutionTimeAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1032,7 +1032,7 @@ Value HostsTable::ExecutionTimeAccessor(const Value& row)
Value HostsTable::PercentStateChangeAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1043,7 +1043,7 @@ Value HostsTable::PercentStateChangeAccessor(const Value& row)
Value HostsTable::InNotificationPeriodAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1065,7 +1065,7 @@ Value HostsTable::InNotificationPeriodAccessor(const Value& row)
Value HostsTable::InCheckPeriodAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1082,7 +1082,7 @@ Value HostsTable::InCheckPeriodAccessor(const Value& row)
Value HostsTable::ContactsAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1114,7 +1114,7 @@ Value HostsTable::ContactsAccessor(const Value& row)
Value HostsTable::DowntimesAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1147,7 +1147,7 @@ Value HostsTable::DowntimesAccessor(const Value& row)
Value HostsTable::DowntimesWithInfoAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1184,7 +1184,7 @@ Value HostsTable::DowntimesWithInfoAccessor(const Value& row)
Value HostsTable::CommentsAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1217,7 +1217,7 @@ Value HostsTable::CommentsAccessor(const Value& row)
Value HostsTable::CommentsWithInfoAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1254,7 +1254,7 @@ Value HostsTable::CommentsWithInfoAccessor(const Value& row)
Value HostsTable::CommentsWithExtraInfoAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1550,7 +1550,7 @@ Value HostsTable::NumServicesHardUnknownAccessor(const Value& row)
Value HostsTable::HardStateAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1572,7 +1572,7 @@ Value HostsTable::PnpgraphPresentAccessor(const Value& row)
Value HostsTable::StalenessAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;
@ -1596,7 +1596,7 @@ Value HostsTable::GroupsAccessor(const Value& row)
Value HostsTable::ContactGroupsAccessor(const Value& row)
{
/* use hostcheck service */
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetHostCheckService();
Service::Ptr hc = static_cast<Host::Ptr>(row)->GetCheckService();
if (!hc)
return Empty;

View File

@ -96,8 +96,8 @@ Dictionary::Ptr CompatUtility::GetHostConfigAttributes(const Host::Ptr& host)
else
attr->Set("alias", host->GetDisplayName());
/* get additonal attributes from hostcheck service */
Service::Ptr service = host->GetHostCheckService();
/* get additonal attributes from check service */
Service::Ptr service = host->GetCheckService();
if (service) {
unsigned long notification_type_filter;

View File

@ -180,7 +180,7 @@ void ExternalCommandProcessor::ProcessHostCheckResult(double time, const std::ve
Host::Ptr host = Host::GetByName(arguments[0]);
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc->GetEnablePassiveChecks())
BOOST_THROW_EXCEPTION(std::invalid_argument("Got passive check result for host '" + arguments[0] + "' which has passive checks disabled."));
@ -248,7 +248,7 @@ void ExternalCommandProcessor::ScheduleHostCheck(double, const std::vector<Strin
Host::Ptr host = Host::GetByName(arguments[0]);
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc) {
Log(LogInformation, "icinga", "Ignoring request request for host '" +
@ -283,7 +283,7 @@ void ExternalCommandProcessor::ScheduleForcedHostCheck(double, const std::vector
Host::Ptr host = Host::GetByName(arguments[0]);
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc) {
Log(LogInformation, "icinga", "Ignoring request request for host '" +
@ -353,7 +353,7 @@ void ExternalCommandProcessor::EnableHostCheck(double, const std::vector<String>
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Enabling active checks for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;
@ -373,7 +373,7 @@ void ExternalCommandProcessor::DisableHostCheck(double, const std::vector<String
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Disabling active checks for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;
@ -569,7 +569,7 @@ void ExternalCommandProcessor::AcknowledgeHostProblem(double, const std::vector<
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Setting acknowledgement for host '" + host->GetName() + "'");
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
if (service) {
if (service->GetState() == StateOK)
BOOST_THROW_EXCEPTION(std::invalid_argument("The host '" + arguments[0] + "' is OK."));
@ -590,7 +590,7 @@ void ExternalCommandProcessor::AcknowledgeHostProblemExpire(double, const std::v
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Setting timed acknowledgement for host '" + host->GetName() + "'");
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
if (service) {
if (service->GetState() == StateOK)
BOOST_THROW_EXCEPTION(std::invalid_argument("The host '" + arguments[0] + "' is OK."));
@ -608,7 +608,7 @@ void ExternalCommandProcessor::RemoveHostAcknowledgement(double, const std::vect
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Removing acknowledgement for host '" + host->GetName() + "'");
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
if (service)
service->ClearAcknowledgement();
}
@ -697,7 +697,7 @@ void ExternalCommandProcessor::EnablePassiveHostChecks(double, const std::vector
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Enabling passive checks for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;
@ -717,7 +717,7 @@ void ExternalCommandProcessor::DisablePassiveHostChecks(double, const std::vecto
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Disabling passive checks for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;
@ -914,7 +914,7 @@ void ExternalCommandProcessor::ScheduleHostDowntime(double, const std::vector<St
triggeredBy = Service::GetDowntimeIDFromLegacyID(triggeredByLegacy);
Log(LogInformation, "icinga", "Creating downtime for host " + host->GetName());
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
if (service) {
String comment_id = service->AddComment(CommentDowntime, arguments[6], arguments[7], Convert::ToDouble(arguments[2]));
(void) service->AddDowntime(comment_id,
@ -969,7 +969,7 @@ void ExternalCommandProcessor::ScheduleHostgroupHostDowntime(double, const std::
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
Log(LogInformation, "icinga", "Creating downtime for host " + host->GetName());
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
if (service) {
String comment_id = service->AddComment(CommentDowntime, arguments[6], arguments[7], Convert::ToDouble(arguments[2]));
(void) service->AddDowntime(comment_id,
@ -1032,7 +1032,7 @@ void ExternalCommandProcessor::ScheduleServicegroupHostDowntime(double, const st
BOOST_FOREACH(const Service::Ptr& service, sg->GetMembers()) {
Host::Ptr host = service->GetHost();
Service::Ptr hcService = host->GetHostCheckService();
Service::Ptr hcService = host->GetCheckService();
if (hcService)
services.insert(hcService);
}
@ -1075,7 +1075,7 @@ void ExternalCommandProcessor::AddHostComment(double, const std::vector<String>&
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Creating comment for host " + host->GetName());
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
if (service)
(void) service->AddComment(CommentUser, arguments[2], arguments[3], 0);
}
@ -1122,7 +1122,7 @@ void ExternalCommandProcessor::DelAllHostComments(double, const std::vector<Stri
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Removing all comments for host " + host->GetName());
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
if (service)
service->RemoveAllComments();
}
@ -1147,7 +1147,7 @@ void ExternalCommandProcessor::SendCustomHostNotification(double, const std::vec
int options = Convert::ToLong(arguments[1]);
Log(LogInformation, "icinga", "Sending custom notification for host " + host->GetName());
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
if (service) {
if (options & 2) {
ObjectLock olock(service);
@ -1184,7 +1184,7 @@ void ExternalCommandProcessor::DelayHostNotification(double, const std::vector<S
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Delaying notifications for host " + host->GetName());
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;
@ -1219,7 +1219,7 @@ void ExternalCommandProcessor::EnableHostNotifications(double, const std::vector
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Enabling notifications for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;
@ -1239,7 +1239,7 @@ void ExternalCommandProcessor::DisableHostNotifications(double, const std::vecto
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Disabling notifications for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;
@ -1291,7 +1291,7 @@ void ExternalCommandProcessor::DisableHostgroupHostChecks(double, const std::vec
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
continue;
@ -1314,7 +1314,7 @@ void ExternalCommandProcessor::DisableHostgroupPassiveHostChecks(double, const s
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
continue;
@ -1342,7 +1342,7 @@ void ExternalCommandProcessor::DisableServicegroupHostChecks(double, const std::
if (!host)
continue;
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
continue;
@ -1370,7 +1370,7 @@ void ExternalCommandProcessor::DisableServicegroupPassiveHostChecks(double, cons
if (!host)
continue;
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
continue;
@ -1393,7 +1393,7 @@ void ExternalCommandProcessor::EnableHostgroupHostChecks(double, const std::vect
HostGroup::Ptr hg = HostGroup::GetByName(arguments[0]);
BOOST_FOREACH(const Host::Ptr& host, hg->GetMembers()) {
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
continue;
@ -1428,7 +1428,7 @@ void ExternalCommandProcessor::EnableServicegroupHostChecks(double, const std::v
if (!host)
continue;
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
continue;
@ -1456,7 +1456,7 @@ void ExternalCommandProcessor::EnableServicegroupPassiveHostChecks(double, const
if (!host)
continue;
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
continue;
@ -1479,7 +1479,7 @@ void ExternalCommandProcessor::EnableHostFlapping(double, const std::vector<Stri
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Enabling flapping detection for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;
@ -1499,7 +1499,7 @@ void ExternalCommandProcessor::DisableHostFlapping(double, const std::vector<Str
Host::Ptr host = Host::GetByName(arguments[0]);
Log(LogInformation, "icinga", "Disabling flapping detection for host '" + arguments[0] + "'");
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
if (!hc)
return;

View File

@ -111,9 +111,9 @@ Array::Ptr Host::GetServiceDependencies(void) const
return m_ServiceDependencies;
}
String Host::GetHostCheck(void) const
String Host::GetCheck(void) const
{
return m_HostCheck;
return m_Check;
}
Dictionary::Ptr Host::GetNotificationDescriptions(void) const
@ -149,9 +149,9 @@ bool Host::IsReachable(void) const
std::set<Host::Ptr> parentHosts = GetParentHosts();
BOOST_FOREACH(const Host::Ptr& host, parentHosts) {
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
/* ignore hosts that don't have a hostcheck */
/* ignore hosts that don't have a check */
if (!hc)
continue;
@ -350,9 +350,9 @@ std::set<Host::Ptr> Host::GetChildHosts(void) const
}
Service::Ptr Host::GetHostCheckService(void) const
Service::Ptr Host::GetCheckService(void) const
{
String host_check = GetHostCheck();
String host_check = GetCheck();
if (host_check.IsEmpty())
return Service::Ptr();
@ -398,7 +398,7 @@ HostState Host::GetState(void) const
if (!IsReachable())
return HostUnreachable;
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return HostUp;
@ -420,7 +420,7 @@ HostState Host::GetLastState(void) const
if (!IsReachable())
return HostUnreachable;
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return HostUp;
@ -441,7 +441,7 @@ HostState Host::GetLastHardState(void) const
if (!IsReachable())
return HostUnreachable;
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return HostUp;
@ -459,7 +459,7 @@ double Host::GetLastStateUp(void) const
{
ASSERT(!OwnsLock());
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return 0;
@ -474,7 +474,7 @@ double Host::GetLastStateDown(void) const
{
ASSERT(!OwnsLock());
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return 0;
@ -486,7 +486,7 @@ double Host::GetLastStateUnreachable(void) const
{
ASSERT(!OwnsLock());
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return 0;
@ -496,7 +496,7 @@ double Host::GetLastStateUnreachable(void) const
double Host::GetLastStateChange(void) const
{
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return IcingaApplication::GetInstance()->GetStartTime();
@ -507,7 +507,7 @@ double Host::GetLastStateChange(void) const
double Host::GetLastHardStateChange(void) const
{
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return IcingaApplication::GetInstance()->GetStartTime();
@ -517,7 +517,7 @@ double Host::GetLastHardStateChange(void) const
StateType Host::GetLastStateType(void) const
{
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return StateTypeHard;
@ -527,7 +527,7 @@ StateType Host::GetLastStateType(void) const
StateType Host::GetStateType(void) const
{
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
if (!hc)
return StateTypeHard;
@ -560,7 +560,7 @@ bool Host::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res
return true;
}
Service::Ptr hc = GetHostCheckService();
Service::Ptr hc = GetCheckService();
Dictionary::Ptr hccr;
if (hc) {
@ -665,7 +665,7 @@ void Host::InternalSerialize(const Dictionary::Ptr& bag, int attributeTypes) con
bag->Set("macros", m_Macros);
bag->Set("hostdependencies", m_HostDependencies);
bag->Set("servicedependencies", m_ServiceDependencies);
bag->Set("hostcheck", m_HostCheck);
bag->Set("check", m_Check);
bag->Set("services", m_ServiceDescriptions);
bag->Set("notifications", m_NotificationDescriptions);
}
@ -681,7 +681,7 @@ void Host::InternalDeserialize(const Dictionary::Ptr& bag, int attributeTypes)
m_Macros = bag->Get("macros");
m_HostDependencies = bag->Get("hostdependencies");
m_ServiceDependencies = bag->Get("servicedependencies");
m_HostCheck = bag->Get("hostcheck");
m_Check = bag->Get("check");
m_ServiceDescriptions = bag->Get("services");
m_NotificationDescriptions = bag->Get("notifications");
}

View File

@ -85,11 +85,11 @@ public:
Dictionary::Ptr GetMacros(void) const;
Array::Ptr GetHostDependencies(void) const;
Array::Ptr GetServiceDependencies(void) const;
String GetHostCheck(void) const;
String GetCheck(void) const;
//Dictionary::Ptr GetServiceDescriptions(void) const;
Dictionary::Ptr GetNotificationDescriptions(void) const;
shared_ptr<Service> GetHostCheckService(void) const;
shared_ptr<Service> GetCheckService(void) const;
std::set<Host::Ptr> GetParentHosts(void) const;
std::set<Host::Ptr> GetChildHosts(void) const;
std::set<shared_ptr<Service> > GetParentServices(void) const;
@ -136,7 +136,7 @@ private:
Dictionary::Ptr m_Macros;
Array::Ptr m_HostDependencies;
Array::Ptr m_ServiceDependencies;
String m_HostCheck;
String m_Check;
Dictionary::Ptr m_ServiceDescriptions;
Dictionary::Ptr m_NotificationDescriptions;

View File

@ -47,7 +47,7 @@ type Host {
%attribute dictionary "macros" {
%attribute string "*"
},
}
}
type HostGroup {
@ -78,9 +78,6 @@ type Service {
%attribute name(EventCommand) "event_command",
%attribute number "notification_interval",
%attribute name(TimePeriod) "notification_period",
%attribute number "enable_flapping",
%attribute number "flapping_threshold",

View File

@ -58,7 +58,7 @@ Service::Ptr Notification::GetService(void) const
return Service::Ptr();
if (m_Service.IsEmpty())
return host->GetHostCheckService();
return host->GetCheckService();
else
return host->GetServiceByShortName(m_Service);
}

View File

@ -539,7 +539,7 @@ void Service::ProcessCheckResult(const Dictionary::Ptr& cr, const String& author
/* reschedule host dependencies */
BOOST_FOREACH(const Host::Ptr& parent, GetParentHosts()) {
Service::Ptr service = parent->GetHostCheckService();
Service::Ptr service = parent->GetCheckService();
if (service && service->GetName() != GetName()) {
ObjectLock olock(service);

View File

@ -143,7 +143,7 @@ bool Service::IsHostCheck(void) const
{
ASSERT(!OwnsLock());
Service::Ptr hc = GetHost()->GetHostCheckService();
Service::Ptr hc = GetHost()->GetCheckService();
if (!hc)
return false;
@ -180,7 +180,7 @@ bool Service::IsReachable(void) const
}
BOOST_FOREACH(const Host::Ptr& host, GetParentHosts()) {
Service::Ptr hc = host->GetHostCheckService();
Service::Ptr hc = host->GetCheckService();
/* ignore hosts that don't have a hostcheck */
if (!hc)

View File

@ -44,7 +44,7 @@ Dictionary::Ptr HostDbObject::GetConfigFields(void) const
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
Host::Ptr host = static_pointer_cast<Host>(GetObject());
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
Dictionary::Ptr attrs;
@ -126,13 +126,12 @@ Dictionary::Ptr HostDbObject::GetStatusFields(void) const
{
Dictionary::Ptr fields = boost::make_shared<Dictionary>();
Host::Ptr host = static_pointer_cast<Host>(GetObject());
Service::Ptr service = host->GetHostCheckService();
Service::Ptr service = host->GetCheckService();
Dictionary::Ptr attrs;
/* fetch service status, or dump a pending hoststatus */
if (service) {
ObjectLock olock(service);
attrs = CompatUtility::GetServiceStatusAttributes(service, CompatTypeHost);

View File

@ -268,7 +268,7 @@ void ServiceDbObject::OnConfigUpdate(void)
if (!host)
return;
if (host->GetHostCheckService() != service)
if (host->GetCheckService() != service)
return;
DbObject::Ptr dbobj = GetOrCreateByObject(host);
@ -288,7 +288,7 @@ void ServiceDbObject::OnStatusUpdate(void)
if (!host)
return;
if (host->GetHostCheckService() != service)
if (host->GetCheckService() != service)
return;
DbObject::Ptr dbobj = GetOrCreateByObject(host);
@ -334,7 +334,7 @@ void ServiceDbObject::AddComment(const Service::Ptr& service, const Dictionary::
AddCommentByType(service, comment);
/* add the hostcheck service comment to the host as well */
if (host->GetHostCheckService() == service) {
if (host->GetCheckService() == service) {
Log(LogDebug, "ido", "adding host comment (id = " + comment->Get("legacy_id") + ") for '" + host->GetName() + "'");
AddCommentByType(host, comment);
}
@ -404,7 +404,7 @@ void ServiceDbObject::RemoveComments(const Service::Ptr& service)
OnQuery(query1);
/* delete hostcheck service's host comments */
if (host->GetHostCheckService() == service) {
if (host->GetCheckService() == service) {
DbQuery query2;
query2.Table = "comments";
query2.Type = DbQueryDelete;
@ -438,7 +438,7 @@ void ServiceDbObject::RemoveComment(const Service::Ptr& service, const Dictionar
OnQuery(query1);
/* delete hostcheck service's host comments */
if (host->GetHostCheckService() == service) {
if (host->GetCheckService() == service) {
DbQuery query2;
query2.Table = "comments";
query2.Type = DbQueryDelete;
@ -506,7 +506,7 @@ void ServiceDbObject::AddDowntime(const Service::Ptr& service, const Dictionary:
AddDowntimeByType(service, downtime);
/* add the hostcheck service downtime to the host as well */
if (host->GetHostCheckService() == service) {
if (host->GetCheckService() == service) {
Log(LogDebug, "ido", "adding host downtime (id = " + downtime->Get("legacy_id") + ") for '" + host->GetName() + "'");
AddDowntimeByType(host, downtime);
}
@ -575,7 +575,7 @@ void ServiceDbObject::RemoveDowntimes(const Service::Ptr& service)
OnQuery(query1);
/* delete hostcheck service's host downtimes */
if (host->GetHostCheckService() == service) {
if (host->GetCheckService() == service) {
DbQuery query2;
query2.Table = "scheduleddowntime";
query2.Type = DbQueryDelete;
@ -609,7 +609,7 @@ void ServiceDbObject::RemoveDowntime(const Service::Ptr& service, const Dictiona
OnQuery(query1);
/* delete hostcheck service's host comments */
if (host->GetHostCheckService() == service) {
if (host->GetCheckService() == service) {
DbQuery query2;
query2.Table = "scheduleddowntime";
query2.Type = DbQueryDelete;
@ -683,7 +683,7 @@ void ServiceDbObject::TriggerDowntime(const Service::Ptr& service, const Diction
OnQuery(query1);
/* delete hostcheck service's host comments */
if (host->GetHostCheckService() == service) {
if (host->GetCheckService() == service) {
DbQuery query2;
query2.Table = "scheduleddowntime";
@ -762,7 +762,7 @@ void ServiceDbObject::AddAcknowledgement(const Service::Ptr& service, const Stri
query1.Fields = fields1;
OnQuery(query1);
if (host->GetHostCheckService() == service) {
if (host->GetCheckService() == service) {
DbQuery query2;
query2.Table = "acknowledgements";
@ -829,12 +829,12 @@ void ServiceDbObject::AddNotification(const Service::Ptr& service, const std::se
query1.Fields = fields1;
OnQuery(query1);
if (host->GetHostCheckService() == service) {
DbQuery query1;
query1.Table = "notifications";
query1.Type = DbQueryInsert;
if (host->GetCheckService() == service) {
DbQuery query1;
query1.Table = "notifications";
query1.Type = DbQueryInsert;
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
Dictionary::Ptr fields1 = boost::make_shared<Dictionary>();
DbQuery query2;
query2.Table = "notifications";
query2.Type = DbQueryInsert;