From c24bf71240249f9b3625b339e1ff650e9e2454b0 Mon Sep 17 00:00:00 2001 From: astokes Date: Thu, 23 Oct 2008 14:00:56 +0000 Subject: - Resolves: bz459845 collect krb5.conf - Resolves: bz457880 include output of xm list and xm list --long - Resolves: bz457919 add support for openswan and ipsec-tools - Resolves: bz456378 capture elilo configuration - Resolves: bz445007 s390 support - Resolves: bz371251 hangs when running with a xen kernel where xend has not been started - Resolves: bz452705 Add /root/anaconda-ks-cfg to sosreport archive - Resolves: bz445510 Do not rely on env to execute python - Resolves: bz446868 add support for emc devices - Resolves: bz453797 fails to generate fdisk -l - Resolves: bz433183 does not collect ext3 information - Resolves: bz444838 systool is passed deprecated arguments - Resolves: bz455096 add %{INSTALLTIME:date} to rpm --qf collection - Resolves: bz332211 avoid hazardous filenames git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@533 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/Makefile | 2 +- src/README | 4 +- src/lib/sos/plugins/autofs.py | 36 ++++- src/lib/sos/plugins/bootloader.py | 2 +- src/lib/sos/plugins/cluster.py~ | 287 ++++++++++++++++++++++++++++++++++++ src/lib/sos/plugins/devicemapper.py | 9 +- src/lib/sos/plugins/filesys.py | 7 +- src/lib/sos/plugins/general.py | 3 +- src/lib/sos/plugins/ipsec.py | 30 ++++ src/lib/sos/plugins/named.py | 19 ++- src/lib/sos/plugins/openswan.py | 32 ++++ src/lib/sos/plugins/rpm.py | 2 +- src/lib/sos/plugins/s390.py | 17 ++- src/lib/sos/plugins/samba.py | 1 + src/lib/sos/plugins/xen.py | 19 ++- src/sos.spec | 18 ++- src/sosreport | 2 +- 17 files changed, 465 insertions(+), 25 deletions(-) create mode 100644 src/lib/sos/plugins/cluster.py~ create mode 100644 src/lib/sos/plugins/ipsec.py create mode 100644 src/lib/sos/plugins/openswan.py diff --git a/src/Makefile b/src/Makefile index 37c384bc..0338b41f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,7 +5,7 @@ NAME = sos VERSION = $(shell awk '/^%define version / { print $$3 }' sos.spec) RELEASE = $(shell awk '/^%define release / { print $$3 }' sos.spec) -REPO = svn+ssh://svn.fedoraproject.org/svn/hosted/sos +REPO = svn+ssh://svn.fedorahosted.org/svn/sos SVNTAG = r$(subst .,-,$(VERSION))_$(RELEASE) SRCDIR = $(PWD) TOPDIR = $(PWD)/build/rpm-$(NAME)-$(VERSION) diff --git a/src/README b/src/README index 74fcb2b2..ff3bf6bf 100644 --- a/src/README +++ b/src/README @@ -4,12 +4,12 @@ package maintainers, and anyone else to provide plugins that will collect, analyze, and report information that is useful for supporting software packages. -This project is hosted at http://hosted.fedoraproject.org/projects/sos +This project is hosted at http://fedorahosted.org/sos For the latest version, to contribute, and for more information, please visit there. To access to the public source code repository for this project run: - svn export http://svn.fedoraproject.org/svn/hosted/sos/trunk sos --username guest + svn export http://svn.fedorahosted.org/svn/sos/trunk sos --username guest to install locally (as root) ==> make install to build an rpm ==> make rpm diff --git a/src/lib/sos/plugins/autofs.py b/src/lib/sos/plugins/autofs.py index 16a8d3fb..48dd57b4 100644 --- a/src/lib/sos/plugins/autofs.py +++ b/src/lib/sos/plugins/autofs.py @@ -15,7 +15,7 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import sos.plugintools -import os +import os, re class autofs(sos.plugintools.PluginBase): """autofs server-related information @@ -24,8 +24,38 @@ class autofs(sos.plugintools.PluginBase): if self.cInfo["policy"].runlevelDefault() in self.cInfo["policy"].runlevelByService("autofs"): return True return False - + + def checkdebug(self): + """ testing if autofs debug has been enabled anywhere + """ + # Global debugging + optlist=[] + opt = self.fileGrep(r"^(DEFAULT_LOGGING|DAEMONOPTIONS)=(.*)", "/etc/sysconfig/autofs") + for opt1 in opt: + for opt2 in opt1.split(" "): + optlist.append(opt2) + for dtest in optlist: + if dtest == "--debug" or dtest == "debug": + return True + + def getdaemondebug(self): + """ capture daemon debug output + """ + debugout = self.fileGrep(r"^(daemon.*)\s+(\/var\/log\/.*)", "/etc/sysconfig/autofs") + for i in debugout: + return i[1] + def setup(self): self.addCopySpec("/etc/auto*") self.addCopySpec("/etc/sysconfig/autofs") - self.addCopySpec("/etc/rc.d/init.d/autofs") + self.addCopySpec("/etc/init.d/autofs") + self.collectExtOutput("/bin/rpm -qV autofs") + self.collectExtOutput("/etc/init.d/autofs status") + self.collectExtOutput("ps auxwww | grep automount") + self.collectExtOutput("/bin/egrep -e 'automount|pid.*nfs' /proc/mounts") + self.collectExtOutput("/bin/mount | egrep -e 'automount|pid.*nfs'") + self.collectExtOutput("/sbin/chkconfig --list autofs") + if self.checkdebug(): + self.addCopySpec(self.getdaemondebug()) + return + diff --git a/src/lib/sos/plugins/bootloader.py b/src/lib/sos/plugins/bootloader.py index 195d220b..b919ce4d 100644 --- a/src/lib/sos/plugins/bootloader.py +++ b/src/lib/sos/plugins/bootloader.py @@ -21,9 +21,9 @@ class bootloader(sos.plugintools.PluginBase): self.addCopySpec("/etc/lilo.conf") self.addCopySpec("/etc/milo.conf") self.addCopySpec("/etc/silo.conf") + self.addCopySpec("/boot/efi/*") self.addCopySpec("/boot/grub/grub.conf") self.addCopySpec("/boot/grub/device.map") - self.addCopySpec("/boot/efi/elilo.conf") self.addCopySpec("/boot/yaboot.conf") self.collectExtOutput("/sbin/lilo -q") diff --git a/src/lib/sos/plugins/cluster.py~ b/src/lib/sos/plugins/cluster.py~ new file mode 100644 index 00000000..ff2a233c --- /dev/null +++ b/src/lib/sos/plugins/cluster.py~ @@ -0,0 +1,287 @@ +### 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +import sos.plugintools +import commands, os, re +import time, libxml2 + +class cluster(sos.plugintools.PluginBase): + """cluster suite and GFS related information + """ + + optionList = [("gfslockdump", 'gather output of gfs lockdumps', 'slow', False), + ('lockdump', 'gather dlm lockdumps', 'slow', False), + ('taskdump', 'trigger 3 sysrq+t dumps every 5 seconds (dangerous)', 'slow', False)] + + def checkenabled(self): + rhelver = self.cInfo["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" ] + elif rhelver == 5: + self.packages = [ "rgmanager", "luci", "ricci", "system-config-cluster", + "gfs-utils", "gnbd", "kmod-gfs", "kmod-gnbd", "lvm2-cluster" ] + + self.files = [ "/etc/cluster/cluster.conf", "/proc/cluster" ] + return sos.plugintools.PluginBase.checkenabled(self) + + def has_gfs(self): + try: + if len(self.doRegexFindAll(r'^\S+\s+\S+\s+gfs\s+.*$', "/etc/mtab")): + return True + except: + return False + + def diagnose(self): + rhelver = self.cInfo["policy"].rhelVersion() + + # 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) + + pkgs_check = [] + mods_check = [] + serv_check = [] + + if rhelver == 4: + pkgs_check.extend( [ "ccs", "cman", "magma", "magma-plugins", "perl-Net-Telnet", "rgmanager", "fence" ] ) + mods_check.extend( [ "cman", "dlm" ] ) + if self.has_gfs(): + mods_check.append("gfs") + serv_check.extend( [ "cman", "ccsd", "rgmanager", "fenced" ] ) + if self.has_gfs(): + serv_check.extend( ["gfs", "clvmd"] ) + elif rhelver == 5: + pkgs_check.extend ( [ "cman", "perl-Net-Telnet", "rgmanager" ] ) + mods_check.extend( [ "dlm" ] ) + if self.has_gfs(): + mods_check.extend( ["gfs", "gfs2"] ) + serv_check.extend( [ "cman", "rgmanager" ] ) + if self.has_gfs(): + serv_check.extend( ["gfs", "clvmd"] ) + + # check that kernel module packages are installed for + # running kernel version + + for modname in mods_check: + found = 0 + + if self.cInfo["policy"].allPkgsByNameRegex( "^" + modname ): + found = 1 + + status, output = commands.getstatusoutput('/sbin/modinfo -F vermagic ' + modname) + + if status == 0: + found = 2 + + if len(self.fileGrep("^%s\s+" % modname, "/proc/modules")) > 0: + found = 3 + + if found == 0: + self.addDiagnose("required kernel module is missing: %s" % modname) + elif found == 1: + self.addDiagnose("required module is not available for current kernel: %s" % modname) + elif found == 2: + self.addDiagnose("required module is available but not loaded: %s" % module) + + for pkg in pkgs_check: + if self.cInfo["policy"].pkgByName(pkg) == None: + self.addDiagnose("required package is missing: %s" % pkg) + + if rhelver == "4": + # (dlm, dlm-kernel) || gulm + if not ((self.cInfo["policy"].pkgByName("dlm") and self.cInfo["policy"].pkgByName("dlm-kernel")) or self.cInfo["policy"].pkgByName("gulm")): + self.addDiagnose("required packages are missing: (dlm, dlm-kernel) || gulm") + + # 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 serv_check: + status, output = commands.getstatusoutput("/sbin/service %s status &> /dev/null" % service) + if status != 0: + 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: missing important cman services + # FIXME: any cman service whose state != run ? + # Fence Domain: "default" 2 2 run - + + # is cluster quorate + if not self.is_cluster_quorate(): + self.addDiagnose("cluster node is not quorate") + + # if there is no cluster.conf, diagnose() finishes here. + try: + os.stat("/etc/cluster/cluster.conf") + except: + self.addDiagnose("/etc/cluster/cluster.conf is missing") + return + + # setup XML xpath context + xml = libxml2.parseFile("/etc/cluster/cluster.conf") + xpathContext = xml.xpathNewContext() + + # make sure that the node names are valid according to RFC 2181 + for hostname in xpathContext.xpathEval('/cluster/clusternodes/clusternode/@name'): + if not re.match('^[a-zA-Z]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z]([a-zA-Z0-9-]*[a-zA-Z0-9])?)*$', hostname.content): + self.addDiagnose("node name (%s) contains invalid characters" % hostname.content) + + # do not rely on DNS to resolve node names, must have them in /etc/hosts + for hostname in xpathContext.xpathEval('/cluster/clusternodes/clusternode/@name'): + if len(self.fileGrep(r'^.*\W+%s' % hostname.content , "/etc/hosts")) == 0: + self.addDiagnose("node %s is not defined in /etc/hosts" % hostname.content) + + # check fencing (warn on no fencing) + if len(xpathContext.xpathEval("/cluster/clusternodes/clusternode[not(fence/method/device)]")): + if self.has_gfs(): + self.addDiagnose("one or more nodes have no fencing agent configured: fencing is required for GFS to work") + else: + self.addDiagnose("one or more nodes have no fencing agent configured: the cluster infrastructure might not work as intended") + + # check fencing (warn on manual) + if len(xpathContext.xpathEval("/cluster/clusternodes/clusternode[/cluster/fencedevices/fencedevice[@agent='fence_manual']/@name=fence/method/device/@name]")): + self.addDiagnose("one or more nodes have manual fencing agent configured (data integrity is not guaranteed)") + + # if fence_ilo or fence_drac, make sure acpid is not running + hostname = commands.getoutput("/bin/uname -n").split(".")[0] + if len(xpathContext.xpathEval('/cluster/clusternodes/clusternode[@name = "%s" and /cluster/fencedevices/fencedevice[@agent="fence_rsa" or @agent="fence_drac"]/@name=fence/method/device/@name]' % hostname )): + status, output = commands.getstatusoutput("/sbin/service acpid status") + if status == 0 or self.cInfo["policy"].runlevelDefault() in self.cInfo["policy"].runlevelByService("acpid"): + self.addDiagnose("acpid is enabled, this may cause problems with your fencing method.") + + # check for fs exported via nfs without nfsid attribute + if len(xpathContext.xpathEval("/cluster/rm/service//fs[not(@fsid)]/nfsexport")): + self.addDiagnose("one or more nfs export do not have a fsid attribute set.") + + # cluster.conf file version and the in-memory cluster configuration version matches + status, cluster_version = commands.getstatusoutput("cman_tool status | grep 'Config version'") + if not status: cluster_version = cluster_version[16:] + else: cluster_version = None + conf_version = xpathContext.xpathEval("/cluster/@config_version")[0].content + + if status == 0 and conf_version != cluster_version: + self.addDiagnose("cluster.conf and in-memory configuration version differ (%s != %s)" % (conf_version, cluster_version) ) + + status, output = commands.getstatusoutput("/usr/sbin/rg_test test /etc/cluster/cluster.conf") + if output.find("Error: ") > 0: + self.addDiagnose("configuration errors are present according to rg_test") + + # make sure the first part of the lock table matches the cluster name + # and that the locking protocol is sane + cluster_name = xpathContext.xpathEval("/cluster/@name")[0].content + + for fs in self.fileGrep(r'^[^#][/\w]*\W*[/\w]*\W*gfs', "/etc/fstab"): + # for each gfs entry + fs = fs.split() + lockproto = self.get_gfs_sb_field(fs[0], "sb_lockproto") + if lockproto and lockproto != self.get_locking_proto(): + self.addDiagnose("gfs mountpoint (%s) is using the wrong locking protocol (%s)" % (fs[0], lockproto) ) + + locktable = self.get_gfs_sb_field(fs[0], "sb_locktable") + try: locktable = locktable.split(":")[0] + except: continue + if locktable != cluster_name: + self.addDiagnose("gfs mountpoint (%s) is using the wrong locking table" % fs[0]) + + def setup(self): + self.collectExtOutput("/sbin/fdisk -l") + self.addCopySpec("/etc/cluster.conf") + self.addCopySpec("/etc/cluster.xml") + self.addCopySpec("/etc/cluster") + self.collectExtOutput("/usr/sbin/rg_test test /etc/cluster/cluster.conf") + self.addCopySpec("/proc/cluster") + self.collectExtOutput("cman_tool status") + self.collectExtOutput("cman_tool services") + self.collectExtOutput("cman_tool -af nodes") + self.collectExtOutput("ccs_tool lsnode") + self.collectExtOutput("openais-cfgtool -s") + self.collectExtOutput("clustat") + + self.collectExtOutput("/sbin/ipvsadm -L") + + if self.getOption('gfslockdump'): self.do_gfslockdump() + if self.getOption('lockdump'): self.do_lockdump() + if self.getOption('taskdump'): self.do_taskdump() + + return + + def do_taskdump(self): + if not os.access("/proc/sysrq-trigger", os.W_OK): + return + + commands.getstatusoutput("echo t > /proc/sysrq-trigger") + time.sleep(5) + commands.getstatusoutput("echo t > /proc/sysrq-trigger") + time.sleep(5) + commands.getstatusoutput("echo t > /proc/sysrq-trigger") + + self.addCopySpec("/var/log/messages") + + def do_lockdump(self): + status, output = commands.getstatusoutput("cman_tool services") + if status: + # command somehow failed + return False + + import re + + rhelver = self.get_redhat_release() + + if rhelver == "4": + regex = r'^DLM Lock Space:\s*"([^"]*)".*$' + elif rhelver == "5Server" or rhelver == "5Client": + regex = r'^dlm\s+[^\s]+\s+([^\s]+)\s.*$' + + reg=re.compile(regex,re.MULTILINE) + for lockspace in reg.findall(output): + commands.getstatusoutput("echo %s > /proc/cluster/dlm_locks" % lockspace) + self.collectOutputNow("cat /proc/cluster/dlm_locks", root_symlink = "dlm_locks_%s" % lockspace) + + def get_locking_proto(self): + # FIXME: what's the best way to find out ? + return "lock_dlm" + return "lock_gulm" + + 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, root_symlink = "gfs_lockdump_" + self.mangleCommand(mntpoint) ) + + def do_rgmanager_bt(self): + # FIXME: threads backtrace via SIGALRM + return + + def postproc(self): + self.doRegexSub("/etc/cluster/cluster.conf", r"(\s*\ + +### 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +import sos.plugintools +import os + +class ipsec(sos.plugintools.PluginBase): + """ipsec related information + """ + def checkenabled(self): + if self.cInfo["policy"].pkgByName("ipsec-tools") or os.path.exists("/etc/racoon/racoon.conf"): + return True + return False + + def setup(self): + self.addCopySpec("/etc/racoon") + return diff --git a/src/lib/sos/plugins/named.py b/src/lib/sos/plugins/named.py index bb0d079e..78bf4ee6 100644 --- a/src/lib/sos/plugins/named.py +++ b/src/lib/sos/plugins/named.py @@ -25,9 +25,16 @@ class named(sos.plugintools.PluginBase): return sos.plugintools.PluginBase.checkenabled(self) def setup(self): - self.addCopySpec("/etc/named.boot") - self.addCopySpec("/etc/named.conf") - self.addCopySpec("/etc/sysconfig/named") - self.addCopySpec("/var/named") - self.addForbiddenPath('/var/named/chroot/proc') - self.addForbiddenPath('/var/named/chroot/dev') + dnsdir = "" + self.addCopySpec("/etc/named.boot") + self.addCopySpec("/etc/named.conf") + self.addCopySpec("/etc/sysconfig/named") + if os.access("/etc/named.conf", os.R_OK): + dnsdir = commands.getoutput("/bin/grep -i directory /etc/named.conf | /bin/gawk '{print $2}' | /bin/sed 's/\\\"//g' | /bin/sed 's/\;//g'") + if os.access("/etc/named.boot", os.R_OK): + dnsdir = commands.getoutput("/bin/grep -i directory /etc/named.boot | /bin/gawk '{print $2}' | /bin/sed 's/\\\"//g' | /bin/sed 's/\;//g'") + if '' != dnsdir.strip(): + self.addCopySpec(dnsdir) + self.addForbiddenPath('/var/named/chroot/proc') + self.addForbiddenPath('/var/named/chroot/dev') + return diff --git a/src/lib/sos/plugins/openswan.py b/src/lib/sos/plugins/openswan.py new file mode 100644 index 00000000..4a9f8ff7 --- /dev/null +++ b/src/lib/sos/plugins/openswan.py @@ -0,0 +1,32 @@ +## Copyright (C) 2007 Sadique Puthen + +### 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +import sos.plugintools +import os + +class openswan(sos.plugintools.PluginBase): + """ipsec related information + """ + def checkenabled(self): + if self.cInfo["policy"].pkgByName("openswan") or os.path.exists("/etc/ipsec.conf"): + return True + return False + + def setup(self): + self.addCopySpec("/etc/ipsec.conf") + self.addCopySpec("/etc/ipsec.d") + self.collectExtOutput("/usr/sbin/ipsec verify") + self.collectExtOutput("/usr/sbin/ipsec barf") diff --git a/src/lib/sos/plugins/rpm.py b/src/lib/sos/plugins/rpm.py index f1c09e33..f56383c5 100644 --- a/src/lib/sos/plugins/rpm.py +++ b/src/lib/sos/plugins/rpm.py @@ -24,7 +24,7 @@ class rpm(sos.plugintools.PluginBase): self.addCopySpec("/var/log/rpmpkgs") if self.getOption("rpmq"): - self.collectExtOutput("/bin/rpm -qa --qf \"%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}\n\"", root_symlink = "installed-rpms") + self.collectExtOutput("/bin/rpm -qa --qf=\"%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}~~%{INSTALLTIME:date}\n\"|/bin/awk -F ~~ '{printf \"%-60s%s\\n\",$1,$2}'", root_symlink = "installed-rpms") if self.getOption("rpmva"): self.eta_weight += 1500 # this plugins takes 200x longer (for ETA) diff --git a/src/lib/sos/plugins/s390.py b/src/lib/sos/plugins/s390.py index e9bfbb6f..6fe2d179 100644 --- a/src/lib/sos/plugins/s390.py +++ b/src/lib/sos/plugins/s390.py @@ -38,8 +38,10 @@ class s390(sos.plugintools.PluginBase): self.addCopySpec("/proc/crypto") self.addCopySpec("/proc/dasd/devices") self.addCopySpec("/proc/dasd/statistics") + self.addCopySpec("/proc/misc") self.addCopySpec("/proc/qeth") self.addCopySpec("/proc/qeth_perf") + self.addCopySpec("/proc/qeth_ipa_takeover") self.addCopySpec("/proc/sys/appldata/*") self.addCopySpec("/proc/sys/kernel/hz_timer") self.addCopySpec("/proc/sysinfo") @@ -51,13 +53,24 @@ class s390(sos.plugintools.PluginBase): self.addCopySpec("/etc/zfcp.conf") self.addCopySpec("/etc/sysconfig/dumpconf") self.addCopySpec("/etc/src_vipa.conf") + self.addCopySpec("/etc/ccwgroup.conf") + self.addCopySpec("/etc/chandev.conf") self.collectExtOutput("/sbin/lscss") self.collectExtOutput("/sbin/lsdasd") self.collectExtOutput("/sbin/lsqeth") self.collectExtOutput("/sbin/lszfcp") self.collectExtOutput("/sbin/lstape") + self.collectExtOutput("find /sys -type f") + self.collectExtOutput("find /proc/s390dbf -type f") self.collectExtOutput("/sbin/qethconf list_all") dasdDev = commands.getoutput("ls /dev/dasd?") for x in dasdDev.split('\n'): - self.collectExtOutput("/sbin/dasdview -x -i -j -l %s" % (x,)) - self.collectExtOutput("/sbin/fdasd -p %s" % (x,)) \ No newline at end of file + self.collectExtOutput("/sbin/dasdview -x -i -j -l -f %s" % (x,)) + self.collectExtOutput("/sbin/fdasd -p %s" % (x,)) + try: + rhelver = self.cInfo["policy"].pkgByName("redhat-release")[1] + except: + rhelver = None + if rhelver.startswith("5"): + self.collectExtOutput("/sbin/lsqeth") + self.collectExtOutput("/sbin/lszfcp") diff --git a/src/lib/sos/plugins/samba.py b/src/lib/sos/plugins/samba.py index 41bbad86..9700790a 100644 --- a/src/lib/sos/plugins/samba.py +++ b/src/lib/sos/plugins/samba.py @@ -20,6 +20,7 @@ class samba(sos.plugintools.PluginBase): def setup(self): self.addCopySpec("/etc/samba") self.addCopySpec("/var/log/samba/*") + self.addCopySpec("/etc/krb5.conf") self.collectExtOutput("/usr/bin/wbinfo -g") self.collectExtOutput("/usr/bin/wbinfo -u") self.collectExtOutput("/usr/bin/testparm -s -v") diff --git a/src/lib/sos/plugins/xen.py b/src/lib/sos/plugins/xen.py index d6daec63..0760269c 100644 --- a/src/lib/sos/plugins/xen.py +++ b/src/lib/sos/plugins/xen.py @@ -38,6 +38,11 @@ class xen(sos.plugintools.PluginBase): return False return True + def is_running_xenstored(self): + xs_pid = os.popen("pidof xenstored").read() + xs_pidnum = re.split('\n$',xs_pid)[0] + return xs_pidnum.isdigit() + def domCollectProc(self): self.addCopySpec("/proc/xen/balloon") self.addCopySpec("/proc/xen/capabilities") @@ -66,9 +71,21 @@ class xen(sos.plugintools.PluginBase): self.collectExtOutput("/usr/bin/xenstore-ls") self.collectExtOutput("/usr/sbin/xm dmesg") self.collectExtOutput("/usr/sbin/xm info") + self.collectExtOutput("/usr/sbin/xm list") + self.collectExtOutput("/usr/sbin/xm list --long") self.collectExtOutput("/usr/sbin/brctl show") self.domCollectProc() - self.addCopySpec("/sys/hypervisor") + self.addCopySpec("/sys/hypervisor/version") + self.addCopySpec("/sys/hypervisor/compilation") + self.addCopySpec("/sys/hypervisor/properties") + self.addCopySpec("/sys/hypervisor/type") + if is_xenstored_running(): + self.addCopySpec("/sys/hypervisor/uuid") + self.collectExtOutput("/usr/bin/xenstore-ls") + else: + # we need tdb instead of xenstore-ls if cannot get it. + self.addCopySpec("/var/lib/xenstored/tdb") + # FIXME: we *might* want to collect things in /sys/bus/xen*, # /sys/class/xen*, /sys/devices/xen*, /sys/modules/blk*, # /sys/modules/net*, but I've never heard of them actually being diff --git a/src/sos.spec b/src/sos.spec index c579ec1e..540f7329 100644 --- a/src/sos.spec +++ b/src/sos.spec @@ -2,7 +2,7 @@ %define name sos %define version 1.8 -%define release 0 +%define release 1 %define _localedir %_datadir/locale @@ -62,6 +62,22 @@ rm -rf ${RPM_BUILD_ROOT} %config /etc/sos.conf %changelog +* Thu Oct 23 2008 Adam Stokes - 1.8-1 +- Resolves: bz459845 collect krb5.conf +- Resolves: bz457880 include output of xm list and xm list --long +- Resolves: bz457919 add support for openswan and ipsec-tools +- Resolves: bz456378 capture elilo configuration +- Resolves: bz445007 s390 support +- Resolves: bz371251 hangs when running with a xen kernel where xend has not been started +- Resolves: bz452705 Add /root/anaconda-ks-cfg to sosreport archive +- Resolves: bz445510 Do not rely on env to execute python +- Resolves: bz446868 add support for emc devices +- Resolves: bz453797 fails to generate fdisk -l +- Resolves: bz433183 does not collect ext3 information +- Resolves: bz444838 systool is passed deprecated arguments +- Resolves: bz455096 add %{INSTALLTIME:date} to rpm --qf collection +- Resolves: bz332211 avoid hazardous filenames + * Wed Nov 21 2007 Navid Sheikhol-Eslami - 1.8-0 - Resolves: bz368261 sosGetCommandOutput() does not block on hung processes - Resolves: bz361861 work-around missing traceback.format_exc() in RHEL4 diff --git a/src/sosreport b/src/sosreport index 37a88a47..5b56617b 100755 --- a/src/sosreport +++ b/src/sosreport @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python """ Gather information about a system and report it using plugins supplied for application-specific information -- cgit