#! /bin/sh /usr/share/dpatch/dpatch-run
## 52_icinga.cfg-debianize.dpatch by Alexander Wirt <formorer@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: debianize the icinga config

@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' pkg-icinga~/sample-config/icinga.cfg.in pkg-icinga/sample-config/icinga.cfg.in
--- pkg-icinga~/sample-config/icinga.cfg.in	2011-08-25 19:28:09.000000000 +0200
+++ pkg-icinga/sample-config/icinga.cfg.in	2011-08-26 21:45:13.399141107 +0200
@@ -14,9 +14,19 @@
 # for historical purposes.  This should be the first option specified
 # in the config file!!!
 
-log_file=@LOGDIR@/icinga.log
+log_file=/var/log/icinga/icinga.log
 
+# Commands definitions
+cfg_file=/etc/icinga/commands.cfg
+
+# Debian also defaults to using the check commands defined by the debian
+# nagios-plugins package
+cfg_dir=/etc/nagios-plugins/config
 
+# Debian uses by default a configuration directory where icinga-common,
+# other packages and the local admin can dump or link configuration
+# files into.
+cfg_dir=/etc/icinga/objects/
 
 # OBJECT CONFIGURATION FILE(S)
 # These are the object configuration files in which you define hosts,
@@ -25,13 +35,11 @@
 # if you wish (as shown below), or keep them all in a single config file.
 
 # You can specify individual object config files as shown below:
-cfg_file=@sysconfdir@/objects/commands.cfg
-cfg_file=@sysconfdir@/objects/contacts.cfg
-cfg_file=@sysconfdir@/objects/timeperiods.cfg
-cfg_file=@sysconfdir@/objects/templates.cfg
 
-# Definitions for monitoring the local (Linux) host
-cfg_file=@sysconfdir@/objects/localhost.cfg
+#cfg_file=@sysconfdir@/objects/commands.cfg
+#cfg_file=@sysconfdir@/objects/contacts.cfg
+#cfg_file=@sysconfdir@/objects/timeperiods.cfg
+#cfg_file=@sysconfdir@/objects/templates.cfg
 
 # Definitions for monitoring a Windows machine
 #cfg_file=@sysconfdir@/objects/windows.cfg
@@ -64,7 +72,7 @@
 # directly) in order to prevent inconsistencies that can occur
 # when the config files are modified after Icinga starts.
 
-object_cache_file=@localstatedir@/objects.cache
+object_cache_file=/var/cache/icinga/objects.cache
 
 
 
@@ -80,7 +88,7 @@
 # Read the documentation section on optimizing Icinga to find our more
 # about how this feature works.
 
-precached_object_file=@localstatedir@/objects.precache
+precached_object_file=/var/cache/icinga/objects.precache
 
 
 
@@ -142,7 +150,7 @@
 # you will have to enable this.
 # Values: 0 = disable commands, 1 = enable commands
 
-check_external_commands=1
+check_external_commands=0
 
 
 
@@ -171,8 +179,10 @@
 # is running as (usually 'nobody').  Permissions should be set at the 
 # directory level instead of on the file, as the file is deleted every
 # time its contents are processed.
+# Debian Users: In case you didn't read README.Debian yet, _NOW_ is the
+# time to do it.
 
-command_file=@EXTCMDFILEDIR@/icinga.cmd
+command_file=@localstatedir@/rw/icinga.cmd
 
 
 
@@ -203,7 +213,7 @@
 # is created, used, and deleted throughout the time that Icinga is
 # running.
 
-temp_file=@localstatedir@/icinga.tmp
+temp_file=/var/cache/icinga/icinga.tmp
 
 
 
@@ -251,7 +261,8 @@
 #broker_module=/somewhere/module2.o arg1 arg2=3 debug=0
 
 # Uncomment this to enable idomod.o
-#broker_module=@bindir@/idomod.o config_file=@sysconfdir@/idomod.cfg
+# Don't forget to also enable the daemon in /etc/default/icinga
+#broker_module=/usr/lib/icinga/idomod.o config_file=@sysconfdir@/idomod.cfg
 
 
 
@@ -272,7 +283,7 @@
 # This is the directory where archived (rotated) log files should be 
 # placed (assuming you've chosen to do log rotation).
 
-log_archive_path=@LOGDIR@/archives
+log_archive_path=/var/log/icinga/archives
 
 
 
@@ -1208,7 +1219,7 @@
 #	strict-iso8601	(YYYY-MM-DDTHH:MM:SS)
 #
 
-date_format=us
+date_format=iso8601
 
 
 
@@ -1238,7 +1249,7 @@
 # embedded Perl interpreter) is located.  If you didn't compile
 # Icinga with embedded Perl support, this option has no effect.
 
-p1_file=@P1FILELOC@/p1.pl
+p1_file=/usr/lib/icinga/p1.pl
 
 
 
@@ -1252,7 +1263,7 @@
 # Only enable this setting when you really know what you are doing!
 # Values: 0 = disable interpreter, 1 = enable interpreter
 
-enable_embedded_perl=0
+enable_embedded_perl=1
 
 
 
@@ -1336,8 +1347,8 @@
 # using the $ADMINEMAIL$ and $ADMINPAGER$ macros in your notification
 # commands.
 
-admin_email=@icinga_user@@localhost
-admin_pager=page@icinga_user@@localhost
+admin_email=root@localhost
+admin_pager=pageroot@localhost
 
 
 
@@ -1378,7 +1389,7 @@
 # Values: 1 - Enable environment variable macros
 #         0 - Disable environment variable macros (default)
 
-enable_environment_macros=0
+enable_environment_macros=1
 
 
 
@@ -1446,7 +1457,7 @@
 # DEBUG FILE
 # This option determines where Icinga should write debugging information.
 
-debug_file=@LOGDIR@/icinga.debug
+debug_file=/var/log/icinga/icinga.debug
 
 
 
