aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvredara <redara@redhat.com>2017-06-29 00:36:37 +0530
committerAdam Stokes <battlemidget@users.noreply.github.com>2017-06-28 15:06:37 -0400
commit07e6ce3ee1f18a09fa8eaa77fc10729c970bf5f6 (patch)
tree2f227ff373fdc8d2def68095c08388cb0db2598e
parent982e75ce4415f18ad55449414184b83513356aae (diff)
downloadsos-07e6ce3ee1f18a09fa8eaa77fc10729c970bf5f6.tar.gz
[gluster_block] Added new plugin gluster_block (#1041)
gluster_block plugin collects config/log files related to blocks Signed-off-by: venkata edara <redara@redhat.com> Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>
-rw-r--r--sos/plugins/gluster_block.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/sos/plugins/gluster_block.py b/sos/plugins/gluster_block.py
new file mode 100644
index 00000000..39efbd74
--- /dev/null
+++ b/sos/plugins/gluster_block.py
@@ -0,0 +1,39 @@
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+import glob
+from sos.plugins import Plugin, RedHatPlugin
+
+
+class GlusterBlock(Plugin, RedHatPlugin):
+ """Gluster Block"""
+
+ plugin_name = 'gluster_block'
+ profiles = ('storage',)
+ packages = ("gluster-block",)
+ files = ("/usr/sbin/gluster-block",)
+
+ def setup(self):
+
+ # 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/gluster-block/*.log"):
+ self.add_copy_spec(f, limit)
+ else:
+ self.add_copy_spec("/var/log/gluster-block")