From: Gunnar Beutner Date: Sat, 9 Feb 2013 16:50:47 +0000 (+0100) Subject: Removed alias property, added display_name. X-Git-Tag: v0.0.2~478 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84482bb39d2ff5aec170e63e8f4ff11622ad3d07;p=icinga2 Removed alias property, added display_name. --- diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp index 5332bbae5..dc56bbcf3 100644 --- a/components/compat/compatcomponent.cpp +++ b/components/compat/compatcomponent.cpp @@ -279,7 +279,7 @@ void CompatComponent::DumpHostObject(ofstream& fp, const Host::Ptr& host) { fp << "define host {" << "\n" << "\t" << "host_name" << "\t" << host->GetName() << "\n" - << "\t" << "alias" << "\t" << host->GetAlias() << "\n" + << "\t" << "display_name" << "\t" << host->GetDisplayName() << "\n" << "\t" << "check_interval" << "\t" << 1 << "\n" << "\t" << "retry_interval" << "\t" << 1 << "\n" << "\t" << "max_check_attempts" << "\t" << 1 << "\n" @@ -380,7 +380,7 @@ void CompatComponent::DumpServiceObject(ofstream& fp, const Service::Ptr& servic fp << "define service {" << "\n" << "\t" << "host_name" << "\t" << service->GetHost()->GetName() << "\n" << "\t" << "service_description" << "\t" << service->GetShortName() << "\n" - << "\t" << "display_name" << "\t" << service->GetAlias() << "\n" + << "\t" << "display_name" << "\t" << service->GetDisplayName() << "\n" << "\t" << "check_command" << "\t" << "check_i2" << "\n" << "\t" << "check_interval" << "\t" << service->GetCheckInterval() / 60.0 << "\n" << "\t" << "retry_interval" << "\t" << service->GetRetryInterval() / 60.0 << "\n" @@ -471,7 +471,7 @@ void CompatComponent::StatusTimerHandler(void) objectfp << "define hostgroup {" << "\n" << "\t" << "hostgroup_name" << "\t" << hg->GetName() << "\n" - << "\t" << "alias" << "\t" << hg->GetAlias() << "\n" + << "\t" << "display_name" << "\t" << hg->GetDisplayName() << "\n" << "\t" << "notes_url" << "\t" << hg->GetNotesUrl() << "\n" << "\t" << "action_url" << "\t" << hg->GetActionUrl() << "\n"; @@ -493,7 +493,7 @@ void CompatComponent::StatusTimerHandler(void) objectfp << "define servicegroup {" << "\n" << "\t" << "servicegroup_name" << "\t" << sg->GetName() << "\n" - << "\t" << "alias" << "\t" << sg->GetAlias() << "\n" + << "\t" << "display_name" << "\t" << sg->GetDisplayName() << "\n" << "\t" << "notes_url" << "\t" << sg->GetNotesUrl() << "\n" << "\t" << "action_url" << "\t" << sg->GetActionUrl() << "\n"; diff --git a/components/compatido/compatidocomponent.cpp b/components/compatido/compatidocomponent.cpp index f5a4b4bb9..894fba0d1 100644 --- a/components/compatido/compatidocomponent.cpp +++ b/components/compatido/compatidocomponent.cpp @@ -307,7 +307,7 @@ void CompatIdoComponent::EnableServiceObject(const Service::Ptr& service) << 500 << ":" << "\n" /* enableobject */ << 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */ << 53 << "=" << service->GetHost()->GetName() << "\n" /* host */ - << 114 << "=" << service->GetAlias() << "\n" /* service */ + << 114 << "=" << service->GetShortName() << "\n" /* service */ << 999 << "\n\n"; /* enddata */ m_IdoConnection->SendMessage(message.str()); @@ -338,7 +338,7 @@ void CompatIdoComponent::DisableServiceObject(const Service::Ptr& service) << 501 << ":" << "\n" /* disableobject */ << 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */ << 53 << "=" << service->GetHost()->GetName() << "\n" /* host */ - << 114 << "=" << service->GetAlias() << "\n" /* service */ + << 114 << "=" << service->GetShortName() << "\n" /* service */ << 999 << "\n\n"; /* enddata */ m_IdoConnection->SendMessage(message.str()); @@ -360,8 +360,8 @@ void CompatIdoComponent::DumpHostObject(const Host::Ptr& host) << 400 << ":" << "\n" /* hostdefinition */ << 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */ << 174 << "=" << host->GetName() << "\n" /* hostname */ - << 258 << "=" << host->GetAlias() << "\n" /* displayname */ - << 159 << "=" << host->GetAlias() << "\n" /* hostalias */ + << 258 << "=" << host->GetDisplayName() << "\n" /* displayname */ + << 159 << "=" << host->GetName() << "\n" /* hostalias */ << 158 << "=" << host->GetName() << "\n" /* hostaddress */ << 266 << "=" << host->GetName() << "\n" /* hostaddress6 */ << 160 << "=" << "" << "\n" /* hostcheckcommand */ @@ -511,7 +511,7 @@ void CompatIdoComponent::DumpHostStatus(const Host::Ptr& host) void CompatIdoComponent::DumpServiceObject(const Service::Ptr& service) { stringstream log; - log << "Dumping Service Config: " << service->GetHost()->GetName() << "->" << service->GetAlias(); + log << "Dumping Service Config: " << service->GetHost()->GetName() << "->" << service->GetShortName(); Logger::Write(LogDebug, "compatido", log.str()); stringstream message; @@ -519,8 +519,8 @@ void CompatIdoComponent::DumpServiceObject(const Service::Ptr& service) << 402 << ":" << "\n" /* servicedefinition */ << 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */ << 174 << "=" << service->GetHost()->GetName() << "\n" /* hostname */ - << 258 << "=" << service->GetAlias() << "\n" /* displayname */ - << 210 << "=" << service->GetAlias() << "\n" /* servicedescription */ + << 258 << "=" << service->GetDisplayName() << "\n" /* displayname */ + << 210 << "=" << service->GetShortName() << "\n" /* servicedescription */ << 207 << "=" << "check_i2" << "\n" /* servicecheckcommand */ << 211 << "=" << "" << "\n" /* serviceeventhandler */ << 224 << "=" << "" << "\n" /* servicenotificationperiod */ @@ -585,7 +585,7 @@ void CompatIdoComponent::DumpServiceObject(const Service::Ptr& service) void CompatIdoComponent::DumpServiceStatus(const Service::Ptr& service) { stringstream log; - log << "Dumping Service Status: " << service->GetHost()->GetName() << "->" << service->GetAlias(); + log << "Dumping Service Status: " << service->GetHost()->GetName() << "->" << service->GetShortName(); Logger::Write(LogDebug, "compatido", log.str()); String output; @@ -620,7 +620,7 @@ void CompatIdoComponent::DumpServiceStatus(const Service::Ptr& service) << 3 << "=" << "" << "\n" /* attributes */ << 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */ << 53 << "=" << service->GetHost()->GetName() << "\n" /* host */ - << 114 << "=" << service->GetAlias() << "\n" /* service */ + << 114 << "=" << service->GetShortName() << "\n" /* service */ << 95 << "=" << output << "\n" /* output */ << 125 << "=" << "" << "\n" /* longoutput */ << 99 << "=" << perfdata << "\n" /* perfdata */ @@ -755,7 +755,7 @@ void CompatIdoComponent::DumpConfigObjects(void) << 401 << ":" << "\n" /* hostgroupdefinition */ << 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */ << 172 << "=" << hg->GetName() << "\n" /* hostgroupname */ - << 170 << "=" << hg->GetAlias() << "\n"; /* hostgroupalias */ + << 170 << "=" << hg->GetName() << "\n"; /* hostgroupalias */ vector hglist; @@ -788,14 +788,14 @@ void CompatIdoComponent::DumpConfigObjects(void) << 403 << ":" << "\n" /* servicegroupdefinition */ << 4 << "=" << std::setprecision(17) << Utility::GetTime() << "\n" /* timestamp */ << 220 << "=" << sg->GetName() << "\n" /* servicegroupname */ - << 218 << "=" << sg->GetAlias() << "\n"; /* servicegroupalias */ + << 218 << "=" << sg->GetName() << "\n"; /* servicegroupalias */ vector sglist; vector::iterator vt; BOOST_FOREACH(const Service::Ptr& service, sg->GetMembers()) { sglist.push_back(service->GetHost()->GetName()); - sglist.push_back(service->GetAlias()); + sglist.push_back(service->GetShortName()); } SendMessageList(message, sglist, 219); /* servicegroupmember */ diff --git a/lib/icinga/host.cpp b/lib/icinga/host.cpp index 48a14a829..a0bf5ea20 100644 --- a/lib/icinga/host.cpp +++ b/lib/icinga/host.cpp @@ -57,7 +57,7 @@ Host::~Host(void) } } -String Host::GetAlias(void) const +String Host::GetDisplayName(void) const { String value = Get("alias"); if (!value.IsEmpty()) diff --git a/lib/icinga/host.h b/lib/icinga/host.h index 41b0f2d71..224414a61 100644 --- a/lib/icinga/host.h +++ b/lib/icinga/host.h @@ -43,7 +43,7 @@ public: static bool Exists(const String& name); static Host::Ptr GetByName(const String& name); - String GetAlias(void) const; + String GetDisplayName(void) const; Dictionary::Ptr GetGroups(void) const; Dictionary::Ptr GetMacros(void) const; diff --git a/lib/icinga/hostgroup.cpp b/lib/icinga/hostgroup.cpp index 137768c72..b09946d7c 100644 --- a/lib/icinga/hostgroup.cpp +++ b/lib/icinga/hostgroup.cpp @@ -26,7 +26,7 @@ bool HostGroup::m_MembersCacheValid = true; REGISTER_TYPE(HostGroup, NULL); -String HostGroup::GetAlias(void) const +String HostGroup::GetDisplayName(void) const { String value = Get("alias"); diff --git a/lib/icinga/hostgroup.h b/lib/icinga/hostgroup.h index 4c6079a44..a3c28760c 100644 --- a/lib/icinga/hostgroup.h +++ b/lib/icinga/hostgroup.h @@ -41,7 +41,7 @@ public: static bool Exists(const String& name); static HostGroup::Ptr GetByName(const String& name); - String GetAlias(void) const; + String GetDisplayName(void) const; String GetNotesUrl(void) const; String GetActionUrl(void) const; diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index 41858a657..a614d886b 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -70,7 +70,7 @@ Service::~Service(void) Service::InvalidateCommentCache(); } -String Service::GetAlias(void) const +String Service::GetDisplayName(void) const { String value = Get("alias"); diff --git a/lib/icinga/service.h b/lib/icinga/service.h index f8033b14a..dfda3399b 100644 --- a/lib/icinga/service.h +++ b/lib/icinga/service.h @@ -98,7 +98,7 @@ public: static const int DefaultCheckInterval; static const int CheckIntervalDivisor; - String GetAlias(void) const; + String GetDisplayName(void) const; Host::Ptr GetHost(void) const; Dictionary::Ptr GetMacros(void) const; Dictionary::Ptr GetDowntimes(void) const; diff --git a/lib/icinga/servicegroup.cpp b/lib/icinga/servicegroup.cpp index 7479a68cd..3c4b09160 100644 --- a/lib/icinga/servicegroup.cpp +++ b/lib/icinga/servicegroup.cpp @@ -26,7 +26,7 @@ bool ServiceGroup::m_MembersCacheValid; REGISTER_TYPE(ServiceGroup, NULL); -String ServiceGroup::GetAlias(void) const +String ServiceGroup::GetDisplayName(void) const { String value = Get("alias"); diff --git a/lib/icinga/servicegroup.h b/lib/icinga/servicegroup.h index c8dbd8da8..b7ed56318 100644 --- a/lib/icinga/servicegroup.h +++ b/lib/icinga/servicegroup.h @@ -41,7 +41,7 @@ public: static bool Exists(const String& name); static ServiceGroup::Ptr GetByName(const String& name); - String GetAlias(void) const; + String GetDisplayName(void) const; String GetNotesUrl(void) const; String GetActionUrl(void) const;