Code

Handle pnp4nagios.cfg symlink also for icinga
authorAlexander Wirt <alexander.wirt@credativ.de>
Mon, 18 Feb 2013 12:54:36 +0000 (13:54 +0100)
committerAlexander Wirt <alexander.wirt@credativ.de>
Mon, 18 Feb 2013 12:54:36 +0000 (13:54 +0100)
debian/pnp4nagios-bin.postinst
debian/pnp4nagios-bin.postrm

index d3bc3404f0f3b10e03188dfe10e95fa234947f5a..9e6929064cdc542352cc0d6c820a031ee12bc54d 100644 (file)
@@ -50,6 +50,12 @@ case "$1" in
                                ln -s /etc/pnp4nagios/nagios.cfg /etc/nagios3/conf.d/pnp4nagios.cfg
                        fi
                fi
+               if [ -d /etc/icinga/objects/ ]; then
+                       if [ ! -e /etc/icinga/objects/pnp4nagios.cfg ]; then
+                               ln -s /etc/pnp4nagios/nagios.cfg /etc/icinga/objects/pnp4nagios.cfg
+                       fi
+               fi
+
        ;;
 
        abort-upgrade|abort-remove|abort-deconfigure)
index 7e12fcd2e604c8f86d1f6b6f9f27e2daf45eb784..369f60b4b5020be02065c0e3deb25c4b7b3907c3 100644 (file)
@@ -29,6 +29,15 @@ case "$1" in
                                fi
                        fi
                fi
+               if [ -d /etc/icinga/objects/ ]; then
+                       if [ -L /etc/icinga/objects/pnp4nagios.cfg ]; then
+                               ls -l /etc/icinga/objects/pnp4nagios.cfg | grep -q /etc/pnp4nagios/nagios.cfg
+                               if [ $? -eq 0 ]; then
+                                       rm -f /etc/icinga/objects/pnp4nagios.cfg
+                               fi
+                       fi
+               fi
+
        ;;
        upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
        ;;