summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/diskspace.sh
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2013-09-28 18:57:29 (GMT)
committerBritney Fransen <brfransen@gmail.com>2013-09-28 18:57:29 (GMT)
commit6cef3f98f980e52687095c74b040cf5531688545 (patch)
tree79550828660a22d75b9e81170f19646c39da09c6 /abs/core/LinHES-system/diskspace.sh
parent923571ab70f887524fdb1ac31cdb36b072f491d2 (diff)
downloadlinhes_pkgbuild-6cef3f98f980e52687095c74b040cf5531688545.zip
linhes_pkgbuild-6cef3f98f980e52687095c74b040cf5531688545.tar.gz
linhes_pkgbuild-6cef3f98f980e52687095c74b040cf5531688545.tar.bz2
LinHES-system: diskspace.sh: add OSD warnings for /home and /data/srv/mysql
Diffstat (limited to 'abs/core/LinHES-system/diskspace.sh')
-rwxr-xr-xabs/core/LinHES-system/diskspace.sh17
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