diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2016-06-11 10:51:48 +0200 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2016-06-29 14:04:23 +0100 |
commit | f2d8b81061fa55a686b30e3303d27aa92bde036f (patch) | |
tree | 0c64d25a9c8b112a360b29e296ed08b3eb59af20 | |
parent | e0dbf5957623764118d6f05e10611a941a5985cc (diff) | |
download | sos-f2d8b81061fa55a686b30e3303d27aa92bde036f.tar.gz |
[gluster] limit size of logs collected
Apply global parameters when collecting gluster logs.
Resolves: #834
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r-- | sos/plugins/gluster.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py index cbcc3d34..a303f818 100644 --- a/sos/plugins/gluster.py +++ b/sos/plugins/gluster.py @@ -91,10 +91,24 @@ class Gluster(Plugin, RedHatPlugin): "/etc/glusterd.rpmsave", # common to all versions "/etc/glusterfs", - "/var/lib/glusterd/", - "/var/log/glusterfs" + "/var/lib/glusterd/" ] + glob.glob('/var/run/gluster/*tier-dht/*')) + # collect logs - apply log_size for any individual file + # all_logs takes precedence over logsize + if not self.get_option("all_logs"): + limit = self.get_option("log_size") + else: + limit = 0 + + if limit: + for f in (glob.glob("/var/log/glusterfs/*log") + + glob.glob("/var/log/glusterfs/*/*log") + + glob.glob("/var/log/glusterfs/geo-replication/*/*log")): + self.add_copy_spec_limit(f, limit) + else: + self.add_copy_spec("/var/log/glusterfs") + self.make_preparations(self.statedump_dir) if self.check_ext_prog("killall -USR1 glusterfs glusterfsd"): # let all the processes catch the signal and create statedump file |