[Pkg-nagios-changes] [pkg-interfacetable-v3t] 02/14: Moved configurations to /etc/nagios-config/{, config/} and /etc/apache2/conf-available/
Markus Frosch
lazyfrosch-guest at moszumanska.debian.org
Sun Dec 29 17:09:33 UTC 2013
This is an automated email from the git hooks/post-receive script.
lazyfrosch-guest pushed a commit to branch debmon-wheezy
in repository pkg-interfacetable-v3t.
commit 3fa6815bcc3914e7683aada12aa9635efd3d5bd3
Author: Markus Frosch <markus at lazyfrosch.de>
Date: Fri Sep 6 21:16:11 2013 +0200
Moved configurations to /etc/nagios-config/{,config/} and /etc/apache2/conf-available/
---
debian/checkinterfacetable.cfg | 2 +-
debian/control | 1 +
debian/nagios-plugin-interfacetable-v3t.dirs | 3 +-
debian/nagios-plugin-interfacetable-v3t.install | 2 -
debian/nagios-plugin-interfacetable-v3t.postinst | 32 ++++++++++++++--
debian/nagios-plugin-interfacetable-v3t.postrm | 28 ++++++++++++--
debian/nagios-plugin-interfacetable-v3t.preinst | 49 ++++++++++++++++++++++++
debian/rules | 11 ++++--
8 files changed, 114 insertions(+), 14 deletions(-)
diff --git a/debian/checkinterfacetable.cfg b/debian/checkinterfacetable.cfg
index e130105..bf98534 100644
--- a/debian/checkinterfacetable.cfg
+++ b/debian/checkinterfacetable.cfg
@@ -2,6 +2,6 @@
define command{
command_name check_interfacetable_v3t
- command_line /usr/lib/nagios/plugins/check_interface_table_v3t.pl --config /etc/interfacetable-v3t/settings.cfg -H $HOSTADDRESS$ $ARG1$
+ command_line /usr/lib/nagios/plugins/check_interface_table_v3t.pl --config /etc/nagios-plugins/interfacetable-v3t.cfg -H $HOSTADDRESS$ $ARG1$
}
diff --git a/debian/control b/debian/control
index b266580..5679cfc 100644
--- a/debian/control
+++ b/debian/control
@@ -27,6 +27,7 @@ Description: Nagios / Icinga plugin to monitor network interfaces via SNMP
Package: nagios-plugin-interfacetable-v3t
Architecture: all
+Pre-Depends: dpkg (>= 1.15.7.2)
Depends: nagios-plugins-common,
libnet-snmp-perl,
libconfig-general-perl,
diff --git a/debian/nagios-plugin-interfacetable-v3t.dirs b/debian/nagios-plugin-interfacetable-v3t.dirs
index c60c5e3..c2a80b6 100644
--- a/debian/nagios-plugin-interfacetable-v3t.dirs
+++ b/debian/nagios-plugin-interfacetable-v3t.dirs
@@ -5,7 +5,8 @@ usr/lib/interfacetable-v3t
usr/share/interfacetable-v3t/cgi
usr/share/interfacetable-v3t/htdocs
usr/share/interfacetable-v3t/tables
-etc/interfacetable-v3t
+
+etc/apache2/conf-available
usr/share/pnp4nagios/html/templates
diff --git a/debian/nagios-plugin-interfacetable-v3t.install b/debian/nagios-plugin-interfacetable-v3t.install
index 9d2317f..cdeaea5 100644
--- a/debian/nagios-plugin-interfacetable-v3t.install
+++ b/debian/nagios-plugin-interfacetable-v3t.install
@@ -1,8 +1,6 @@
lib/*.pm usr/lib/interfacetable-v3t
-libexec/check_interface_table_v3t.pl usr/lib/nagios/plugins
sbin/InterfaceTableReset_v3t.cgi usr/share/interfacetable-v3t/cgi
share/css share/js share/img usr/share/interfacetable-v3t/htdocs
share/tables usr/share/interfacetable-v3t
-debian/checkinterfacetable.cfg etc/nagios-plugins/config
contrib/pnp4nagios/*.php usr/share/pnp4nagios/html/templates
diff --git a/debian/nagios-plugin-interfacetable-v3t.postinst b/debian/nagios-plugin-interfacetable-v3t.postinst
index f8d1a04..885096a 100644
--- a/debian/nagios-plugin-interfacetable-v3t.postinst
+++ b/debian/nagios-plugin-interfacetable-v3t.postinst
@@ -2,8 +2,34 @@
set -e
+OLDVERSION="$2"
+if [ -z "$OLDVERSION" ]; then
+ # set version to the one transition package
+ OLDVERSION="0.05-1"
+fi
+
+# move old config files
+dpkg-maintscript-helper mv_conffile \
+ /etc/interfacetable-v3t/settings.cfg \
+ /etc/nagios-plugins/interfacetable-v3t.cfg \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
+dpkg-maintscript-helper mv_conffile \
+ /etc/nagios-plugins/config/checkinterfacetable.cfg \
+ /etc/nagios-plugins/config/interfacetable-v3t.cfg \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
+dpkg-maintscript-helper mv_conffile \
+ /etc/interfacetable-v3t/apache2.conf \
+ /etc/apache2/conf-available/interfacetable-v3t.conf \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
case "$1" in
configure)
+ if [ -d /etc/interfacetable-v3t ]; then
+ rmdir /etc/interfacetable-v3t || true
+ fi
+
if [ -d /var/spool/interfacetable-v3t ]; then
chown nagios:www-data /var/spool/interfacetable-v3t
chmod 770 /var/spool/interfacetable-v3t
@@ -35,12 +61,12 @@ case "$1" in
elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
echo "enabling Apache configuration using the legacy method..."
# create symlink if not existing
- if [ -f /etc/apache2/conf.d/interfacetable-v3t.conf ]; then
- ln -vs ../../interfacetable-v3t/apache2.conf /etc/apache2/conf.d/interfacetable-v3t.conf
+ if [ ! -f /etc/apache2/conf.d/interfacetable-v3t.conf ]; then
+ ln -vs ../conf-available/interfacetable-v3t.conf /etc/apache2/conf.d/
fi
# reload webserver
- [ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload
+ [ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload || true
fi
;;
diff --git a/debian/nagios-plugin-interfacetable-v3t.postrm b/debian/nagios-plugin-interfacetable-v3t.postrm
index 7abdee1..2c0a0c7 100644
--- a/debian/nagios-plugin-interfacetable-v3t.postrm
+++ b/debian/nagios-plugin-interfacetable-v3t.postrm
@@ -2,6 +2,28 @@
set -e
+OLDVERSION="$2"
+if [ -z "$OLDVERSION" ]; then
+ # set version to the one transition package
+ OLDVERSION="0.05-1"
+fi
+
+# move old config files
+dpkg-maintscript-helper mv_conffile \
+ /etc/interfacetable-v3t/settings.cfg \
+ /etc/nagios-plugins/interfacetable-v3t.cfg \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
+dpkg-maintscript-helper mv_conffile \
+ /etc/nagios-plugins/config/checkinterfacetable.cfg \
+ /etc/nagios-plugins/config/interfacetable-v3t.cfg \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
+dpkg-maintscript-helper mv_conffile \
+ /etc/interfacetable-v3t/apache2.conf \
+ /etc/apache2/conf-available/interfacetable-v3t.conf \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
# Apache2
disable_apache() {
if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
@@ -20,9 +42,9 @@ disable_apache() {
case "$1" in
purge)
- rm -rf /var/lib/interfacetable-v3t/state
- rm -rf /var/lib/interfacetable-v3t/tables
- rm -rf /var/spool/interfacetable-v3t
+ rm -rf /var/lib/interfacetable-v3t/state
+ rm -rf /var/lib/interfacetable-v3t/tables
+ rm -rf /var/spool/interfacetable-v3t
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
diff --git a/debian/nagios-plugin-interfacetable-v3t.preinst b/debian/nagios-plugin-interfacetable-v3t.preinst
new file mode 100644
index 0000000..cbf0c2f
--- /dev/null
+++ b/debian/nagios-plugin-interfacetable-v3t.preinst
@@ -0,0 +1,49 @@
+#!/bin/sh
+# preinst script for interfacetable-v3t
+# see: dh_installdeb(1)
+
+set -e
+
+OLDVERSION="$2"
+if [ -z "$OLDVERSION" ]; then
+ # set version to the one transition package
+ OLDVERSION="0.05-1"
+fi
+
+# remove links before moving files
+if [ -L /etc/apache2/conf-available/interfacetable-v3t.conf ]; then
+ rm /etc/apache2/conf-available/interfacetable-v3t.conf
+fi
+
+# move old config files
+dpkg-maintscript-helper mv_conffile \
+ /etc/interfacetable-v3t/settings.cfg \
+ /etc/nagios-plugins/interfacetable-v3t.cfg \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
+dpkg-maintscript-helper mv_conffile \
+ /etc/nagios-plugins/config/checkinterfacetable.cfg \
+ /etc/nagios-plugins/config/interfacetable-v3t.cfg \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
+dpkg-maintscript-helper mv_conffile \
+ /etc/interfacetable-v3t/apache2.conf \
+ /etc/apache2/conf-available/interfacetable-v3t.conf \
+ 0.05-1 interfacetable-v3t -- "$1" "$OLDVERSION"
+
+case "$1" in
+ install|upgrade)
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
index b0ab35c..8090d51 100755
--- a/debian/rules
+++ b/debian/rules
@@ -34,17 +34,20 @@ override_dh_auto_install:
override_dh_install:
dh_install
# additional files
- cp debian/apache2.conf ${b}/etc/interfacetable-v3t/
+ cp debian/checkinterfacetable.cfg \
+ ${b}/etc/nagios-plugins/config/interfacetable-v3t.cfg
+ cp debian/apache2.conf \
+ ${b}/etc/apache2/conf-available/interfacetable-v3t.conf
cp etc/settings.cfg-sample \
- ${b}/etc/interfacetable-v3t/settings.cfg
+ ${b}/etc/nagios-plugins/interfacetable-v3t.cfg
# executables
chmod +x ${b}/usr/lib/nagios/plugins/check_interface_table_v3t.pl
chmod +x ${b}/usr/share/interfacetable-v3t/cgi/InterfaceTableReset_v3t.cgi
# fix libdir in nagiosplugin
sed -i "s#use lib ('/usr/lib');#use lib ('/usr/lib/interfacetable-v3t');#" \
${b}/usr/lib/nagios/plugins/check_interface_table_v3t.pl
- # remote quotes from settings
- sed -i 's#"##g' ${b}/etc/interfacetable-v3t/settings.cfg
+ # remove quotes from settings
+ sed -i 's#"##g' ${b}/etc/nagios-plugins/interfacetable-v3t.cfg
override_dh_clean:
dh_clean
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-interfacetable-v3t.git
More information about the Pkg-nagios-changes
mailing list