mailversand
This commit is contained in:
parent
d6d02066cb
commit
cf89900968
1 changed files with 2 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
## give max disk usage in %, after that a warning will be produced
|
## give max disk usage in %, after that a warning will be produced
|
||||||
MAX=85
|
MAX=15
|
||||||
## looks for mounted filesystems, but not proc,sys,...
|
## looks for mounted filesystems, but not proc,sys,...
|
||||||
DISKS=`mount |grep -iv proc |grep -iv sysfs |awk '{print $3}'`
|
DISKS=`mount |grep -iv proc |grep -iv sysfs |awk '{print $3}'`
|
||||||
|
|
||||||
|
@ -8,8 +8,7 @@
|
||||||
USAGE=`df -k $DISK | tail -n 1 | awk '{print $5}' | cut -d"%" -f1`
|
USAGE=`df -k $DISK | tail -n 1 | awk '{print $5}' | cut -d"%" -f1`
|
||||||
# if no number is given as percentage, do nothing
|
# if no number is given as percentage, do nothing
|
||||||
echo "$USAGE" |grep -q [0-9] && if [ $USAGE -gt $MAX ]; then
|
echo "$USAGE" |grep -q [0-9] && if [ $USAGE -gt $MAX ]; then
|
||||||
echo "$DISK is at ${USAGE}% capacity"
|
echo "`uname -n` $DISK is at ${USAGE}% capacity" | mail -s "[diskspace] $DISK explodiert gleich" root@mutter.sao
|
||||||
#mail root@sao -s "$DISK explodiert gleich"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue