From 03c047f4a727f458743f47db7423c01405cfda2e Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 25 Sep 2013 09:19:25 +0200 Subject: [PATCH] config: Rename host_name to host. --- lib/icinga/host.cpp | 2 +- lib/icinga/icinga-type.conf | 11 ++++++----- lib/icinga/notification.cpp | 4 ++-- lib/icinga/service-notification.cpp | 2 +- lib/icinga/service.cpp | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/icinga/host.cpp b/lib/icinga/host.cpp index 5a46315ef..386114944 100644 --- a/lib/icinga/host.cpp +++ b/lib/icinga/host.cpp @@ -208,7 +208,7 @@ void Host::UpdateSlaveServices(void) ConfigItemBuilder::Ptr builder = boost::make_shared(di); builder->SetType("Service"); builder->SetName(name); - builder->AddExpression("host_name", OperatorSet, GetName()); + builder->AddExpression("host", OperatorSet, GetName()); builder->AddExpression("display_name", OperatorSet, svcname); builder->AddExpression("short_name", OperatorSet, svcname); diff --git a/lib/icinga/icinga-type.conf b/lib/icinga/icinga-type.conf index 0ae3803b4..c819a34c3 100644 --- a/lib/icinga/icinga-type.conf +++ b/lib/icinga/icinga-type.conf @@ -58,8 +58,8 @@ type IcingaApplication { } type Service { - %require "host_name", - %attribute string "host_name", + %require "host", + %attribute string "host", %attribute string "short_name", @@ -86,7 +86,8 @@ type Service { %attribute array "host_dependencies" { %attribute name(Host) "*" }, - %attribute array "service_dependencies" { + %attribute array "service_ + dependencies" { %attribute dictionary "*" { %require "host", %attribute name(Host) "host", @@ -115,8 +116,8 @@ type ServiceGroup { } type Notification { - %require "host_name", - %attribute name(Host) "host_name", + %require "host", + %attribute name(Host) "host", %attribute string "service", %attribute dictionary "macros" { diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index f018265b1..586ba6c4a 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -389,7 +389,7 @@ void Notification::InternalSerialize(const Dictionary::Ptr& bag, int attributeTy bag->Set("times", m_Times); bag->Set("notification_type_filter", m_NotificationTypeFilter); bag->Set("notification_state_filter", m_NotificationStateFilter); - bag->Set("host_name", m_HostName); + bag->Set("host", m_HostName); bag->Set("export_macros", m_ExportMacros); bag->Set("service", m_Service); } @@ -415,7 +415,7 @@ void Notification::InternalDeserialize(const Dictionary::Ptr& bag, int attribute m_Times = bag->Get("times"); m_NotificationTypeFilter = bag->Get("notification_type_filter"); m_NotificationStateFilter = bag->Get("notification_state_filter"); - m_HostName = bag->Get("host_name"); + m_HostName = bag->Get("host"); m_ExportMacros = bag->Get("export_macros"); m_Service = bag->Get("service"); } diff --git a/lib/icinga/service-notification.cpp b/lib/icinga/service-notification.cpp index 74ba4e6f6..0b91b0232 100644 --- a/lib/icinga/service-notification.cpp +++ b/lib/icinga/service-notification.cpp @@ -132,7 +132,7 @@ void Service::UpdateSlaveNotifications(void) ConfigItemBuilder::Ptr builder = boost::make_shared(di); builder->SetType("Notification"); builder->SetName(name); - builder->AddExpression("host_name", OperatorSet, GetHost()->GetName()); + builder->AddExpression("host", OperatorSet, GetHost()->GetName()); builder->AddExpression("service", OperatorSet, GetShortName()); if (!nfcdesc.IsObjectType()) diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index 2a5eda8a5..33493fc73 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -423,7 +423,7 @@ void Service::InternalSerialize(const Dictionary::Ptr& bag, int attributeTypes) bag->Set("event_command", m_EventCommand); bag->Set("volatile", m_Volatile); bag->Set("short_name", m_ShortName); - bag->Set("host_name", m_HostName); + bag->Set("host", m_HostName); bag->Set("flapping_threshold", m_FlappingThreshold); bag->Set("notifications", m_NotificationDescriptions); } @@ -481,7 +481,7 @@ void Service::InternalDeserialize(const Dictionary::Ptr& bag, int attributeTypes m_EventCommand = bag->Get("event_command"); m_Volatile = bag->Get("volatile"); m_ShortName = bag->Get("short_name"); - m_HostName = bag->Get("host_name"); + m_HostName = bag->Get("host"); m_FlappingThreshold = bag->Get("flapping_threshold"); m_NotificationDescriptions = bag->Get("notifications"); } -- 2.40.0