Chinaunix首页 | 论坛 | 博客
  • 博客访问: 19268823
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类:

2008-05-11 22:17:05

开始学习HACMP,感觉它的日志种类太多、太乱,而且遇到问题时,不知改检查哪些日志。所以今天就写了两个脚本,帮助自己学习,正所谓工欲善其事,必先利其器。

    第一个脚本的作用是在HACMP有动作(启动、停止、同步、拔网线之类)前,将的几个常见日志清空,免得以后看起来太乱。这个可做可不做。
#!/usr/bin/ksh
# Use this scrīpt before your adjusting HACMP
# Function: Clear these logs as follow.
cat <<'!' >/tmp/HAlogs
/tmp/hacmp.out
/tmp/clstrmgr.debug
/var/hacmp/clcomd/clcomd.log
/var/hacmp/clcomd/clcomddiag.log
/tmp/cspoc.log
!

suffix=`date +"%y%m%d%H%M%S"`
for i in `cat /tmp/HAlogs`; do (cp $i $i.$suffix 2>/dev/null); done
for i in `cat /tmp/HAlogs`; do (> $i); done

    第二个脚本的作用是在HACMP有动作后,看看都有哪些日志发生了变化。剩下的就是自己去研究这些日志内容了。
#!/usr/bin/ksh
# Use this scrīpt after your adjusting HACMP
# Function: See which log has alteration.
cat /tmp/HAlogs 2>/dev/null
echo
echo

cat <<'!' >/tmp/HAlogs-result
###############
tail /tmp/hacmp.out 2>/dev/null

###############
tail /tmp/clstrmgr.debug 2>/dev/null

###############
tail /var/hacmp/clcomd/clcomd.log 2>/dev/null

###############
tail /var/hacmp/clcomd/clcomddiag.log 2>/dev/null

###############
cat /tmp/cspoc.log |egrep -p "FAIL|ERROR"

###############
tail /tmp/dms_loads.out 2>/dev/null

###############
tail /tmp/emuhacmp.out 2>/dev/null

###############
grep "Check:" /var/hacmp/clverify/clverify.log |sort |uniq

###############
grep -v "with 0 errors" /var/hacmp/log/clutils.log

###############
tail /var/hacmp/utilities/cl_configassist.log 2>/dev/null

###############
tail /var/ha/log/grpsvcs 2>/dev/null

###############
tail /var/ha/log/topsvcs 2>/dev/null
!

ksh -v /tmp/HAlogs-result

rm -f /tmp/HAlogs
rm -f /tmp/HAlogs-result

    下面是我执行第二个脚本的结果,看起来还不错,呵呵。
myHA1#/home/beginner> ./ha2


###############
tail /tmp/hacmp.out 2>/dev/null
                        HACMP Event Summary
Event: network_down_complete -1 net_rs232_02
Start time: Thu Nov 17 10:45:38 2005

End time: Thu Nov 17 10:45:39 2005

Action:         Resource:                       scrīpt Name:
----------------------------------------------------------------------------
No resources changed as a result of this event
----------------------------------------------------------------------------

###############
tail /tmp/clstrmgr.debug 2>/dev/null
Thu Nov 17 10:47:00 runClappmond(db2sysc_mon): Finished fork, child pid is 552976
Thu Nov 17 10:47:00 stabIntervalComplete(db2sysc_mon): Started run_clappmond with pid 552976
Thu Nov 17 10:47:00 umt::addAction() Called
Thu Nov 17 10:47:00 GetRmCtrlMsg: Called, state=ST_STABLE
Thu Nov 17 10:47:00 GetRmCtrlMsg: RM_InfoMsg msg received, pid=471394, monitor=3
Thu Nov 17 10:47:00 ResGroupList::monitorInfo(): monitor 3, pid 471394
Thu Nov 17 10:47:00 ResourceGroup::monitorInfo(): clappmond pid is 471394 for monitor db2sysc_mon
Thu Nov 17 10:47:00 clappmondInfo(db2sysc_mon): monitor is db2sysc_mon, clappmond pid is 471394
Thu Nov 17 10:51:24 restartIntervalCb(db2sysc_mon): Called
Thu Nov 17 10:51:24 Appmon::restartIntervalComplete(db2sysc_mon) Called

###############
tail /var/hacmp/clcomd/clcomd.log 2>/dev/null
Thu Nov 17 10:28:27 2005: Connection to node SFCDB2: closed
Thu Nov 17 10:28:41 2005: RSH:COMPLETED: exit code = 0, pid=135666
Thu Nov 17 10:28:41 2005: Connection to node SFCDB1: closed
Thu Nov 17 10:28:41 2005: CONNECTION: CLOSED: SFCDB1: 192.168.168.1->192.168.168.1
Thu Nov 17 10:37:32 2005: Activating timer = file_collections_auto_prop
Thu Nov 17 10:44:35 2005: CONNECTION: ACCEPTED: SFCDB2: 192.168.168.2->192.168.168.1
Thu Nov 17 10:44:35 2005: COLLVER: ACCEPTED: SFCDB2: 192.168.168.2->192.168.168.1
Thu Nov 17 10:45:05 2005: CONNECTION: CLOSED: SFCDB2: 192.168.168.2->192.168.168.1
Thu Nov 17 10:47:32 2005: Activating timer = file_collections_auto_prop
Thu Nov 17 10:57:32 2005: Activating timer = file_collections_auto_prop

###############
tail /var/hacmp/clcomd/clcomddiag.log 2>/dev/null
10:45:05.366003(515): NET MESSAGE=PING, NR=0, SIZE=0, LOCAL=0, REM=0
10:45:05.366024(515): Listen on 10 12
10:45:05.366043(515): Chosen slot = 1
10:45:05.366058(515): Reading 20 from 12, at 201677cc
10:45:05.366080(515): RC=0 from sock=12
10:45:05.366096(515): NET MESSAGE=FIN, NR=0, SIZE=0, LOCAL=0, REM=0
10:45:05.366113(515): write 0,20 to 12-sock,type=11,nr=0,l=0,r=0
10:45:05.366161(515): Removing from list,slot=1, sock=12
10:45:05.366236(515): Changing node state to 7
10:45:05.366256(515): Listen on 10

###############
cat /tmp/cspoc.log |egrep -p "FAIL|ERROR"

###############
tail /tmp/dms_loads.out 2>/dev/null

###############
tail /tmp/emuhacmp.out 2>/dev/null

###############
grep "Check:" /var/hacmp/clverify/clverify.log |sort |uniq
Check: PASSED

###############
grep -v "with 0 errors" /var/hacmp/log/clutils.log

###############
tail /var/hacmp/utilities/cl_configassist.log 2>/dev/null

###############
tail /var/ha/log/grpsvcs 2>/dev/null

###############
tail /var/ha/log/topsvcs 2>/dev/null
myHA1#/home/beginner>

阅读(1663) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~