[project @ peter@palfrader.org-20080519135700-ekglreng7ttedbqd]
[mirror/dsa-nagios.git] / dsa-nagios-nrpe-config / debian / postinst
index a90e03e..7b7ea12 100644 (file)
@@ -38,7 +38,25 @@ 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 [ -e /usr/sbin/hpacucli ] && [ -e /dev/cciss/c0d0 ] ; then
+       if ! grep '^nagios.*hpacucli' /etc/sudoers > /dev/null; then
+               echo
+               echo 'WARNIG: Add these lines to sudoers:'
+               echo 'nagios  ALL=(ALL) NOPASSWD: /usr/sbin/hpacucli controller all show'
+               echo 'nagios  ALL=(ALL) NOPASSWD: /usr/sbin/hpacucli controller slot=0 pd all show'
+               echo 'nagios  ALL=(ALL) NOPASSWD: /usr/sbin/hpacucli controller slot=0 show status'
+               echo
+       fi
+fi
 
 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
        invoke-rc.d nagios-nrpe-server restart || exit $?