#!/bin/sh
use=`df|grep "/var/www/virtual"|awk '{print $5}'| sed 's/%//g'`
ip=`less /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | sed 's/IPADDR=//g'`
if [[ $use -gt 60 ]];then
echo $ip /var/www/virtual: $use% | mail -s "disk warning" 523775@qq.com
use=`df|grep "/var/www/virtual"|awk '{print $5}'| sed 's/%//g'`
ip=`less /etc/sysconfig/network-scripts/ifcfg-eth0 | grep IPADDR | sed 's/IPADDR=//g'`
if [[ $use -gt 60 ]];then
echo $ip /var/www/virtual: $use% | mail -s "disk warning" 523775@qq.com
fi;
本文转自 freeterman 51CTO博客,原文链接:http://blog.51cto.com/myunix/1094897,如需转载请自行联系原作者