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