Skip to content

Commit

Permalink
fixed lowDiskSpace for online
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclingzealot committed Oct 18, 2016
1 parent 8035b10 commit 40532f0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lowDiskSpace.bash
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ chmod 600 $log

#Check that the config file exists
if [[ ! -f "$configFile" ]] ; then
echo "I need a file at $configFile with a list of mountpoints to ignore"
echo "I need a file at $configFile with a list of mountpoints to ignore"
exit 1
fi

Expand All @@ -82,7 +82,7 @@ hostname=`hostname`
sendAlert=0
body=''
IFS=$'\n'; for mount in `df`; do
if echo $mount | grep Filesystem ; then
if echo $mount | grep 'Filesystem\|fichiers' ; then
continue
fi

Expand All @@ -96,11 +96,13 @@ IFS=$'\n'; for mount in `df`; do
continue
fi

if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
if [[ "$CURRENT" -gt "$THRESHOLD" ]] ; then
sendAlert=1
body=`echo -e "${body}
Your $mountPoint ($filesystem) partition remaining free space on $hostname is used at $CURRENT% \\n"`
echo $body
else
echo $mountPoint $CURRENT OK.
fi
done

Expand Down

0 comments on commit 40532f0

Please sign in to comment.