Skip to content
Snippets Groups Projects
Commit 3c847b88 authored by Elian Loraux's avatar Elian Loraux
Browse files

Monit all partition without swap and boot

parent 4767e8cd
Branches
No related tags found
1 merge request!4Resolve "Surveillance interne des serveur"
......@@ -54,7 +54,15 @@ 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\nif SPACE usage > 75% timeout 86400 seconds then alert\n\ncheck device home with path /home\n if SPACE usage > 75% then alert\nif SPACE usage > 75% timeout 86400 seconds then alert' > /etc/monit/conf-available/disc
# Monit all partition without swap and boot
list_of_part=(`grep -v "#\|swap\|boot" /etc/fstab | awk '{print $2}'`)
echo "" > ./result
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
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment