From 1528a2010cb81a11f255cdb7865855ae4741e8e8 Mon Sep 17 00:00:00 2001 From: shnavid Date: Wed, 18 Jul 2007 09:51:14 +0000 Subject: * initial diagnose() support for cluster plugin git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@218 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/lib/sos/plugins/cluster.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/sos/plugins/cluster.py b/src/lib/sos/plugins/cluster.py index 1cead720..5ace5620 100644 --- a/src/lib/sos/plugins/cluster.py +++ b/src/lib/sos/plugins/cluster.py @@ -13,10 +13,34 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import sos.plugintools +import commands class cluster(sos.plugintools.PluginBase): - """cluster related information + """cluster suite and GFS related information """ + def diagnose(self): + rhelver = self.cInfo["policy"].pkgDictByName("fedora-release")[0] + if rhelver == "6": + # check if the minimum set of packages is installed + # for RHEL4 RHCS(ccs, cman, cman-kernel, magma, magma-plugins, (dlm, dlm-kernel) || gulm, perl-Net-Telnet, rgmanager, fence) + # RHEL4 GFS (GFS, GFS-kernel, ccs, lvm2-cluster, fence) + for pkg in [ "ccs", "cman", "cman-kernel", "magma", "magma-plugins", "perl-Net-Telnet", "rgmanager", "fence" ]: + if self.cInfo["policy"].pkgByName(pkg) == None: + self.addDiagnose("required package is missing: %s" % pkg) + + # check if all the needed daemons are active at sosreport time + # check if they are started at boot time in RHEL4 RHCS (cman, ccsd, rgmanager, fenced) + # and GFS (gfs, ccsd, clvmd, fenced) + for service in [ "cman", "ccsd", "rgmanager", "fence" ]: + if commands.getstatus("/sbin/service %s status" % service): + self.addDiagnose("service %s is not running" % service) + + if not self.cInfo["policy"].runlevelDefault() in self.cInfo["policy"].runlevelByService(service): + self.addDiagnose("service %s is not started in default runlevel" % service) + + # FIXME: what locking are we using ? check if packages exist +# if self.cInfo["policy"].pkgByName(pkg) and self.cInfo["policy"].pkgByName(pkg) and not self.cInfo["policy"].pkgByName(pkg) + def setup(self): self.collectExtOutput("/sbin/fdisk -l") self.addCopySpec("/etc/cluster.conf") -- cgit