summaryrefslogtreecommitdiffstats
path: root/abs/core/linhes-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/linhes-scripts')
-rw-r--r--abs/core/linhes-scripts/PKGBUILD10
-rwxr-xr-xabs/core/linhes-scripts/diskspace2
-rwxr-xr-xabs/core/linhes-scripts/diskspace.sh81
3 files changed, 2 insertions, 91 deletions
diff --git a/abs/core/linhes-scripts/PKGBUILD b/abs/core/linhes-scripts/PKGBUILD
index bc4052d..68a02ef 100644
--- a/abs/core/linhes-scripts/PKGBUILD
+++ b/abs/core/linhes-scripts/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=linhes-scripts
pkgver=7
-pkgrel=32
+pkgrel=33
pkgdesc="Various scripts that help to make LinHES, LinHES."
arch=('i686' 'x86_64')
license=('GPL2')
@@ -49,8 +49,6 @@ upgrade_linhes_script.sh
find_orphans.py
acl_fix_fstab.py
stop_xss.sh
-diskspace
-diskspace.sh
)
build() {
@@ -65,8 +63,6 @@ build() {
cp run-limit-mythcommflag ${pkgdir}/etc/sv/limit-mythcommflag/run
mkdir -p ${pkgdir}/etc/logrotate.d/
cp pause_mythcommflag ${pkgdir}/etc/logrotate.d/
- mkdir -p ${pkgdir}/etc/cron.tenminutes/
- cp diskspace ${pkgdir}/etc/cron.tenminutes/
}
md5sums=('f56985b2d602e11dc1e10d3e7848b2a5'
'10ad1a4da669adccd01e0be6e5e4a3ed'
@@ -105,6 +101,4 @@ md5sums=('f56985b2d602e11dc1e10d3e7848b2a5'
'4b8671376fad6d76874508434d42fbfd'
'd8838461af9d446a1fd7e7883fdc75d1'
'cc9cdabcdfc969c2829b58c0e513488c'
- 'acb72dfeda6f957bfdf4113a04fb91c0'
- '84492954db16740f949d795b74383189'
- '68e3e87571f3b0fa4a48a10df50dc220')
+ 'acb72dfeda6f957bfdf4113a04fb91c0')
diff --git a/abs/core/linhes-scripts/diskspace b/abs/core/linhes-scripts/diskspace
deleted file mode 100755
index ab3c91b..0000000
--- a/abs/core/linhes-scripts/diskspace
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-/usr/bin/nice -n19 /usr/LH/bin/diskspace.sh -osd
diff --git a/abs/core/linhes-scripts/diskspace.sh b/abs/core/linhes-scripts/diskspace.sh
deleted file mode 100755
index 2173c6e..0000000
--- a/abs/core/linhes-scripts/diskspace.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-### Monitor free disk space
-# Display alert if the free percentage of space is >= $ALERT
-
-#
-# Static Config Variables
-#
-ALERT=90 # free space percentage to trigger an alert
-
-#
-# Static Binary Paths
-#
-DF='/bin/df'
-GREP='/bin/grep'
-AWK='/bin/awk'
-CUT='/bin/cut'
-HOSTNAME='/bin/hostname'
-DATE='/bin/date'
-OSD_CAT='/usr/bin/osd_cat'
-export DISPLAY=:0.0
-#
-# Static System Variables
-#
-THIS_HOST=`${HOSTNAME}`
-
-#
-# Check CLI Options
-#
-VERBOSE=false
-OSD=false
-for ARG in "$@" ; do
- case $ARG in
- "-v")
- VERBOSE=true
- ;;
- "-osd")
- OSD=true
- ;;
- esac
-done
-
-#----------------------------------------------------------------------------
-. /etc/osd_cat.cfg || {
- color=yellow
- outline=2
- outlinecolour=black
- shadow=0
- shadowcolour=black
- font="-adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-*"
-}
-#----------------------------------------------------------------------------
-
-[ $VERBOSE = true ] && echo "Checking free disk space on ${THIS_HOST}"
-[ $VERBOSE = true ] && echo "Threshold for warning is ${ALERT}%"
-[ $VERBOSE = true ] && echo "------------------------------------------------------------------"
-
-# Dynamic Variables
-#DATE_STR=`${DATE} "+%d-%B-%y @ %H%Mhrs"`
-
-# Call df to find the used percentages. Grep for only local disks (not remote mounts like nfs or smb)
-# Pipe the output to awk to get the needed columns, then start a while loop to process each line.
-$DF -HPl | $GREP -E "^/dev/" | $AWK '{ print $5 " " $6 " " $1 }' | while read OUTPUT ; do
- USED_PCENT=$(echo ${OUTPUT} | $AWK '{ print $1}' | $CUT -d'%' -f1 ) # Used space as a percentage
- 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"
- 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
- echo "WARNING: The root (${PARTITION}) partition is ${USED_PCENT}% full on ${THIS_HOST}." | $OSD_CAT --pos=top --offset=40 --align=center --delay=10 --color=$color --outline=$outline --outlinecolour=$outlinecolour --shadow=$shadow --shadowcolour=$shadowcolour --font=$font &
- fi
- fi
- fi
-done
-
-exit 0