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

Install monit to monitor disc space usage

parent 45a2c3d0
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,17 @@ then ...@@ -51,6 +51,17 @@ then
/bin/bash $customfile /bin/bash $customfile
fi fi
# install monit if not installed
if [ -z "$(dpkg -l | grep ' monit ')" ]; then
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/
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
systemctl restart monit
fi
# 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
...@@ -71,7 +82,7 @@ else ...@@ -71,7 +82,7 @@ else
cat /var/log/clamav.log cat /var/log/clamav.log
fi fi
df -h monit status
# Check docker is running # Check docker is running
if [ ! -z "`echo $MODS | grep -i collabora`" ] if [ ! -z "`echo $MODS | grep -i collabora`" ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment