- 论坛徽章:
- 0
|
检查df -k的日志中是否有使用率超过80%的文件系统,包括磁盘空间使用率和I节点使用率。如果有,则通知系统管理员报警!
磁盘空间的日志格式是:
卷 总空间 已占用空间 占用百分比
脚本是这样的:
cd /home/XXX/ds
dslogFile=dspace_`date +%Y%m%d`.log
if [ -f $dslogFile ]
then
awk '$1 ~ /^P[A-Z][A-Z][A-Z][0-9][0-9][0-9][0-9]$/ && $4 > "80.00%" {printf "%10s %10s %20s %20s
", $4, $1, $2, $3}' $dslogFile | sort -r | mailx -s "Alarm: Tight Disk Storage!!!" XXX@mail.dcm.net
fi
#Alarm: Tight Disk Storage!!!
#First Shell Program Scripted by DCM-YXJ
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/5650/showart_19005.html |
|