linux 硬盘空间监控,Linux服务器硬盘空间监控
#*************************************************************************
# ?Author ? ? ? : ? ? ? ? ? ? ? 清風(fēng)
# ?CreateDate ? : ? 2015/6/12 15:30:13
# ?Description ?: ? this script is mointoring the linux disk?capacity, if disk used more than 90%,then it will send a alarm msg
#*************************************************************************
#!/bin/bash
#echo需要-e參數(shù)
alias echo='echo -e'
SHELL=/bin/bash
LC_ALL=zh_CN.GB18030
JAVA_JRE=/usr/jdk6/jre
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
LD_LIBRARY_PATH=/usr/lib64:/export/home/tmn/oracle/product/11.2.0/dbhome/lib32:/export/home/tmn/oracle/product/11.2.0/dbhome/lib:/usr/local/lib
PATH=.:/export/home/tmn/oracle/product/11.2.0/dbhome/bin:.:/export/home/tmn/oracle/product/11.2.0/dbhome/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/jdk6/bin:/usr/jdk6/jre/bin:/sbin:/usr/bin:.:/export/home/tmn/bin:/usr/jdk6/bin:/usr/jdk6/jre/bin:/sbin:/usr/bin:.
JAVA_HOME=/usr/jdk6
ODBCSYSINI=/usr/local/unixODBC/etc
ODBCINI=/usr/local/unixODBC/etc/odbc.ini
ODBCHOME=/usr/local/unixODBC
CLASSPATH=/usr/jdk6/lib:/usr/jdk6/jre/lib:.
ORACLE_HOME=/export/home/tmn/oracle/product/11.2.0/dbhome
export SHELL NLS_LANG LC_ALL JAVA_JRE LD_LIBRARY_PATH PATH JAVA_HOME ODBCSYSINI
export ODBCSYSINI ODBCINI ODBCHOME CLASSPATH ORACLE_HOME
for d in `df -P | grep /dev/mapper/VolGroup00-LogVol00 | awk '{print $5}' | sed 's/%//g'`
do
if [ $d -gt 90 ]; then
perl send_sms.pl 13500000000 監(jiān)控通知:服務(wù)器[43]磁盤空間大于90%
exit 0;
fi
done
for d in `/usr/local/bin/sshpass -p '123456' ssh logonuser@192.168.1.39 df -P | grep /dev/mapper/VolGroup00-LogVol00 | awk '{print $5}' | sed 's/%//g'`
do
if [ $d -gt 90 ]; then
perl send_sms.pl 13500000000 監(jiān)控通知:服務(wù)器[39]磁盤空間大于90%
exit 0;
fi
done
總結(jié)
以上是生活随笔為你收集整理的linux 硬盘空间监控,Linux服务器硬盘空间监控的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android arm 寄存器,ARM汇
- 下一篇: matlab调用python_从MATL