aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-12-04 20:29:52 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-12-04 20:29:52 +0000
commita46a299771191cd4b07bc33874aa832ad0daf36e (patch)
tree08cee7f02adcce5719e40d45dab9f1e33a5a7fda
parente234fbc711b6786f712ed11bafc0b40890b28dca (diff)
downloadsos-a46a299771191cd4b07bc33874aa832ad0daf36e.tar.gz
Collect non-standard syslog and rsyslog log files
-rw-r--r--sos/plugins/general.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/sos/plugins/general.py b/sos/plugins/general.py
index 7fe689c9..c7b67113 100644
--- a/sos/plugins/general.py
+++ b/sos/plugins/general.py
@@ -64,13 +64,21 @@ class RedHatGeneral(general, RedHatPlugin):
])
if self.getOption('all_logs'):
- rhelver = self.policy().rhelVersion()
- logconf = (rhelver in (4, 5)) and "/etc/syslog.conf" \
- or "/etc/rsyslog.conf"
- logs = self.doRegexFindAll(r"^\S+\s+(\/.*log.*)\s+$", logconf)
+ print "doing all_logs..."
+ limit = self.isOptionEnabled("syslogsize")
+ logs = self.doRegexFindAll("^\S+\s+(-?\/.*$)\s+",
+ "/etc/syslog.conf")
+ print logs
+ if self.policy().pkgByName("rsyslog") \
+ or os.path.exists("/etc/rsyslog.conf"):
+ logs += self.doRegexFindAll("^\S+\s+(-?\/.*$)\s+", "/etc/rsyslog.conf")
+ print logs
for i in logs:
+ if i.startswith("-"):
+ i = i[1:]
if os.path.isfile(i):
- self.addCopySpec(i)
+ self.addCopySpecLimit(i, sizelimit = limit)
+
def postproc(self):
self.doRegexSub("/etc/sysconfig/rhn/up2date",