运维开发网
广告位招商联系QQ:123077622
 
广告位招商联系QQ:123077622

IBM AIX 巡检脚本

运维开发网 https://www.qedev.com 2020-11-27 09:19 出处:51CTO 作者:yuanqianghe
exportLANG=en_USecho"========systeminformation========">aix_chk.outprtconf>/tmp/aix_chk_tmp1grep"SystemModel"/tmp/aix_chk_tmp1>>aix_chk.outgrep"MachineSerialNumber

export LANG=en_US

echo "======== system information ========" > aix_chk.out

prtconf > /tmp/aix_chk_tmp1

grep "System Model" /tmp/aix_chk_tmp1 >> aix_chk.out

grep "Machine Serial Number" /tmp/aix_chk_tmp1 >> aix_chk.out

grep "Host Name:" /tmp/aix_chk_tmp1 >> aix_chk.out

grep "Number Of Processors" /tmp/aix_chk_tmp1 >> aix_chk.out

grep "Processor Clock Speed" /tmp/aix_chk_tmp1 >> aix_chk.out

grep "Memory Size" /tmp/aix_chk_tmp1 >> aix_chk.out

grep "Good Memory Size" /tmp/aix_chk_tmp1 >> aix_chk.out

echo "" >> aix_chk.out

echo "MICROCODE LEVEL" >> aix_chk.out

lsmcode >> aix_chk.out

echo "" >> aix_chk.out

echo "oslevel -s" >> aix_chk.out

oslevel -s >> aix_chk.out

echo "oslevel -sq" >> aix_chk.out

oslevel -sq |head -3 >> aix_chk.out

echo "" >> aix_chk.out

echo "======== boot information ========" >> aix_chk.out

echo "bootlist" >> aix_chk.out

bootlist -m normal -o >> aix_chk.out

echo "" >> aix_chk.out

w |head -1 >> aix_chk.out

echo "" >> aix_chk.out

echo "======== rootvg mirror check ========" >> aix_chk.out

lsvg -l rootvg >> aix_chk.out

echo "" >> aix_chk.out

echo "======== mail check ========" >> aix_chk.out

echo "/var/spool/mail/*" >> aix_chk.out

ls -l /var/spool/mail >> aix_chk.out

echo "" >> aix_chk.out

echo "======== crontab check ========" >> aix_chk.out

echo "/var/adm/cron/log" >> aix_chk.out

grep "queue" /var/adm/cron/log >> aix_chk.out

echo "" >> aix_chk.out

echo "======== syncd check ========" >> aix_chk.out

ps -ef|grep syncd >> aix_chk.out

echo "" >> aix_chk.out

echo "======== pgsp check ========" >> aix_chk.out

lsps -a >> aix_chk.out

echo "" >> aix_chk.out

echo "======== vmo check ========" >> aix_chk.out

vmo -a > /tmp/aix_chk.tmp2

grep "maxfree" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "minfree" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "maxpin%" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "strict_maxperm" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "maxperm%" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "minperm%" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "maxclient%" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "strict_maxclient" /tmp/aix_chk.tmp2 >> aix_chk.out

echo "" >> aix_chk.out

echo "======== sys0 check ========" >> aix_chk.out

echo "lsattr -El sys0" >> aix_chk.out

lsattr -El sys0 |grep minpout >> aix_chk.out

lsattr -El sys0 |grep maxpout >> aix_chk.out

echo "" >> aix_chk.out

echo "======== VG check ========" >> aix_chk.out

lsvg -o|lsvg -i >> aix_chk.out

lsvg -o|lsvg -il >> aix_chk.out

echo "" >> aix_chk.out

echo "======== filesystems check ========" >> aix_chk.out

df -g >> aix_chk.out

mount >> aix_chk.out

echo "" >> aix_chk.out

echo "======== network check ========" >> aix_chk.out

echo "netstat -i" >> aix_chk.out

netstat -i >> aix_chk.out

echo "" >> aix_chk.out

echo "netstat -v" >> aix_chk.out

netstat -v |grep "Max Packets on S/W Transmit Queue" >> aix_chk.out

netstat -v |grep "S/W Transmit Queue Overflow" >> aix_chk.out

echo "" >> aix_chk.out

echo "netstat -s" >> aix_chk.out

echo "tcp" >> aix_chk.out

netstat -s -p tcp > /tmp/aix_chk.tmp2

grep "packets sent" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "retransmitted" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "packets received" /tmp/aix_chk.tmp2|grep -v "packets received after close" >> aix_chk.out

grep "packets with bad hardware assisted checksum" /tmp/aix_chk.tmp2 >> aix_chk.out

echo "" >> aix_chk.out

echo "udp" >> aix_chk.out

netstat -s -p udp > /tmp/aix_chk.tmp2

grep "dropped due to no socket" /tmp/aix_chk.tmp2|grep -v "broadcast" >> aix_chk.out

grep "broadcast/multicast datagrams dropped due to no socket" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "socket buffer overflows" /tmp/aix_chk.tmp2 >> aix_chk.out

echo "" >> aix_chk.out

echo "======== vmstat check ========" >> aix_chk.out

vmstat -v > /tmp/aix_chk.tmp2

grep "memory pages" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "pinned pages" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "numperm percentage" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "numclient percentage" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "pending disk I/Os blocked with no pbuf" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "paging space I/Os blocked with no psbuf" /tmp/aix_chk.tmp2 >> aix_chk.out

grep "filesystem I/Os blocked with no fsbuf" /tmp/aix_chk.tmp2 >> aix_chk.out

mv /tmp/aix_chk.out /tmp/hostname_chk.log

rm -f /tmp/aix_chk.tmp2 /tmp/aix_chk_tmp1

more /tmp/hostname_chk.log

扫码领视频副本.gif

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号