• R/O
  • SSH

pm_logconv-cs: Commit

Pacemaker 対応ログメッセージ変換機能。

Heartbeat-2.1.4 用 hb-logconv(*) のPacemaker 1.0.x + Corosync スタック対応版。
(*) http://sourceforge.jp/projects/linux-ha/releases/?package_id=10282


Commit MetaInfo

Revisione873319d7f133b5849aa038da617e8598d02abbd (tree)
Time2013-06-13 19:01:15
AuthorYoshihiko SATO <satoyoshi@inte...>
CommiterYoshihiko SATO

Log Message

Pacemaker本体のプロセス故障ログ変更に伴う対応(MsgNo.10-2,10-6)

Change Summary

Incremental Difference

diff -r f762544af2e3 -r e873319d7f13 pm_logconv.conf
--- a/pm_logconv.conf Thu Jun 06 14:06:22 2013 +0900
+++ b/pm_logconv.conf Thu Jun 13 19:01:15 2013 +0900
@@ -97,7 +97,7 @@
9797
9898 #MsgNo.10-2
9999 [Respawn process exited abnormally]
100-pattern=error:,pcmk_,Child process,exited,pid=,!rc=0
100+pattern=pacemakerd,error:,pcmk_child_exit:,Child process,!OK
101101 func=respawn_exited_abnormally
102102 loglevel=warning
103103
@@ -109,7 +109,7 @@
109109
110110 #MsgNo.10-6
111111 [Respawn process exited normally]
112-pattern=pacemakerd,info:,pcmk_child_exit:,Child process,exited,pid=,rc=0
112+pattern=pacemakerd,info:,pcmk_child_exit:,Child process,OK
113113 func=respawn_exited_normally
114114
115115 #MsgNo.10-7
diff -r f762544af2e3 -r e873319d7f13 pm_logconv.py
--- a/pm_logconv.py Thu Jun 06 14:06:22 2013 +0900
+++ b/pm_logconv.py Thu Jun 13 19:01:15 2013 +0900
@@ -2658,14 +2658,14 @@
26582658
26592659 MsgNo.10-2)
26602660 Jan 1 00:00:00 node01 pacemakerd[777]: error: pcmk_child_exit:
2661- Child process cib exited (pid=888, rc=100)
2661+ Child process crmd (888) exited: Generic Pacemaker error (201)
26622662 '''
26632663 def respawn_exited_abnormally(self, outputobj, logelm, lconvfrm):
26642664 try:
26652665 wordlist = logelm.halogmsg.split()
2666- procname = wordlist[-4]
2667- pid = self.trimmark(wordlist[-2],"=").split("=")[1]
2668- exitcode = self.trimmark(wordlist[-1],"=").split("=")[1]
2666+ procname = wordlist[wordlist.index("process") + 1]
2667+ pid = self.trimmark(wordlist[wordlist.index("process") + 2])
2668+ exitcode = self.trimmark(wordlist[-1])
26692669 except:
26702670 return CONV_PARSE_ERROR
26712671 if self.is_empty(procname, pid, exitcode):
@@ -2701,27 +2701,20 @@
27012701 Convert log message which means respawn process exited normally in shutdown process.
27022702
27032703 MsgNo.10-6)
2704- Jan 1 00:00:00 node01 pacemakerd[777]: info: pcmk_child_exit:
2705- Child process cib exited (pid=888, rc=0)
2704+ Jan 1 00:00:00 node01 pacemakerd[777]: info:
2705+ pcmk_child_exit: Child process cib (888) exited: OK (0)
27062706 '''
27072707 def respawn_exited_normally(self, outputobj, logelm, lconvfrm):
27082708 try:
2709- pid = ""
27102709 wordlist = logelm.halogmsg.split()
2711- if wordlist[0] == "pcmk_child_exit:":
2712- procname = wordlist[-4]
2713- pid = self.trimmark(wordlist[-2],"=").split("=")[1]
2714- else:
2715- procname = wordlist[-3]
2716-
2717- if pid != "":
2718- pid = " (pid=" + pid + ")"
2710+ procname = wordlist[wordlist.index("process") + 1]
2711+ pid = self.trimmark(wordlist[wordlist.index("process") + 2])
27192712 except:
27202713 return CONV_PARSE_ERROR
2721- if self.is_empty(procname):
2714+ if self.is_empty(procname, pid):
27222715 return CONV_ITEM_EMPTY
27232716
2724- convertedlog = ("Stop \"%s\" process normally.%s" % (procname, pid))
2717+ convertedlog = ("Stop \"%s\" process normally. (pid=%s)" % (procname, pid))
27252718 outputobj.output_log(lconvfrm.loglevel, convertedlog)
27262719 return CONV_OK
27272720
Show on old repository browser