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

Merge branch 'master' of gitlab.tetras-libre.fr:nocloud/NoCloud-Auto-Installer...

Merge branch 'master' of gitlab.tetras-libre.fr:nocloud/NoCloud-Auto-Installer into 7-dolibarr-fail2ban
parents 05dfc6aa 3f4d1acc
Branches 7-dolibarr-fail2ban
No related tags found
1 merge request!3add rules of dolibarr
...@@ -54,14 +54,22 @@ fi ...@@ -54,14 +54,22 @@ fi
# install monit if not installed # install monit if not installed
if [ -z "$(dpkg -l | grep ' monit ')" ]; then if [ -z "$(dpkg -l | grep ' monit ')" ]; then
apt-get update && apt-get install -y monit apt-get update && apt-get install -y monit
echo -e 'check device root with path /\n if SPACE usage > 75% then alert\n\ncheck device home with path /home\n if SPACE usage > 75% then alert' > /etc/monit/conf-available/disc
ln -s /etc/monit/conf-available/disc /etc/monit/conf-enabled/ ln -s /etc/monit/conf-available/disc /etc/monit/conf-enabled/
sed -i 's/# set httpd/set httpd/' /etc/monit/monitrc sed -i 's/# set httpd/set httpd/' /etc/monit/monitrc
sed -i 's/^# allow localhost/ allow localhost/' /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 echo -e "set mailserver 127.0.0.1\nset mail-format { from: Monit <monit@$DOMAIN>}\nset alert root@localhost" >> /etc/monit/monitrc
systemctl restart monit
fi fi
# Monit all partition without swap and boot
list_of_part=(`grep -v "#\|swap\|noauto" /etc/fstab | awk '{print $2}'`)
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" >> ./$$-parts
done
mv ./$$-parts /etc/monit/conf-available/disc
systemctl restart monit
# Check rootkits and antivirus # Check rootkits and antivirus
if [ `grep -c "^ALLOWHIDDENDIR=/etc/.java" /etc/rkhunter.conf` -eq 0 ] if [ `grep -c "^ALLOWHIDDENDIR=/etc/.java" /etc/rkhunter.conf` -eq 0 ]
then then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment