X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-nrpe-config%2Fdebian%2Fpostinst;h=5529e941c34ea8eb102522af72a2332c6b70e32e;hb=d4d9c9081e4c51620f3b05775bb8e7105005fb95;hp=e765ca954e6559d37cf58a35448c1679257de70c;hpb=de125a7de91870da7e8dd4eca075a71571f6f286;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-nrpe-config/debian/postinst b/dsa-nagios-nrpe-config/debian/postinst index e765ca9..5529e94 100644 --- a/dsa-nagios-nrpe-config/debian/postinst +++ b/dsa-nagios-nrpe-config/debian/postinst @@ -12,7 +12,7 @@ if [ -e /etc/nagios/nrpe.cfg ] ; then fi if ! grep '^allowed_hosts=' /etc/nagios/nrpe.cfg > /dev/null; then echo - echo "WARNING: /etc/nagios/nrpe.cfg does not define allowed_hosts. Please fix." + echo "WARNING: /etc/nagios/nrpe.cfg does not define allowed_hosts. Please fix (set allowed_hosts=$NAGIOS_MASTER)." echo else found=0 @@ -38,6 +38,21 @@ if [ -e /etc/default/nagios-nrpe-server ] ; then fi fi +if [ -e /etc/sudoers ] ; then + if ! grep '^nagios.*/usr/lib/nagios/plugins/dsa-check-dabackup' /etc/sudoers > /dev/null; then + echo + echo 'WARNIG: Add this line to sudoers:' + echo 'nagios ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/dsa-check-dabackup ""' + echo + fi +fi + +if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d nagios-nrpe-server restart || exit $? +else + /etc/init.d/nagios-nrpe-server restart || exit $? +fi + #DEBHELPER# exit 0