• 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

Revision3fb01c4594ce37b3600e2c030f0566bede4ff244 (tree)
Time2013-05-20 17:14:24
AuthorYoshihiko SATO <satoyoshi@inte...>
CommiterYoshihiko SATO

Log Message

ログ優先度の文字列をPacemaker本体に準拠

Change Summary

Incremental Difference

diff -r 11a6ae1b939d -r 3fb01c4594ce pm_logconv.conf
--- a/pm_logconv.conf Mon May 20 16:08:52 2013 +0900
+++ b/pm_logconv.conf Mon May 20 17:14:24 2013 +0900
@@ -35,7 +35,7 @@
3535 [Resource operation failed]
3636 pattern=crmd,!info:,process_lrm_event:,LRM operation,!rc=0,!rc=7,!rc=8,!_monitor_0,!_notify_0,!Timed Out
3737 func=operation_failed
38-loglevel=ERROR
38+loglevel=error
3939
4040 #MsgNo.1-4, 2-4, 3-3, 4-4, 5-4, 11-4, 12-4, 17-4, 19-3
4141 [OCF resource operation timedout]
@@ -46,7 +46,7 @@
4646 [Resource failure]
4747 pattern=crmd,notice:,process_lrm_event:,LRM operation,_monitor_,!_monitor_0,rc=7
4848 func=detect_rsc_failure
49-loglevel=ERROR
49+loglevel=error
5050
5151 ###
5252 # For Node status event.
@@ -70,13 +70,13 @@
7070 [Interconnect-LAN status dead]
7171 pattern=corosync,,Marking seqid,ringid,interface,FAULTY
7272 func=detect_iconnlan_dead
73-loglevel=WARN
73+loglevel=warning
7474
7575 #MsgNo.8-1
7676 [Network status dead]
77-pattern=ping,WARNING:,is inactive:
77+pattern=ping,is inactive:
7878 func=detect_node_dead
79-loglevel=ERROR
79+loglevel=error
8080
8181 ###
8282 # For Disk status event (detected by diskd).
@@ -85,7 +85,7 @@
8585 [Detect disk error]
8686 pattern=diskd,warning:,check_status:,disk status is changed,new_status,ERROR
8787 func=detect_disk_error
88-loglevel=ERROR
88+loglevel=error
8989
9090 ###
9191 # For respawn process event.
@@ -99,13 +99,13 @@
9999 [Respawn process exited abnormally]
100100 pattern=error:,pcmk_,Child process,exited,pid=,!rc=0
101101 func=respawn_exited_abnormally
102-loglevel=WARN
102+loglevel=warning
103103
104104 #MsgNo.10-3
105105 [Respawn process killed]
106106 pattern=pcmk_,Child process,terminated with signal
107107 func=respawn_killed
108-loglevel=WARN
108+loglevel=warning
109109
110110 #MsgNo.10-6
111111 [Respawn process exited normally]
@@ -124,14 +124,14 @@
124124 [Detect calculation starts]
125125 pattern=crmd,do_state_transition:,State transition,S_IDLE -> S_POLICY_ENGINE,!I_SHUTDOWN
126126 func=detect_pe_calc
127-loglevel=WARN
127+loglevel=warning
128128
129129 #MsgNo.F0-2, F12-1, F12-2
130130 [FailOver complete]
131131 pattern_idle=crmd,do_state_transition:,State transition,-> S_IDLE
132132 pattern_stopping=crmd,do_state_transition:,State transition,-> S_STOPPING
133133 func=detect_fo_complete
134-loglevel=WARN
134+loglevel=warning
135135
136136 #MsgNo.F1-1, F1-2, F2-1, F2-2, F3-1, F3-2, F4-1, F4-2, F6-1, F6-2
137137 [Action failure]
@@ -240,7 +240,7 @@
240240
241241 #MsgNo.21-3
242242 [fence operation failed]
243-pattern=crmd,ERROR:,tengine_stonith_notify:,could not be terminated,by <anyone>,
243+pattern=crmd,error:,tengine_stonith_notify:,could not be terminated,by <anyone>,
244244 func=fence_op_failed
245245
246246 #MsgNo.21-5
diff -r 11a6ae1b939d -r 3fb01c4594ce pm_logconv.py
--- a/pm_logconv.py Mon May 20 16:08:52 2013 +0900
+++ b/pm_logconv.py Mon May 20 17:14:24 2013 +0900
@@ -150,8 +150,7 @@
150150 syslog.LOG_ERR, syslog.LOG_WARNING, syslog.LOG_NOTICE,
151151 syslog.LOG_INFO, syslog.LOG_DEBUG ]
152152
153- prioritystr = [ "EMERG", "ALERT", "CRIT", "ERROR", "WARN",
154- "notice", "info", "debug" ]
153+ prioritystr = [ "emerg", "alert", "crit", "error", "warning", "notice", "info", "debug" ]
155154
156155 DEFAULT_LOGOPT = syslog.LOG_CONS
157156 DEFAULT_FACILITY = syslog.LOG_DAEMON
@@ -305,14 +304,14 @@
305304 return False
306305
307306 if self.output == None:
308- syslog.syslog(self.syspriority[priority], "[%d]: %-7s %s" %
307+ syslog.syslog(self.syspriority[priority], "[%d]: %8s %s" %
309308 (self.pid, self.prioritystr[priority] + ':', message.rstrip()))
310309 else:
311310 t = datetime.datetime.today()
312311 tfmt = "%s %2d %s" % \
313312 (t.strftime('%b'), int(t.strftime('%d')), t.strftime('%X'))
314313 f = open(self.output, 'a')
315- f.write("%s %s [%d]: %-7s %s\n" % (tfmt, HOSTNAME, self.pid,
314+ f.write("%s %s [%d]: %8s %s\n" % (tfmt, HOSTNAME, self.pid,
316315 self.prioritystr[priority] + ':', message.rstrip()))
317316 f.close()
318317 return True
@@ -1729,7 +1728,7 @@
17291728 output_logmsg = convlogmsg
17301729
17311730 try:
1732- outputstr = ("%s %s %s: %s" %
1731+ outputstr = ("%s %s %7s: %s" %
17331732 (self.datestr, HOSTNAME, output_loglevel, output_logmsg))
17341733 f = open(OUTPUTFILE, 'a')
17351734 f.write("%s\n" % (outputstr))
@@ -1876,9 +1875,9 @@
18761875 See the head of this file.
18771876 '''
18781877 class LogConvertFuncs:
1879- LOG_ERR_LV = "ERROR"
1880- LOG_WARN_LV = "WARN"
1881- LOG_INFO_LV = "info"
1878+ LOG_ERR_LV = "error"
1879+ LOG_WARN_LV = "warning"
1880+ LOG_INFO_LV = "info"
18821881 LOG_DEBUG_LV = "debug"
18831882
18841883 def __init__(self, rscstatList=None):
Show on old repository browser