X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-nrpe-config%2Fdebian%2Fpostinst;h=2173952860be85a8584db358266f6b6209e2459e;hb=e58155ec3e7428265f8ba5bb223c33440ede356f;hp=a90e03e6dcc23d4dcf9a75bbd42eb69b1a3436fe;hpb=76813c47c27a8a30193134a465fa27af69ba0d24;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-nrpe-config/debian/postinst b/dsa-nagios-nrpe-config/debian/postinst index a90e03e..2173952 100644 --- a/dsa-nagios-nrpe-config/debian/postinst +++ b/dsa-nagios-nrpe-config/debian/postinst @@ -38,7 +38,30 @@ 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 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 '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 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d nagios-nrpe-server restart || exit $? @@ -46,6 +69,8 @@ else /etc/init.d/nagios-nrpe-server restart || exit $? fi +/usr/share/dsa/weak-ssh-keys-check -s /var/cache/dsa/nagios/weak-ssh-keys + #DEBHELPER# exit 0