From f8d3052f393781db9ef4c96c76d0b244f22d3ff6 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Mon, 2 Jun 2014 16:57:59 +0200 Subject: [PATCH] Documentation: Add manual configuration migration hints for services. Refs #6380 --- doc/8-migration.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/doc/8-migration.md b/doc/8-migration.md index b7cc3b199..3c2834128 100644 --- a/doc/8-migration.md +++ b/doc/8-migration.md @@ -20,6 +20,61 @@ your configuration based on the proposed Icinga 2 configuration paradigm. Please read the [next chapter](#differences-1x-2) to find out more about the differences between 1.x and 2. +### Manual Config Migration Hints + +These hints should provide you enough details for manually migrating your configuration, +or to adapt your configuration export tool to dump Icinga 2 configuration instead of +Icinga 1.x configuration. + +If you require in-depth explainations, please check the [next chapter](#differences-1x-2). + +#### Manual Config Migration Hints for Services + +If you have used the `host_name` attribute in Icinga 1.x with one or more host names this service +belongs to, you can migrate this to the [apply rules](#using-apply) syntax. + +Icinga 1.x: + + define service { + service_description service1 + host_name localhost1,localhost2 + check_command test_check + use generic-service + } + +Icinga 2: + + apply Service "service1" { + import "generic-service" + check_command = "test_check" + + assign where host.name == "localhost1" + assign where host.name == "localhost2" + } + +In Icinga 1.x you would have organized your services with hostgroups using the `hostgroup_name` attribute +like the following example: + + define service { + service_description servicewithhostgroups + hostgroup_name hostgroup1,hostgroup3 + check_command test_check + use generic-service + } + +Using Icinga 2 you can migrate this to the [apply rules](#using-apply) syntax: + + apply Service "servicewithhostgroups" { + import "generic-service" + check_command = "test_check" + + assign where "hostgroup1" in host.groups + assign where "hostgroup3" in host.groups + } + + + + ## Differences between Icinga 1.x and 2 ### Configuration Format -- 2.40.0