diff options
-rw-r--r-- | sos/plugins/cluster.py | 100 |
1 files changed, 58 insertions, 42 deletions
diff --git a/sos/plugins/cluster.py b/sos/plugins/cluster.py index 97e14654..7b78544b 100644 --- a/sos/plugins/cluster.py +++ b/sos/plugins/cluster.py @@ -20,18 +20,22 @@ class cluster(Plugin, RedHatPlugin): """cluster suite and GFS related information """ - optionList = [("gfslockdump", 'gather output of gfs lockdumps', 'slow', False), - ('lockdump', 'gather dlm lockdumps', 'slow', False)] + optionList = [("gfslockdump", + 'gather output of gfs lockdumps', 'slow', False), + ('lockdump', 'gather dlm lockdumps', 'slow', False)] def checkenabled(self): rhelver = self.policy().rhelVersion() if rhelver == 4: - self.packages = [ "ccs", "cman", "cman-kernel", "magma", "magma-plugins", - "rgmanager", "fence", "dlm", "dlm-kernel", "gulm", - "GFS", "GFS-kernel", "lvm2-cluster" ] + self.packages = [ "ccs", "cman", "cman-kernel", "magma", + "magma-plugins", "rgmanager", "fence", "dlm", + "dlm-kernel", "gulm", "GFS", "GFS-kernel", + "lvm2-cluster" ] elif rhelver == 5: - self.packages = [ "rgmanager", "luci", "ricci", "system-config-cluster", - "gfs-utils", "gnbd", "kmod-gfs", "kmod-gnbd", "lvm2-cluster", "gfs2-utils" ] + self.packages = [ "rgmanager", "luci", "ricci", + "system-config-cluster", "gfs-utils", "gnbd", + "kmod-gfs", "kmod-gnbd", "lvm2-cluster", + "gfs2-utils" ] elif rhelver == 6: self.packages = [ "ricci", "corosync", "openais", @@ -61,7 +65,8 @@ class cluster(Plugin, RedHatPlugin): if self.getOption('lockdump'): self.do_lockdump() - self.collectExtOutput("/usr/sbin/rg_test test /etc/cluster/cluster.conf") + self.collectExtOutput("/usr/sbin/rg_test test " + + "/etc/cluster/cluster.conf" ) self.collectExtOutput("fence_tool ls -n") self.collectExtOutput("gfs_control ls -n") self.collectExtOutput("dlm_tool log_plock") @@ -76,58 +81,69 @@ class cluster(Plugin, RedHatPlugin): self.collectExtOutput("/sbin/ipvsadm -L") if rhelver is 4: - self.addCopySpec("/proc/cluster/*") - self.collectExtOutput("cman_tool nodes") + self.addCopySpec("/proc/cluster/*") + self.collectExtOutput("cman_tool nodes") if rhelver is not 4: # 5+ - self.collectExtOutput("cman_tool -a nodes") + self.collectExtOutput("cman_tool -a nodes") if rhelver is 5: - self.collectExtOutput("group_tool -v") - self.collectExtOutput("group_tool dump fence") - self.collectExtOutput("group_tool dump gfs") + self.collectExtOutput("group_tool -v") + self.collectExtOutput("group_tool dump fence") + self.collectExtOutput("group_tool dump gfs") if rhelver not in (4,5): # 6+ - self.collectExtOutput("corosync-quorumtool -l") - self.collectExtOutput("corosync-quorumtool -s") - self.collectExtOutput("corosync-cpgtool") - self.collectExtOutput("corosync-objctl") - self.collectExtOutput("group_tool ls -g1") - self.collectExtOutput("gfs_control ls -n") - self.collectExtOutput("gfs_control dump") - self.collectExtOutput("fence_tool dump") - self.collectExtOutput("dlm_tool dump") - self.collectExtOutput("dlm_tool ls -n") + self.collectExtOutput("corosync-quorumtool -l") + self.collectExtOutput("corosync-quorumtool -s") + self.collectExtOutput("corosync-cpgtool") + self.collectExtOutput("corosync-objctl") + self.collectExtOutput("group_tool ls -g1") + self.collectExtOutput("gfs_control ls -n") + self.collectExtOutput("gfs_control dump") + self.collectExtOutput("fence_tool dump") + self.collectExtOutput("dlm_tool dump") + self.collectExtOutput("dlm_tool ls -n") def do_lockdump(self): rhelver = self.policy().rhelVersion() if rhelver is 4: - status, output, time = self.callExtProg("cman_tool services") - for lockspace in re.compile(r'^DLM Lock Space:\s*"([^"]*)".*$', re.MULTILINE).findall(output): - self.callExtProg("echo %s > /proc/cluster/dlm_locks" % lockspace) - self.collectOutputNow("cat /proc/cluster/dlm_locks", - suggest_filename = "dlm_locks_%s" % lockspace) + status, output, time = self.callExtProg("cman_tool services") + for lockspace in re.compile(r'^DLM Lock Space:\s*"([^"]*)".*$', + re.MULTILINE).findall(output): + self.callExtProg("echo %s > /proc/cluster/dlm_locks" + % lockspace) + self.collectOutputNow("cat /proc/cluster/dlm_locks", + suggest_filename = "dlm_locks_%s" % lockspace) if rhelver is 5: - status, output, time = self.callExtProg("group_tool") - for lockspace in re.compile(r'^dlm\s+[^\s]+\s+([^\s]+)$', re.MULTILINE).findall(output): - self.collectExtOutput("dlm_tool lockdebug '%s'" % lockspace, - suggest_filename = "dlm_locks_%s" % lockspace) + status, output, time = self.callExtProg("group_tool") + for lockspace in re.compile(r'^dlm\s+[^\s]+\s+([^\s]+)$', + re.MULTILINE).findall(output): + self.collectExtOutput("dlm_tool lockdebug '%s'" % lockspace, + suggest_filename = "dlm_locks_%s" % lockspace) else: # RHEL6 or recent Fedora - status, output, time = self.callExtProg("dlm_tool ls") - for lockspace in re.compile(r'^name\s+([^\s]+)$', re.MULTILINE).findall(output): - self.collectExtOutput("dlm_tool lockdebug -svw '%s'" % lockspace, - suggest_filename = "dlm_locks_%s" % lockspace) + status, output, time = self.callExtProg("dlm_tool ls") + for lockspace in re.compile(r'^name\s+([^\s]+)$', + re.MULTILINE).findall(output): + self.collectExtOutput("dlm_tool lockdebug -svw '%s'" + % lockspace, + suggest_filename = "dlm_locks_%s" % lockspace) def do_gfslockdump(self): - for mntpoint in self.doRegexFindAll(r'^\S+\s+([^\s]+)\s+gfs\s+.*$', "/proc/mounts"): - self.collectExtOutput("/sbin/gfs_tool lockdump %s" % mntpoint, - suggest_filename = "gfs_lockdump_" + self.mangleCommand(mntpoint)) + for mntpoint in self.doRegexFindAll(r'^\S+\s+([^\s]+)\s+gfs\s+.*$', + "/proc/mounts"): + self.collectExtOutput("/sbin/gfs_tool lockdump %s" % mntpoint, + suggest_filename = "gfs_lockdump_" + + self.mangleCommand(mntpoint)) def postproc(self): for cluster_conf in glob("/etc/cluster/cluster.conf*"): - self.doFileSub(cluster_conf, r"(\s*\<fencedevice\s*.*\s*passwd\s*=\s*)\S+(\")", r"\1%s" %('"***"')) - self.doExtOutputSub("corosync-objctl", r"(.*fence.*\.passwd=)(.*)", r"\1******") + self.doFileSub(cluster_conf, + r"(\s*\<fencedevice\s*.*\s*passwd\s*=\s*)\S+(\")", + r"\1%s" %('"***"')) + self.doExtOutputSub("corosync-objctl", + r"(.*fence.*\.passwd=)(.*)", + r"\1******") return |