sysstat.sh
#! /bin/sh export LC_ALL=zh_CN.UTF-8 cd /bin2/ sh sysstat-daily.sh > sysstat-daily.sh.log 2>&1 mutt -s "scm11-scm12 sysstat-daily" scm-svr-mtr@scm5.***.cn < sysstat-daily.sh.log
sysstat-daily.sh
#! /bin/sh echo . echo "***10.12.5.10 阵列情况...***" /usr/sbin/hpacucli ctrl all show status /usr/sbin/hpacucli ctrl all show config echo . echo "***10.12.5.43 阵列情况...***" echo RAID Mode, eg. stripe mirror etc snmpwalk -v 2c -c SinoHBMi 10.12.5.43 .1.3.6.1.4.1.7933.1.1.1.9.1.6 echo Disk Media Patrol Loop Count Information snmpwalk -v 2c -c SinoHBMi 10.12.5.43 .1.3.6.1.4.1.7933.1.1.1.6.1.19 | grep "INTEGER" | awk '{if($NF!="0") print $0 "error"; else print "ok"}' echo Disk Media Patrol Err Count Information snmpwalk -v 2c -c SinoHBMi 10.12.5.43 .1.3.6.1.4.1.7933.1.1.1.6.1.20 | grep "INTEGER" | awk '{if($NF!="0") print $0 "error"; else print "ok"}' #echo . #echo "***10.12.22.19数据库情况...***" #mysqlcheck extmail #echo . #echo "***172.16.40.216硬盘情况...***" #ssh [email protected] "/usr/sbin/smartctl -H /dev/sda" |awk 'NR<6 {print $0}' #ssh [email protected] "/usr/sbin/smartctl -H /dev/sdb" |awk 'NR<6 {print $0}' #ssh [email protected] "/usr/sbin/smartctl -H /dev/hda" |awk 'NR<6 {print $0}'