IBM AIX 巡检脚本

℡╲_俬逩灬. 提交于 2020-11-27 09:32:03

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!