diff options
author | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2009-11-19 16:58:56 +0000 |
---|---|---|
committer | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2009-11-19 16:58:56 +0000 |
commit | 3d24813b016e762d3ff6833dc32ba0e1d4baf80e (patch) | |
tree | de5f35a663ac34f3b691e7bd1330cb14d6fae37f /src | |
parent | ca82acb7c9fda8f7eaf1ba8cfbe7ab59652a009a (diff) | |
download | sos-3d24813b016e762d3ff6833dc32ba0e1d4baf80e.tar.gz |
- more plugin additions
- hopefully fixed a problem with symlinks copying unwanted data
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@662 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/sos/plugins/auditd.py | 5 | ||||
-rw-r--r-- | src/lib/sos/plugins/cluster.py | 9 | ||||
-rw-r--r-- | src/lib/sos/plugins/devicemapper.py | 3 | ||||
-rw-r--r-- | src/lib/sos/plugins/general.py | 6 | ||||
-rw-r--r-- | src/lib/sos/plugins/kernel.py | 5 | ||||
-rw-r--r-- | src/lib/sos/plugins/networking.py | 3 | ||||
-rw-r--r-- | src/lib/sos/plugins/pxe.py | 6 | ||||
-rw-r--r-- | src/lib/sos/plugins/quagga.py | 30 | ||||
-rw-r--r-- | src/lib/sos/plugins/rhn.py | 5 | ||||
-rw-r--r-- | src/lib/sos/plugins/rpm.py | 6 | ||||
-rw-r--r-- | src/lib/sos/plugins/system.py | 1 | ||||
-rw-r--r-- | src/lib/sos/plugins/yum.py | 11 | ||||
-rw-r--r-- | src/lib/sos/plugintools.py | 2 | ||||
-rw-r--r-- | src/sos.conf | 2 | ||||
-rw-r--r-- | src/sos.spec | 6 | ||||
-rwxr-xr-x | src/sosreport | 10 |
16 files changed, 83 insertions, 27 deletions
diff --git a/src/lib/sos/plugins/auditd.py b/src/lib/sos/plugins/auditd.py index bae384a3..7dd4cad8 100644 --- a/src/lib/sos/plugins/auditd.py +++ b/src/lib/sos/plugins/auditd.py @@ -17,8 +17,11 @@ import sos.plugintools class auditd(sos.plugintools.PluginBase): """Auditd related information """ + + optionList = [("syslogsize", "max size (MiB) to collect per syslog file", "", 15)] + def setup(self): self.addCopySpec("/etc/audit/auditd.conf") self.addCopySpec("/etc/audit/audit.rules") - self.addCopySpec("/var/log/audit/") + self.addCopySpecLimit("/var/log/audit*", sizelimit = self.getOption("syslogsize")) return diff --git a/src/lib/sos/plugins/cluster.py b/src/lib/sos/plugins/cluster.py index f7bea298..64860b5b 100644 --- a/src/lib/sos/plugins/cluster.py +++ b/src/lib/sos/plugins/cluster.py @@ -162,7 +162,13 @@ class cluster(sos.plugintools.PluginBase): # 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.") + for xmlNode in xpathContext.xpathEval("/cluster/rm/service//fs[not(@fsid)]"): + fsRefAttribute = xmlNode.xpathEval("@ref") + if (len(fsRefAttribute) > 0) : + fsRefName = fsRefAttribute[0].content + if len(xpathContext.xpathEval("cluster/rm/resources/fs[@name='%s'][not(@fsid)]" % fsRefName)): + self.addDiagnose("one or more nfs export do not have a fsid attribute set.") + break # cluster.conf file version and the in-memory cluster configuration version matches status, cluster_version = commands.getstatusoutput("cman_tool status | grep 'Config version'") @@ -280,3 +286,4 @@ class cluster(sos.plugintools.PluginBase): if line.split()[-1] != 'none': self.addDiagnose("Possible incorrect state: %s, for group: %s" % (line.split()[-1], line)) return + diff --git a/src/lib/sos/plugins/devicemapper.py b/src/lib/sos/plugins/devicemapper.py index c0f069d5..41017220 100644 --- a/src/lib/sos/plugins/devicemapper.py +++ b/src/lib/sos/plugins/devicemapper.py @@ -21,6 +21,7 @@ class devicemapper(sos.plugintools.PluginBase): """ optionList = [("lvmdump", 'collect raw metadata from PVs', 'slow', False)] + dmraidOptions = ['V','b','r','s','tay','rD'] def do_lvmdump(self): """Collects raw metadata directly from the PVs using dd @@ -58,5 +59,7 @@ class devicemapper(sos.plugintools.PluginBase): if disk in [ ".", ".." ] or disk.startswith("ram"): continue self.collectExtOutput("/usr/bin/udevinfo -ap /sys/block/%s" % (disk)) + for opt in self.dmraidOptions: + self.collectExtOutput("/sbin/dmraid -%s" % (opt,)) return diff --git a/src/lib/sos/plugins/general.py b/src/lib/sos/plugins/general.py index 43032a7f..7458ebea 100644 --- a/src/lib/sos/plugins/general.py +++ b/src/lib/sos/plugins/general.py @@ -34,10 +34,8 @@ class general(sos.plugintools.PluginBase): self.addCopySpec("/var/log/dmesg") # Capture second dmesg from time of sos run self.collectExtOutput("/bin/dmesg", suggest_filename="dmesg_now") - self.addCopySpec("/var/log/messages") - self.addCopySpecLimit("/var/log/messages.*", sizelimit = self.getOption("syslogsize")) - self.addCopySpec("/var/log/secure") - self.addCopySpecLimit("/var/log/secure.*", sizelimit = self.getOption("syslogsize")) + self.addCopySpecLimit("/var/log/messages*", sizelimit = self.getOption("syslogsize")) + self.addCopySpecLimit("/var/log/secure*", sizelimit = self.getOption("syslogsize")) self.addCopySpec("/var/log/sa") self.addCopySpec("/var/log/pm/suspend.log") self.addCopySpec("/var/log/up2date") diff --git a/src/lib/sos/plugins/kernel.py b/src/lib/sos/plugins/kernel.py index 14b13b20..b16cc8fb 100644 --- a/src/lib/sos/plugins/kernel.py +++ b/src/lib/sos/plugins/kernel.py @@ -40,10 +40,6 @@ class kernel(sos.plugintools.PluginBase): {'regex':'ati-', 'description':'ATI module'} ] - # HP - # - # - def setup(self): self.collectExtOutput("/bin/uname -a", root_symlink = "uname") self.moduleFile = self.collectOutputNow("/sbin/lsmod", root_symlink = "lsmod") @@ -69,6 +65,7 @@ class kernel(sos.plugintools.PluginBase): self.collectExtOutput("/usr/sbin/dkms status") self.addCopySpec("/proc/cmdline") self.addCopySpec("/proc/driver") + self.addCopySpec("/proc/zoneinfo") self.addCopySpec("/proc/sys/kernel/tainted") return diff --git a/src/lib/sos/plugins/networking.py b/src/lib/sos/plugins/networking.py index e86603ca..e3d6f98a 100644 --- a/src/lib/sos/plugins/networking.py +++ b/src/lib/sos/plugins/networking.py @@ -57,11 +57,14 @@ class networking(sos.plugintools.PluginBase): self.collectIPTable("nat") self.collectIPTable("mangle") self.collectExtOutput("/bin/netstat -s") + self.collectExtOutput("/bin/netstat -agn") self.collectExtOutput("/bin/netstat -neopa", root_symlink = "netstat") self.collectExtOutput("/sbin/ip route show table all") self.collectExtOutput("/sbin/ip link") self.collectExtOutput("/sbin/ip address") self.collectExtOutput("/sbin/ifenslave -a") + self.collectExtOutput("/sbin/ip mroute show") + self.collectExtOutput("/sbin/ip maddr show") if ifconfigFile: for eth in self.get_interface_name(ifconfigFile): self.collectExtOutput("/sbin/ethtool "+eth) diff --git a/src/lib/sos/plugins/pxe.py b/src/lib/sos/plugins/pxe.py index 59e91e0e..81e581c6 100644 --- a/src/lib/sos/plugins/pxe.py +++ b/src/lib/sos/plugins/pxe.py @@ -18,6 +18,9 @@ import os class pxe(sos.plugintools.PluginBase): """PXE related information """ + + optionList = [("tftpboot", 'gathers content in /tftpboot', 'slow', False)] + def checkenabled(self): if self.cInfo["policy"].pkgByName("system-config-netboot-cmd") or os.path.exists("/usr/sbin/pxeos"): return True @@ -25,6 +28,7 @@ class pxe(sos.plugintools.PluginBase): def setup(self): self.collectExtOutput("/usr/sbin/pxeos -l") - self.addCopySpec("/tftpboot") self.addCopySpec("/etc/dhcpd.conf") + if self.getOption("tftpboot"): + self.addCopySpec("/tftpboot") return diff --git a/src/lib/sos/plugins/quagga.py b/src/lib/sos/plugins/quagga.py new file mode 100644 index 00000000..8e51497a --- /dev/null +++ b/src/lib/sos/plugins/quagga.py @@ -0,0 +1,30 @@ +## Copyright (C) 2007 Ranjith Rajaram <rrajaram@redhat.com> + +### 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 +from os.path import exists + +class quagga(sos.plugintools.PluginBase): + """quagga related information + """ + def checkenabled(self): + if self.cInfo["policy"].pkgByName("quagga") or exists("/etc/quagga/zebra.conf"): + return True + return False + + def setup(self): + self.addCopySpec("/etc/quagga/") + return diff --git a/src/lib/sos/plugins/rhn.py b/src/lib/sos/plugins/rhn.py index effd4c94..efad65bd 100644 --- a/src/lib/sos/plugins/rhn.py +++ b/src/lib/sos/plugins/rhn.py @@ -37,11 +37,6 @@ class rhn(sos.plugintools.PluginBase): return False def setup(self): - # made from: - # http://svn.rhndev.redhat.com/viewcvs/branches/eng/RELEASE-5.0.5-dev/backend/satellite_tools/satellite-debug?rev=114478&view=markup - # http://cvs.devel.redhat.com/cgi-bin/cvsweb.cgi/rhn/proxy/proxy/tools/rhn-proxy-debug?rev=1.3;content-type=text%2Fplain;cvsroot=RHN - # FIXME: symlinks and directories for copySpec (same as root_symlink for commands) - self.addCopySpec("/etc/httpd/conf*") self.addCopySpec("/etc/rhn") self.addCopySpec("/etc/sysconfig/rhn") diff --git a/src/lib/sos/plugins/rpm.py b/src/lib/sos/plugins/rpm.py index 4fbf7428..361a7db7 100644 --- a/src/lib/sos/plugins/rpm.py +++ b/src/lib/sos/plugins/rpm.py @@ -24,10 +24,10 @@ class rpm(sos.plugintools.PluginBase): self.addCopySpec("/var/log/rpmpkgs") if self.getOption("rpmq"): - 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") + 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) - self.collectExtOutput("/bin/rpm -Va", root_symlink = "rpm-Va", timeout = 3600) + self.eta_weight += 1500 # this plugins takes 200x longer (for ETA) + self.collectExtOutput("/bin/rpm -Va", root_symlink = "rpm-Va", timeout = 3600) return diff --git a/src/lib/sos/plugins/system.py b/src/lib/sos/plugins/system.py index 74f6804a..8a19fcd1 100644 --- a/src/lib/sos/plugins/system.py +++ b/src/lib/sos/plugins/system.py @@ -21,6 +21,7 @@ class system(sos.plugintools.PluginBase): self.addCopySpec("/proc/sys") self.addCopySpec("/etc/sysctl.conf") self.addCopySpec("/etc/cron*") + self.addCopySpec("/var/spool/cron*") self.addCopySpec("/var/log/cron*") self.addCopySpec("/etc/syslog.conf") self.addCopySpec("/etc/ntp.conf") diff --git a/src/lib/sos/plugins/yum.py b/src/lib/sos/plugins/yum.py index 60665dd6..25bbc7b9 100644 --- a/src/lib/sos/plugins/yum.py +++ b/src/lib/sos/plugins/yum.py @@ -14,12 +14,14 @@ import sos.plugintools import os +import commands class yum(sos.plugintools.PluginBase): """yum information """ optionList = [("yumlist", "list repositories and packages", "slow", False)] + optionList = [("yumdebug", "gather yum debugging data", "slow", False)] def checkenabled(self): self.files = [ "/etc/yum.conf" ] @@ -47,5 +49,12 @@ class yum(sos.plugintools.PluginBase): self.collectExtOutput("/bin/echo \"repo list\" | /usr/bin/yum shell") # List various information about available packages self.collectExtOutput("/usr/bin/yum list") - + + if self.getOption("yumdebug") and self.isInstalled('yum-utils'): + for output in commands.getoutput("/usr/bin/yum-debug-dump").split("\n"): + if "Output written to:" in output: + try: + self.collectExtOutput("/bin/zcat %s" % (output.split()[-1:][0],)) + except IndexError: + pass return diff --git a/src/lib/sos/plugintools.py b/src/lib/sos/plugintools.py index 9121db69..50c79f0f 100644 --- a/src/lib/sos/plugintools.py +++ b/src/lib/sos/plugintools.py @@ -145,7 +145,7 @@ class PluginBase: if os.path.isdir(srcpath): return - link = os.readlink(srcpath) + link = os.path.abspath(os.readlink(srcpath)) # What's the name of the symlink on the dest tree? dstslname = os.path.join(self.cInfo['dstroot'], srcpath.lstrip(os.path.sep)) diff --git a/src/sos.conf b/src/sos.conf index d9d70d20..a19b1e56 100644 --- a/src/sos.conf +++ b/src/sos.conf @@ -7,7 +7,7 @@ smtp_server = None [plugins] -#disable = plugin1, plugin2, plugin3 +#disable = rpm, selinux, dovecot [tunables] diff --git a/src/sos.spec b/src/sos.spec index 03039017..86c171f8 100644 --- a/src/sos.spec +++ b/src/sos.spec @@ -3,7 +3,7 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 1.8 -Release: 18%{?dist} +Release: 19%{?dist} Group: Applications/System Source0: https://fedorahosted.org/releases/s/o/sos/%{name}-%{version}.tar.gz License: GPLv2+ @@ -53,9 +53,11 @@ rm -rf ${RPM_BUILD_ROOT} %config %{_sysconfdir}/sos.conf %changelog -* Tue Oct 20 2009 Adam Stokes <ajs at redhat dot com> = 1.8-18 +* Tue Nov 5 2009 Adam Stokes <ajs at redhat dot com> = 1.8-18 - Option to enable selinux fixfiles check - Start of replacing Thread module with multiprocessing +- Update translations +- More checks against conf file versus command line opts * Tue Sep 9 2009 Adam Stokes <ajs at redhat dot com> = 1.8-16 - Update rh-upload-core to rh-upload and allows general files diff --git a/src/sosreport b/src/sosreport index f84c2f2a..86286ae3 100755 --- a/src/sosreport +++ b/src/sosreport @@ -39,6 +39,10 @@ import gettext from multiprocessing import Semaphore __version__ = 1.8 +if os.path.isfile('/etc/fedora-release'): + __distro__ = 'Fedora' +else: + __distro__ = 'Red Hat Enterprise Linux' ## Set up routines to be linked to signals for termination handling def exittermhandler(signum, frame): @@ -640,16 +644,16 @@ def sosreport(): doExit(1) msg = _("""This utility will collect some detailed information about the -hardware and setup of your Fedora system. +hardware and setup of your %s system. The information is collected and an archive is packaged under /tmp, which you can send to a support representative. -Fedora will use this information for diagnostic purposes ONLY +%s will use this information for diagnostic purposes ONLY and it will be considered confidential information. This process may take a while to complete. No changes will be made to your system. -""") +""" % (__distro__, __distro__)) if __cmdLineOpts__.batch: print msg else: |