diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2019-07-09 13:15:48 +0200 |
---|---|---|
committer | Pavel Moravec <pmoravec@redhat.com> | 2019-07-09 13:15:48 +0200 |
commit | b3d9fdf568e25997eb006e575d26fb301b91414b (patch) | |
tree | 9cb60cbc1d48d0ccbf99e56a3d63e994fd301232 | |
parent | fb6363c004e15cb6d37c7db687d776382bf205e9 (diff) | |
download | sos-b3d9fdf568e25997eb006e575d26fb301b91414b.tar.gz |
[sar] collect whole sar log dir
Currently, sosreport does not collect files in saYYYYMMDD or
similar format. Assuming sar log dir contains only sar related data
it is safe to collect whole dir (up to size limit, from newest to
oldest files).
Resolves: #1700
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r-- | sos/plugins/sar.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py index 492c38a2..5a1b9f30 100644 --- a/sos/plugins/sar.py +++ b/sos/plugins/sar.py @@ -22,24 +22,9 @@ class Sar(Plugin,): option_list = [("all_sar", "gather all system activity records", "", False)] - # size-limit SAR data collected by default (MB) - sa_size = 20 - def setup(self): - if self.get_option("all_sar"): - self.sa_size = 0 - - # Copy all sa??, sar??, sa??.* and sar??.* files, which will net - # compressed and uncompressed versions, typically. - for suffix in ('', '.*'): - self.add_copy_spec( - os.path.join(self.sa_path, "sa[0-3][0-9]" + suffix), - sizelimit=self.sa_size, tailit=False - ) - self.add_copy_spec( - os.path.join(self.sa_path, "sar[0-3][0-9]" + suffix), - sizelimit=self.sa_size, tailit=False - ) + self.add_copy_spec(self.sa_path, + sizelimit=0 if self.get_option("all_sar") else None) try: dir_list = os.listdir(self.sa_path) |