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

Add setting for DISC overload

parent 03152235
No related branches found
No related tags found
No related merge requests found
...@@ -39,3 +39,5 @@ export CPU_OVERLOAD_TIME=30 # 1h by default ...@@ -39,3 +39,5 @@ export CPU_OVERLOAD_TIME=30 # 1h by default
export MEM_OVERLOAD_TIME=30 # 1h by default export MEM_OVERLOAD_TIME=30 # 1h by default
# MEM_OVERLOAD_PERCENT is percent of memory usage. The number needs to be between 0 and 100 # MEM_OVERLOAD_PERCENT is percent of memory usage. The number needs to be between 0 and 100
export MEM_OVERLOAD_PERCENT=75 # 75% by default export MEM_OVERLOAD_PERCENT=75 # 75% by default
# DISC_OVERLOAD_PERCENT is percent of disc usage. The number needs to be between 0 and 100
export DISC_OVERLOAD_PERCENT=75 # 75% by default
...@@ -30,7 +30,7 @@ echo "" > ./$$-parts ...@@ -30,7 +30,7 @@ echo "" > ./$$-parts
for part in "${list_of_part[@]}" for part in "${list_of_part[@]}"
do do
name=$(echo $part | sed -e 's@^/$@root@' -e 's@^/@@') name=$(echo $part | sed -e 's@^/$@root@' -e 's@^/@@')
echo -e "check device $name with path $part\n if SPACE usage > 75% then alert\n\n" >> ./$$-parts echo -e "check device $name with path $part\n if SPACE usage > echo ${MEM_OVERLOAD_PERCENT:-75}% then alert\n\n" >> ./$$-parts
done done
mv ./$$-parts /etc/monit/conf-available/disc mv ./$$-parts /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/
...@@ -50,7 +50,7 @@ if [ -z "$(dpkg -l | grep libmemcached-tools)" ]; then ...@@ -50,7 +50,7 @@ if [ -z "$(dpkg -l | grep libmemcached-tools)" ]; then
fi fi
totalmem=`free --mega | grep Mem | awk '{print $2}'` totalmem=`free --mega | grep Mem | awk '{print $2}'`
usemax=$(($totalmem * `echo ${RAM_OVERLOAD_PERCENT:-75}` / 100)) usemax=$(($totalmem * `echo ${MEM_OVERLOAD_PERCENT:-75}` / 100))
contentMEM='check system $HOST-mem contentMEM='check system $HOST-mem
if memory > '"$usemax"' MB for '"`echo ${MEM_OVERLOAD_TIME:-30}`"' cycles then alert' if memory > '"$usemax"' MB for '"`echo ${MEM_OVERLOAD_TIME:-30}`"' cycles then alert'
## write in file ## write in file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment