[icinga-checkins] icinga.org: icinga2/next: Documentation: Add manual configuration migration hints for services.

git at icinga.org git at icinga.org
Mon Jun 2 16:58:30 CEST 2014


Module: icinga2
Branch: next
Commit: f8d3052f393781db9ef4c96c76d0b244f22d3ff6
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=f8d3052f393781db9ef4c96c76d0b244f22d3ff6

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Mon Jun  2 16:57:59 2014 +0200

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 b7cc3b1..3c28341 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.
 
+### <a id="manual-config-migration-hints"></a> 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).
+
+#### <a id="manual-config-migration-hints-services"></a> 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
+    }
+
+
+
+
 ## <a id="differences-1x-2"></a> Differences between Icinga 1.x and 2
 
 ### <a id="differences-1x-2-configuration-format"></a> Configuration Format



More information about the icinga-checkins mailing list