diff options
-rw-r--r-- | zshrc | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -353,6 +353,7 @@ upgrade-debian-samhain() { echo $i preexec $i; ssh $i -t ' + didsudo=0 check() { sudo /usr/sbin/samhain -t check -i -p err -s none -l none -m none }; @@ -360,6 +361,7 @@ upgrade-debian-samhain() { if [ "`check 2>&1 | grep "^CRIT" | wc -l`" != 0 ]; then echo Updating samhain db... sudo samhain --foreground -t update + didsudo=1 echo done. fi } @@ -380,6 +382,14 @@ upgrade-debian-samhain() { sudo apt-get dist-upgrade && sudo apt-get clean && [ -x /usr/sbin/samhain ] && reinit + if [ "$didsudo" = 1 ]; then + echo Updating nagios status + echo "apt" + sudo /usr/sbin/dsa-update-apt-status + echo "samhain" + grep -q OK /var/cache/dsa/nagios/samhain || sudo dsa-update-samhain-status + echo done. + fi '; done } @@ -409,6 +419,7 @@ reinit-debian-samhain-one() { echo Updating samhain db... sudo samhain --foreground -t update + grep -q OK /var/cache/dsa/nagios/samhain || sudo dsa-update-samhain-status echo done. fi; fi |