Skip to content
Snippets Groups Projects
Verified Commit 3f4d1acc authored by David Beniamine's avatar David Beniamine
Browse files

Fix upgrade script

parent fc8c928a
Branches
No related tags found
1 merge request!4Resolve "Surveillance interne des serveur"
......@@ -54,21 +54,21 @@ fi
# install monit if not installed
if [ -z "$(dpkg -l | grep ' monit ')" ]; then
apt-get update && apt-get install -y monit
ln -s /etc/monit/conf-available/disc /etc/monit/conf-enabled/
sed -i 's/# set httpd/set httpd/' /etc/monit/monitrc
sed -i 's/^# allow localhost/ allow localhost/' /etc/monit/monitrc
echo -e "set mailserver 127.0.0.1\nset mail-format { from: Monit <monit@$DOMAIN>}\nset alert root@localhost" >> /etc/monit/monitrc
fi
# Monit all partition without swap and boot
list_of_part=(`grep -v "#\|swap\|noauto" /etc/fstab | awk '{print $2}'`)
echo "" > ./result
echo "" > ./$$-parts
for part in "${list_of_part[@]}"
do
echo -e "check device root with path $part\n if SPACE usage > 75% then alert\nif SPACE usage > 75% timeout 86400 seconds then alert\n\n" >> ./result
echo -e "check device root with path $part\n if SPACE usage > 75% then alert\nif SPACE usage > 75% timeout 86400 seconds then alert\n\n" >> ./$$-parts
done
ln -s /etc/monit/conf-available/disc /etc/monit/conf-enabled/
sed -i 's/# set httpd/set httpd/' /etc/monit/monitrc
sed -i 's/^# allow localhost/ allow localhost/' /etc/monit/monitrc
echo -e "set mailserver 127.0.0.1\nset mail-format { from: Monit <monit@$DOMAIN>}\nset alert root@localhost" >> /etc/monit/monitrc
mv ./$$-parts /etc/monit/conf-available/disc
systemctl restart monit
fi
# Check rootkits and antivirus
if [ `grep -c "^ALLOWHIDDENDIR=/etc/.java" /etc/rkhunter.conf` -eq 0 ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment