aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-03-06 10:00:00 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-03-19 17:50:32 +0000
commit862977fe6f7d7d805be5cca20e3d7dfcba2666f0 (patch)
treeaa90a26489e62da6c23d53f0dd2386c921592154
parente0d3597810c1a4e1f70eced7ddc896884055cd43 (diff)
downloadsos-862977fe6f7d7d805be5cca20e3d7dfcba2666f0.tar.gz
Collect non-standard syslog and rsyslog log files
Resolves: bz771501
-rw-r--r--sos/plugins/general.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/sos/plugins/general.py b/sos/plugins/general.py
index 75df6eed..db00947d 100644
--- a/sos/plugins/general.py
+++ b/sos/plugins/general.py
@@ -61,18 +61,14 @@ class general(sos.plugintools.PluginBase):
self.addForbiddenPath("/etc/pki/entitlement/*-key.pem")
if self.getOption('all_logs'):
- if rhelver == 5 or rhelver == 4:
- logs=self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", "/etc/syslog.conf")
- for i in logs:
- if not os.path.isfile(i): continue
- self.addCopySpec(i)
-
- if rhelver == 6:
- logs=self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", "/etc/rsyslog.conf")
- for i in logs:
- if not os.path.isfile(i): continue
- self.addCopySpec(i)
-
+ logs = self.doRegexFindAll("^\S+\s+(-?\/.*$)\s+", "/etc/syslog.conf")
+ if self.cInfo["policy"].pkgByName("rsyslog") or os.path.exists("/etc/rsyslog.conf"):
+ logs += self.doRegexFindAll("^\S+\s+(-?\/.*$)\s+", "/etc/rsyslog.conf")
+ for i in logs:
+ if i.startswith("-"):
+ i = i[1:]
+ if os.path.isfile(i):
+ self.addCopySpecLimit(i, sizelimit = self.isOptionEnabled("syslogsize"))
return
def postproc(self):