[project @ peter@palfrader.org-20081014063601-nn6qdxx9r26ctu7p]
[mirror/dsa-nagios.git] / dsa-nagios-nrpe-config / debian / postinst
index 391e31b..0749532 100644 (file)
@@ -47,14 +47,30 @@ if [ -e /etc/sudoers ] ; then
        fi
 fi
 
+if [ -e /etc/sudoers ] ; then
+       if ! grep '^nagios.*/usr/sbin/samhain' /etc/sudoers > /dev/null; then
+               echo 
+               echo 'WARNIG: Add this line to sudoers:'
+               echo 'nagios ALL=(ALL) NOPASSWD: /usr/sbin/samhain -t check --foreground -p err -s none -l none -m none'
+               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 pd [0-9]\:[0-9] show'
+               echo 'nagios  ALL=(ALL) NOPASSWD: /usr/sbin/hpacucli controller slot=0 pd [0-9]I\:[0-9]\:[0-9] show'
                echo 'nagios  ALL=(ALL) NOPASSWD: /usr/sbin/hpacucli controller slot=0 show status'
                echo
+       elif ! grep '^nagios.*hpacucli.* pd .*:.* show' /etc/sudoers > /dev/null; then
+               echo
+               echo 'WARNIG: Add these lines to sudoers:'
+               echo 'nagios  ALL=(ALL) NOPASSWD: /usr/sbin/hpacucli controller slot=0 pd [0-9]\:[0-9] show'
+               echo 'nagios  ALL=(ALL) NOPASSWD: /usr/sbin/hpacucli controller slot=0 pd [0-9]I\:[0-9]\:[0-9] show'
        fi
 fi