aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Patil <psachin@redhat.com>2017-12-22 13:18:01 +0530
committerBryn M. Reeves <bmr@redhat.com>2018-04-16 16:31:43 +0100
commitec652a4992ed14df6131a38fa62f950eb64e4340 (patch)
treeb4463d8bf0bdda90076a6ec551193569506901cf
parent4db995828cdba4e2058ba39bbd0e554cf941c715 (diff)
downloadsos-ec652a4992ed14df6131a38fa62f950eb64e4340.tar.gz
[gluster] Optionally enable dump
Currently a dump is collected every time sosreport is run. Dump is not required by Gluster support team and also consumes space in `/var/run/gluster/` unnecessarily. This patch adds an option to enable dump only when required using ``` -k gluster.dump ``` Usage: ``` sosreport -o gluster -k gluster.dump ``` Dump will is disabled by default. Resolves: #1174 Signed-off-by: Sachin Patil <psachin@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/gluster.py44
1 files changed, 23 insertions, 21 deletions
diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py
index a55c28be..86caebe1 100644
--- a/sos/plugins/gluster.py
+++ b/sos/plugins/gluster.py
@@ -30,6 +30,8 @@ class Gluster(Plugin, RedHatPlugin):
packages = ["glusterfs", "glusterfs-core"]
files = ["/etc/glusterd", "/var/lib/glusterd"]
+ option_list = [("dump", "enable glusterdump support", "slow", False)]
+
def get_volume_names(self, volume_file):
"""Return a dictionary for which key are volume names according to the
output of gluster volume info stored in volume_file.
@@ -111,32 +113,32 @@ class Gluster(Plugin, RedHatPlugin):
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
- # entries.
- time.sleep(1)
- self.wait_for_statedump(self.statedump_dir)
- self.add_copy_spec('/tmp/glusterdump.options')
- self.add_copy_spec(self.statedump_dir)
- else:
- self.soslog.info("could not send SIGUSR1 to glusterfs processes")
+ if self.get_option("dump"):
+ 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 entries.
+ time.sleep(1)
+ self.wait_for_statedump(self.statedump_dir)
+ self.add_copy_spec('/tmp/glusterdump.options')
+ self.add_copy_spec(self.statedump_dir)
+ else:
+ self.soslog.info("could not send SIGUSR1 to glusterfs \
+ processes")
volume_file = self.get_cmd_output_now("gluster volume info")
if volume_file:
for volname in self.get_volume_names(volume_file):
self.add_cmd_output([
- "gluster volume geo-replication %s status"
- % volname,
- "gluster volume heal %s info" % volname,
- "gluster volume heal %s info split-brain"
- % volname,
- "gluster snapshot list %s" % volname,
- "gluster volume quota %s list" % volname,
- "gluster volume rebalance %s status"
- % volname,
- "gluster snapshot info %s" % volname,
- "gluster snapshot status %s" % volname])
+ "gluster volume geo-replication %s status" % volname,
+ "gluster volume heal %s info" % volname,
+ "gluster volume heal %s info split-brain" % volname,
+ "gluster snapshot list %s" % volname,
+ "gluster volume quota %s list" % volname,
+ "gluster volume rebalance %s status" % volname,
+ "gluster snapshot info %s" % volname,
+ "gluster snapshot status %s" % volname
+ ])
self.add_cmd_output("gluster pool list")
self.add_cmd_output("gluster volume status")