[icinga-checkins] icinga.org: icinga2-migration/master: Update README.md

git at icinga.org git at icinga.org
Sat Jun 14 21:36:25 CEST 2014


Module: icinga2-migration
Branch: master
Commit: 2175b05cd91eaeb6cbec8c4fe99dc7c17bcf043f
URL:    https://git.icinga.org/?p=icinga2-migration.git;a=commit;h=2175b05cd91eaeb6cbec8c4fe99dc7c17bcf043f

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Sat Jun 14 20:07:50 2014 +0200

Update README.md

---

 README         |    1 -
 README.md      |  111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 run => bin/run |   11 ++++--
 3 files changed, 119 insertions(+), 4 deletions(-)

diff --git a/README b/README
deleted file mode 100644
index fa7c61e..0000000
--- a/README
+++ /dev/null
@@ -1 +0,0 @@
-Icinga 1.x to 2.x Migration Tools.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d6724e0
--- /dev/null
+++ b/README.md
@@ -0,0 +1,111 @@
+# Icinga 2 Migration Script
+
+This standalone script allows you to migrate the basic Icinga 1.x
+object configuration into native Icinga 2 configuration objects.
+
+> **Note**
+>
+> You are highly advised to read the Icinga 2 Migration documentation
+> and understand the new dynamic configuration syntax.
+>
+> Check the manual migration hints and also manually migrate the
+> configuration.
+
+## General Information
+
+This script is a bootstrapped standalone version of the Icinga Web 2 CLI
+module for configuration migration from Icinga 1.x to 2.x.
+
+> **Note**
+>
+> This project will be merged into the upstream CLI once there is
+> a stable release. Meanwhile it acts as standalone helper tool
+> for migrating to Icinga 2.
+
+## Requirements
+
+* Apache2 with PHP >= 5.3.0 enabled
+* PHP Zend Framework
+
+Debian requires the `zendframework` package installed.
+RHEL/CentOS requires the EPEL repository enabled (which provides the `php-ZendFramework`
+package). OpenSUSE requires the [server monitoring](https://build.opensuse.org/project/show/server:monitoring) repository (which provides the `php5-ZendFramework` package) enabled.
+
+## Icinga 1.x to 2.x Migration
+
+Call the migrate command action pointing to your Icinga 1.x main
+configuration file and pipe the output to a file included in your
+Icinga 2 configuration:
+
+ $ sudo bin/icinga-conftool migrate v1 /etc/icinga/icinga.cfg > /tmp/migrate.conf
+
+An example for validating the generated objects against a bootstrapped icinga2
+config is located in `bin/run`.
+
+
+## Manual Migration Required
+
+Currently the following Icinga 1.x objects must be migrated manually:
+
+* Escalations
+* Dependencies
+
+These objects are either not directly compatible, or would lead into
+(logic) errors without knowing about your configuration strategy.
+
+Furthermore, these Icinga 1.x specifics are not supported either:
+
+* Regular expressions and wildcard matching
+* Invalid objects ('name' instead of 'service_description' for service objects)
+* Invalid templates (missing 'name' attribute)
+
+
+## Automatic Migration
+
+This is by far an imcomplete list, but shows the general approach of
+this migration script:
+
+* All compatible object attributes
+* Keep the template tree (`register 0` -> `template`) and import these templates (`use` -> `import`)
+* Keep service relation ship to `host_name` and `hostgroup_name`
+* Use the apply rules wherever possible (e.g. for service with `hostgroup_name` attribute)
+* Assign group members directly
+* Migrate host/service contacts for notifications into the new Notification logic
+* Create additional `EventCommand` objects for event handler migration
+* Create additional `NotificationCommand` objects for notification migration
+* Migrate the ARGn command arguments into custom attributes for commands
+* Replace runtime macros in command line for check, event, notification commands
+* Replace runtime macros in notes, notes_url, action_url, icon_image attributes
+* Treat all intervals as minute duration literal - append `m`
+* All comma separated lists are converted into arrays, if possible (except contacts for notifications)
+
+  Icinga 1.x 	| Icinga 2.x						| Specialities
+  --------------|-------------------------------------------------------|---------------
+  host		| Host							| .
+  service	| Service						| object or apply rule
+  . (contacts)  | Notification						| object or apply rule
+  hostgroup     | HostGroup						| membership assign
+  servicegroup  | ServiceGroup						| membership assign
+  contact	| User							| .
+  contactgroup  | UserGroup						| membership assign
+  timeperiod    | TimePeriod						| only basic
+  command       | CheckCommand, NotificationCommand, EventCommand	| cleanup required
+
+
+## Known Caveats
+
+### Notification Migration
+
+The contact-to-notification migration generates a new notification object
+per unique host/service contact (also in groups) and its
+{host,service}_notification_command.
+
+* Better: Get an idea how the new Icinga 2 notifications work, and
+apply them based on your group memberships, custom attributes, or host
+relations!
+
+## Commands
+
+Event and Notification commands will be added once used. The Icinga 1.x
+command objects serve as Check command, and may require cleanup afterwards.
+
diff --git a/run b/bin/run
similarity index 52%
rename from run
rename to bin/run
index bd53873..4af9920 100755
--- a/run
+++ b/bin/run
@@ -1,11 +1,16 @@
 #!/bin/bash
 
+ICINGA1CONF=/etc/icinga/icinga.cfg
 ICINGA2CONF=/tmp/icinga2.conf
 ICINGA2OBJECTS=/tmp/migrate.conf
-ICINGAWEB2BASE=/home/michi/coding/icinga/icingaweb2
+ICINGA2BIN=/usr/sbin/icinga2
+
+DEBUG="-x debug"
+GDB=""
+#GDB="gdb --args"
 
 # convert
-sudo bin/icinga-conftool migrate v1 /etc/icinga/icinga.cfg > $ICINGA2OBJECTS
+sudo bin/icinga-conftool migrate v1 $ICINGA1CONF > $ICINGA2OBJECTS
 
 cat > $ICINGA2CONF <<EOF
 const PluginDir = "/usr/lib/nagios/plugins"
@@ -16,4 +21,4 @@ include "$ICINGA2OBJECTS"
 EOF
 
 # verify config
-/usr/sbin/icinga2 -c $ICINGA2CONF -C
+$GDB $ICINGA2BIN -c $ICINGA2CONF -C $DEBUG



More information about the icinga-checkins mailing list