[Cluster-devel] conga/ricci/modules/log LogParser.cpp
kupcevic at sourceware.org
kupcevic at sourceware.org
Tue Aug 15 00:00:12 UTC 2006
CVSROOT: /cvs/cluster
Module name: conga
Changes by: kupcevic at sourceware.org 2006-08-15 00:00:12
Modified files:
ricci/modules/log: LogParser.cpp
Log message:
log module: improve kernel logs handling, update tags to parse for CS5 logs
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/log/LogParser.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
--- conga/ricci/modules/log/LogParser.cpp 2006/08/11 16:27:28 1.5
+++ conga/ricci/modules/log/LogParser.cpp 2006/08/15 00:00:10 1.6
@@ -39,17 +39,30 @@
-static const char* cluster[] = {"dlm",
+static const char* cluster[] = {"cluster",
+ "modclusterd",
+ "dlm",
"gulm",
"cman",
+ "cman_tool",
+ "ccs",
+ "ccs_tool",
"ccsd",
"fence",
"fenced",
"clvmd",
"gfs",
- "clurgmgrd"};
+ "gfs2",
+ "openais",
+ "groupd",
+ "qdiskd",
+ "dlm_controld",
+ "gfs_controld",
+ "clurgmgrd",
+ "rgmanager"};
-static const char* cluster_service_manager[] = {"clurgmgrd"};
+static const char* cluster_service_manager[] = {"clurgmgrd",
+ "rgmanager"};
static const char* LVS[] = {"ipvs",
"ipvsadm",
@@ -57,10 +70,12 @@
"piranha-gui"};
static const char* storage[] = {"gfs",
+ "gfs2",
"lvm",
"clvm",
"clvmd",
"end_request",
+ "buffer",
"scsi",
"md",
"raid0",
@@ -68,10 +83,15 @@
"raid4",
"raid5",
"cdrom",
+ "ext2",
+ "ext3",
+ "ext3-fs",
+ "swap",
"mount",
"automount"};
static const char* selinux[] = {"selinux",
+ "security",
"pam",
"audit"};
@@ -201,8 +221,12 @@
vector<String> words = utils::split(entry);
if (words.size() < 6)
throw String("invalid log entry format");
- if (words[4] == "last" && words[5] == "message")
- throw String("LogEntry: last message repeatition");
+ if (words[4] == "last" &&
+ words[5] == "message")
+ throw String("LogEntry: last message repetition");
+ if (words[5] == "printk:" &&
+ entry.find("suppressed") != entry.npos)
+ throw String("LogEntry: printk repetition");
// get current year (not present in log files)
char buff[100];
@@ -236,31 +260,17 @@
tags.insert(pid);
}
vector<String>::size_type idx = 5;
- if (domain == "kernel")
- if (words[5][words[5].size()-1] == ':') {
- domain = utils::rstrip(utils::to_lower(words[5]), ":");
- tags.insert(domain);
+ if (domain == "kernel") {
+ domain = utils::rstrip(utils::to_lower(words[5]), ":");
+ tags.insert(domain);
+ if (words[5][words[5].size()-1] == ':')
idx = 6;
- }
+ }
// message
for ( ; idx<words.size(); idx++)
msg += words[idx] + " ";
msg = utils::strip(msg);
- // replace illegal XML characters
- i = 0;
- while ((i = msg.find_first_of("\"<>", i)) != msg.npos) {
- switch (msg[i]) {
- case '<':
- msg[i] = '(';
- break;
- case '>':
- msg[i] = ')';
- break;
- default:
- msg[i] = '\'';
- }
- }
// tags (misc)
for (vector<String>::size_type j=4; j<6; j++) {
More information about the Cluster-devel
mailing list