tuxedo unix下检查脚本

set echo on
num=0
loopnum=288
sleep_time=300
env > env.out
hostname > hostname.out
uname -a > uname.out
cat /etc/hosts > hosts.out
tmunloadcf > tmunloadcf.out
dmunloadcf > dmunloadcf.out

/usr/sbin/kmtune > kmtune.out
/usr/sbin/swlist -l product > swlist.out

#echo `date "+%y/%m/%d %H/%M/%S"`"\t\c" 1 >> psr.out 2>> psr.err
#echo "verbose\npsr"|tmadmin 2>/dev/null >> psr.out
   echo `date "+%y/%m/%d %H/%M/%S"`"\t\c" 1 >> psr_verbose.out 2>> psr_verbose.err
   echo "verbose\npsr"|tmadmin -r 2>/dev/null >> psr_verbose.out

cp $TUXDIR/udataobj/lic.txt ./
ulogdir=/is2/oboss/run/log
grep "_CAT:" ${ulogdir}/ULOG* | grep -v "INFO:" > ulog.out

while [ $num -lt $loopnum ]
do
   num=`echo "$num + 1" | bc`

   #echo `date "+%y/%m/%d %H/%M/%S"`"\t\c" 1 >> psr_verbose.out 2>> psr_verbose.err
   #echo "verbose\npsr"|tmadmin -r 2>/dev/null >> psr_verbose.out

   echo `date "+%y/%m/%d %H/%M/%S"`"\t\c"  1>>vmstat.out 2>>vmstat.err
   vmstat  1 20 |awk '{print $0}BEGIN {ln=0}{ln++;if(ln<4) next}{a=a+$18;} END{print "CPU AVERAGE USE VALUE:"100-a/19}' >> vmstat.ou
t
   echo "" >>vmstat.out

   echo `date "+%y/%m/%d %H/%M/%S"`"\t\c"  1>>pq.out 2>>pq.err
   echo "pq"|tmadmin -r 2>/dev/null |awk '$5!="0"' >> pq.out
   echo "" >>pq.out
   ipcs -qop |awk '$7!="0"' >> pq.out
   echo "" >> pq.out


   echo `date "+%y/%m/%d %H/%M/%S"`"\t\c"  1>>psr.out 2>>psr.err
   echo "psr"|tmadmin -r 2>/dev/null | awk '$6!="0" {print $0; a=a+$6; } END {print " Total load done: "a;}' | grep -v IDLE >> psr.o
ut
   echo "" >>psr.out


   echo `date "+%y/%m/%d %H/%M/%S"`"\t\c"  1>>pclt.out 2>>pclt.err
   echo "pclt"|tmadmin -r 2>/dev/null >> pclt.out
   echo "total clients:" >> pclt.out
   echo "pclt"|tmadmin -r 2>/dev/null |wc -l >> pclt.out
   echo "" >> pclt.out

   echo `date "+%y/%m/%d %H/%M/%S"`"\t\c" 1 >> bbs.out
   echo "bbs" | tmadmin -r >> bbs.out
   echo "" >> bbs.out

   top -d 1 -u -f ./top.out
   echo "" >> top.out

   sleep $sleep_time
done
exit

你可能感兴趣的:(C++,c,unix,脚本,bbs)