diff options
Diffstat (limited to 'abs/core/LinHES-system/diskspace.sh')
-rwxr-xr-x | abs/core/LinHES-system/diskspace.sh | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/abs/core/LinHES-system/diskspace.sh b/abs/core/LinHES-system/diskspace.sh index d27221a..5b41b73 100755 --- a/abs/core/LinHES-system/diskspace.sh +++ b/abs/core/LinHES-system/diskspace.sh @@ -5,7 +5,8 @@ # # Static Config Variables # -ALERT=90 # free space percentage to trigger an alert +# free space percentage to trigger an alert +ALERT=90 # # Static Binary Paths @@ -17,7 +18,7 @@ CUT='/usr/bin/cut' HOSTNAME='/usr/bin/hostname' DATE='/bin/date' MSG_CLIENT='/usr/LH/bin/msg_client.py --msg' -export DISPLAY=:0.0 + # # Static System Variables # @@ -53,16 +54,12 @@ $DF -HPl | $GREP -E "^/dev/" | $AWK '{ print $5 " " $6 " " $1 }' | while read OU PARTITION=$(echo ${OUTPUT} | $AWK '{ print $2 }' ) # Mount Point (eg, /home) DEVICE=$(echo ${OUTPUT} | $AWK '{ print $3 }' ) # Device (eg, /dev/sda1 or LABEL or UUID) if [ $VERBOSE = true ] ; then - echo -e "Checking device ${DEVICE} which is mounted to ${PARTITION} \t${USED_PCENT}% used" + echo -e "${USED_PCENT}% used:\tDevice ${DEVICE} mounted to ${PARTITION}" fi if [ ${USED_PCENT} -ge $ALERT ]; then - if [ $VERBOSE = true ] ; then - echo "WARNING: ${PARTITION} (${DEVICE}) is ${USED_PCENT}% full on ${THIS_HOST}." - else - echo "WARNING: ${PARTITION} (${DEVICE}) is ${USED_PCENT}% full on ${THIS_HOST}." #| - if [ $OSD = true ] && [ ${PARTITION} = / ]; then - $MSG_CLIENT "WARNING: The root (${PARTITION}) partition is ${USED_PCENT}% full on ${THIS_HOST}." - fi + echo "WARNING: Partition (${PARTITION}) on (${DEVICE}) is ${USED_PCENT}% full on ${THIS_HOST}" + if [ $OSD = true ] && { [ ${PARTITION} = / ] || [ ${PARTITION} = /home ] || [ ${PARTITION} = /data/srv/mysql ]; } then + $MSG_CLIENT "WARNING: Partition (${PARTITION}) on (${DEVICE}) is ${USED_PCENT}% full" fi fi done |