sysstat.sh

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 "scm1-scm4 sysstat-daily" scm-svr-mtr@scm5.***.cn < sysstat-daily.sh.log 

sysstat-daily.sh

#! /bin/sh 
echo "***10.12.5.11阵列情况...***" 
/usr/sbin/hpacucli ctrl all show status 
/usr/sbin/hpacucli ctrl all show config

echo . 
echo "***10.12.5.9阵列情况...***" 
ssh [email protected]  "hpacucli ctrl all show status" 
ssh [email protected]  "hpacucli ctrl all show config"

echo . 
echo "***10.12.5.53阵列情况...***" 
ssh [email protected]  "hpacucli ctrl all show status" 
ssh [email protected]  "hpacucli ctrl all show config"

echo . 
echo "***10.12.5.16阵列情况...***" 
ssh [email protected]  "hpacucli ctrl all show status" 
ssh [email protected]  "hpacucli ctrl all show config"

echo . 
echo "***10.12.5.21阵列情况...***" 
ssh [email protected]  "hpacucli ctrl all show status" 
ssh [email protected]  "hpacucli ctrl all show config"

echo . 
echo "***10.12.5.27阵列情况...***" 
ssh [email protected] "cd /opt/MegaRAID/MegaCli/; ./MegaCli64 -cfgdsply -aALL | grep "Predictive Failure Count""|awk '{if($NF!="0")print $0 "error"; else print "ok"}'

echo . 
echo "***10.12.5.33阵列情况...***" 
ssh [email protected] "cd /opt/MegaRAID/MegaCli/; ./MegaCli64 -cfgdsply -aALL | grep "Predictive Failure Count""|awk '{if($NF!="0")print $0 "error"; else print "ok"}'

echo . 
echo "***10.12.5.40阵列情况...***" 
ssh [email protected]  "hpacucli ctrl all show status" 
ssh [email protected]  "hpacucli ctrl all show config"

#echo . 
#echo "***10.12.5.44硬盘情况...***" 
#ssh [email protected] "smartctl -H /dev/sda"

echo . 
echo "***10.12.5.46阵列情况...***" 
#ssh [email protected] "mpt-status -i 1" 
ssh [email protected] "cd /opt/lsiutil/; ./lsiutil -p1 -a 21,1,0,0" |awk 'NR==38,NR==46 {print $0}'

echo . 
echo "***10.12.5.47阵列情况...***" 
#ssh [email protected] "mpt-status -i 1" 
ssh [email protected] "cd /opt/lsiutil/; ./lsiutil -p1 -a 21,1,0,0" |awk 'NR==38,NR==46 {print $0}'

echo . 
echo "***10.12.5.50阵列情况...***" 
#ssh [email protected] "mpt-status -n" 
ssh [email protected] "cd /opt/lsiutil/; ./lsiutil -p1 -a 21,1,0,0" |awk 'NR==38,NR==46 {print $0}'

#echo . 
#echo "***10.1.56.9阵列情况...***" 
#echo RAID Mode, eg. stripe mirror etc 
#snmpwalk -v 2c -c SinoHBMi 10.1.56.9 .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.1.56.9 .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.1.56.9 .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"}'

你可能感兴趣的:(sysstat.sh)