[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, master, updated. 0c3827aca406859bd5d5512224a0c0a3cfa685d2
Bernd Zeimetz
bernd at bzed.de
Fri Nov 11 20:23:50 UTC 2011
The following commit has been merged in the master branch:
commit 5456d5c04b5406142c7a378ed28c529b5dd692e9
Author: Bernd Zeimetz <bernd at bzed.de>
Date: Thu Nov 10 13:33:02 2011 +0100
Move check_mk nagios/icinga config files into check_mk subfolder.
Proper migration needs to be done for existing installations!
diff --git a/debian/check-mk-config-icinga.install b/debian/check-mk-config-icinga.install
index f507c7b..b21ff0a 100644
--- a/debian/check-mk-config-icinga.install
+++ b/debian/check-mk-config-icinga.install
@@ -1,2 +1,2 @@
-usr/share/doc/check_mk/check_mk_templates.cfg etc/icinga/objects
+usr/share/doc/check_mk/check_mk_templates.cfg etc/icinga/objects/check_mk
etc/check_mk/multisite.mk
diff --git a/debian/check-mk-config-icinga.postinst b/debian/check-mk-config-icinga.postinst
new file mode 100644
index 0000000..77718dc
--- /dev/null
+++ b/debian/check-mk-config-icinga.postinst
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+set -e
+
+# a little helper for getting permissions right
+setperm() {
+ local user="$1"
+ local group="$2"
+ local mode="$3"
+ local file="$4"
+ shift 4
+ # only do something when no setting exists
+ if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
+ chown "$user":"$group" "$file"
+ chmod "$mode" "$file"
+ fi
+}
+
+case "$1" in
+ configure)
+ #make sure our nagios user exists
+ if ! getent passwd nagios > /dev/null ; then
+ echo 'Adding system-user for nagios' 1>&2
+ adduser --system --group --home /var/lib/nagios \
+ --disabled-login --force-badname nagios > /dev/null
+ fi
+ #fix permissions for some directorys
+ test -d /etc/icinga/objects/check_mk || mkdir -p /etc/icinga/objects/check_mk
+ setperm root nagios 0775 /etc/icinga/objects/check_mk
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+ *)
+ echo "postinst called with unknown argument \$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/check-mk-config-nagios3.install b/debian/check-mk-config-nagios3.install
index 51e618d..4b049b8 100644
--- a/debian/check-mk-config-nagios3.install
+++ b/debian/check-mk-config-nagios3.install
@@ -1,2 +1,2 @@
-usr/share/doc/check_mk/check_mk_templates.cfg etc/nagios3/objects
+usr/share/doc/check_mk/check_mk_templates.cfg etc/nagios3/conf.d/check_mk
etc/check_mk/multisite.mk
diff --git a/debian/check-mk-config-nagios3.postinst b/debian/check-mk-config-nagios3.postinst
new file mode 100644
index 0000000..ca0dacf
--- /dev/null
+++ b/debian/check-mk-config-nagios3.postinst
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+set -e
+
+# a little helper for getting permissions right
+setperm() {
+ local user="$1"
+ local group="$2"
+ local mode="$3"
+ local file="$4"
+ shift 4
+ # only do something when no setting exists
+ if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
+ chown "$user":"$group" "$file"
+ chmod "$mode" "$file"
+ fi
+}
+
+case "$1" in
+ configure)
+ #make sure our nagios user exists
+ if ! getent passwd nagios > /dev/null ; then
+ echo 'Adding system-user for nagios' 1>&2
+ adduser --system --group --home /var/lib/nagios \
+ --disabled-login --force-badname nagios > /dev/null
+ fi
+ #fix permissions for some directorys
+ test -d /etc/nagios3/conf.d/check_mk || mkdir -p /etc/nagios3/conf.d/check_mk
+ setperm root nagios 0775 /etc/nagios3/conf.d/check_mk
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+ *)
+ echo "postinst called with unknown argument \$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/defaults.icinga b/debian/defaults.icinga
index 9b40f42..c552b07 100644
--- a/debian/defaults.icinga
+++ b/debian/defaults.icinga
@@ -23,10 +23,10 @@ precompiled_hostchecks_dir = '/var/lib/check_mk/precompiled'
counters_directory = '/var/lib/check_mk/counters'
tcp_cache_dir = '/var/lib/check_mk/cache'
logwatch_dir = '/var/lib/check_mk/logwatch'
-nagios_objects_file = '/etc/icinga/objects/check_mk_objects.cfg'
+nagios_objects_file = '/etc/icinga/objects/check_mk/check_mk_objects.cfg'
nagios_command_pipe_path = '/var/lib/icinga/rw/icinga.cmd'
nagios_status_file = '/var/lib/icinga/status.dat'
-nagios_conf_dir = '/etc/icinga/objects'
+nagios_conf_dir = '/etc/icinga/objects/check_mk'
nagios_user = 'nagios'
nagios_url = '/icinga'
nagios_cgi_url = '/cgi-bin/icinga'
diff --git a/debian/defaults.nagios3 b/debian/defaults.nagios3
index 21b55e8..2602cea 100644
--- a/debian/defaults.nagios3
+++ b/debian/defaults.nagios3
@@ -23,7 +23,7 @@ precompiled_hostchecks_dir = '/var/lib/check_mk/precompiled'
counters_directory = '/var/lib/check_mk/counters'
tcp_cache_dir = '/var/lib/check_mk/cache'
logwatch_dir = '/var/lib/check_mk/logwatch'
-nagios_objects_file = '/etc/nagios3/conf.d/check_mk_objects.cfg'
+nagios_objects_file = '/etc/nagios3/conf.d/check_mk/check_mk_objects.cfg'
nagios_command_pipe_path = '/var/lib/nagios3/rw/nagios.cmd'
nagios_status_file = '/var/cache/nagios3/status.dat'
nagios_conf_dir = '/etc/nagios3/conf.d'
--
UNNAMED PROJECT
More information about the Pkg-nagios-changes
mailing list