|
|
6b17e9 |
commit 3aa158a35a4e7fe4d370c254c320455081e3b1cb
|
|
|
6b17e9 |
Author: Bryn M. Reeves <bmr@redhat.com>
|
|
|
6b17e9 |
Date: Tue Oct 29 14:43:02 2013 +0000
|
|
|
6b17e9 |
|
|
|
6b17e9 |
Move sar data colletion to sar plug-in
|
|
|
6b17e9 |
|
|
|
6b17e9 |
Historically the general plug-in collected the content of the
|
|
|
6b17e9 |
/var/log/sa directory while a separate sar plug-in handles the text
|
|
|
6b17e9 |
formatted summary files.
|
|
|
6b17e9 |
|
|
|
6b17e9 |
This makes little sense and adds to the bloat in the "general"
|
|
|
6b17e9 |
module; move the collection to the sar plug-in itself.
|
|
|
6b17e9 |
|
|
|
6b17e9 |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
6b17e9 |
|
|
|
6b17e9 |
diff --git a/sos/plugins/general.py b/sos/plugins/general.py
|
|
|
6b17e9 |
index fbf3991..d7059e6 100644
|
|
|
6b17e9 |
--- a/sos/plugins/general.py
|
|
|
6b17e9 |
+++ b/sos/plugins/general.py
|
|
|
6b17e9 |
@@ -28,7 +28,6 @@ class General(Plugin):
|
|
|
6b17e9 |
"/etc/sos.conf",
|
|
|
6b17e9 |
"/etc/sysconfig",
|
|
|
6b17e9 |
"/proc/stat",
|
|
|
6b17e9 |
- "/var/log/sa",
|
|
|
6b17e9 |
"/var/log/pm/suspend.log",
|
|
|
6b17e9 |
"/var/log/up2date",
|
|
|
6b17e9 |
"/etc/hostid",
|
|
|
6b17e9 |
diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py
|
|
|
6b17e9 |
index c09055c..6c09323 100644
|
|
|
6b17e9 |
--- a/sos/plugins/sar.py
|
|
|
6b17e9 |
+++ b/sos/plugins/sar.py
|
|
|
6b17e9 |
@@ -33,6 +33,7 @@ class Sar(Plugin,):
|
|
|
6b17e9 |
return True
|
|
|
6b17e9 |
|
|
|
6b17e9 |
def setup(self):
|
|
|
6b17e9 |
+ self.add_copy_spec("/var/log/sa")
|
|
|
6b17e9 |
dirList = os.listdir(self.sa_path)
|
|
|
6b17e9 |
# find all the sa file that don't have an existing sar file
|
|
|
6b17e9 |
for fname in dirList:
|
|
|
6b17e9 |
commit d51a2b5e3c07ddc986c41e1494dabc852d224873
|
|
|
6b17e9 |
Author: Bryn M. Reeves <bmr@redhat.com>
|
|
|
6b17e9 |
Date: Tue Oct 29 14:53:53 2013 +0000
|
|
|
6b17e9 |
|
|
|
6b17e9 |
Limit default sar data collection
|
|
|
6b17e9 |
|
|
|
6b17e9 |
By default the general module will scoop up all files under the
|
|
|
6b17e9 |
/var/log/sa directory. With some configurations this path could
|
|
|
6b17e9 |
contain many GB of data.
|
|
|
6b17e9 |
|
|
|
6b17e9 |
Use add_copy_spec_limit() by default for sar data and add a new
|
|
|
6b17e9 |
option sar.all_sar=False to allow the user to override this.
|
|
|
6b17e9 |
|
|
|
6b17e9 |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
6b17e9 |
|
|
|
6b17e9 |
diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py
|
|
|
6b17e9 |
index 6c09323..4f89b53 100644
|
|
|
6b17e9 |
--- a/sos/plugins/sar.py
|
|
|
6b17e9 |
+++ b/sos/plugins/sar.py
|
|
|
6b17e9 |
@@ -23,6 +23,10 @@ class Sar(Plugin,):
|
|
|
6b17e9 |
|
|
|
6b17e9 |
packages = ('sysstat',)
|
|
|
6b17e9 |
sa_path = '/var/log/sa'
|
|
|
6b17e9 |
+ option_list = [("all_sar", "gather all system activity records", "", False)]
|
|
|
6b17e9 |
+
|
|
|
6b17e9 |
+ # size-limit SAR data collected by default (MB)
|
|
|
6b17e9 |
+ sa_size = 20
|
|
|
6b17e9 |
|
|
|
6b17e9 |
def check_enabled(self):
|
|
|
6b17e9 |
# check to see if we are force-enabled with no sar installation
|
|
|
6b17e9 |
@@ -33,7 +37,13 @@ class Sar(Plugin,):
|
|
|
6b17e9 |
return True
|
|
|
6b17e9 |
|
|
|
6b17e9 |
def setup(self):
|
|
|
6b17e9 |
- self.add_copy_spec("/var/log/sa")
|
|
|
6b17e9 |
+ if self.get_option("all_sar"):
|
|
|
6b17e9 |
+ self.sa_size = 0
|
|
|
6b17e9 |
+
|
|
|
6b17e9 |
+ self.add_copy_spec_limit("/var/log/sa/sar[0-9]*",
|
|
|
6b17e9 |
+ sizelimit = self.sa_size)
|
|
|
6b17e9 |
+ self.add_copy_spec_limit("/var/log/sa/sa[0-9]*",
|
|
|
6b17e9 |
+ sizelimit = self.sa_size)
|
|
|
6b17e9 |
dirList = os.listdir(self.sa_path)
|
|
|
6b17e9 |
# find all the sa file that don't have an existing sar file
|
|
|
6b17e9 |
for fname in dirList:
|