diff options
-rw-r--r-- | src/lib/sos/plugins/anaconda.py | 11 | ||||
-rw-r--r-- | src/lib/sos/plugins/cs.py | 49 | ||||
-rw-r--r-- | src/lib/sos/plugins/ds.py | 43 | ||||
-rw-r--r-- | src/lib/sos/plugins/general.py | 3 | ||||
-rw-r--r-- | src/lib/sos/plugins/hardware.py | 2 | ||||
-rw-r--r-- | src/lib/sos/plugins/ipa.py | 35 | ||||
-rw-r--r-- | src/lib/sos/plugins/networking.py | 1 | ||||
-rw-r--r-- | src/lib/sos/plugins/samba.py | 1 | ||||
-rw-r--r-- | src/lib/sos/plugins/sar.py | 37 | ||||
-rw-r--r-- | src/lib/sos/plugins/smartcard.py | 36 | ||||
-rw-r--r-- | src/lib/sos/plugins/xen.py | 1 | ||||
-rw-r--r-- | src/sos.conf | 3 | ||||
-rw-r--r-- | src/sos.spec | 6 |
13 files changed, 218 insertions, 10 deletions
diff --git a/src/lib/sos/plugins/anaconda.py b/src/lib/sos/plugins/anaconda.py index 26c54997..06434c70 100644 --- a/src/lib/sos/plugins/anaconda.py +++ b/src/lib/sos/plugins/anaconda.py @@ -19,11 +19,14 @@ class anaconda(sos.plugintools.PluginBase): """Anaconda / Installation information """ def checkenabled(self): - try: os.stat("/var/log/anaconda.log") - except: pass - else: return True + try: + os.stat("/var/log/anaconda.log") + except: + pass + else: + return True - return False + return False def setup(self): self.addCopySpec("/root/anaconda-ks.cfg") diff --git a/src/lib/sos/plugins/cs.py b/src/lib/sos/plugins/cs.py new file mode 100644 index 00000000..871752dd --- /dev/null +++ b/src/lib/sos/plugins/cs.py @@ -0,0 +1,49 @@ +## Copyright (C) 2007 Red Hat, Inc., Kent Lamb <klamb@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. + +############################################################# +# This plugin assumes default location of Certificate System 7.x on RHEL4 +# Certificate System 7.x is not supported on RHEL5. +# Any improvemts for this plugin are appreciated. Please send them to +# klamb@redhat.com +# thanks, +# kent lamb +############################################################# + + +import sos.plugintools +import os + +class cs(sos.plugintools.PluginBase): + """Certificate System 7.x Diagnostic Information + """ + # check for default location of pki services (/var/lib.rhpki-*). If default path exists, + # assume rhpki- glob and grap all installed subsystems. If customer has a custom install + # path, then ln -s the custom path to /var/lib/rhkpi-installed_subsystem (/var/lib/rhpki-ca, + # /var/lib/rhpki-kra ect). + + def checkenabled(self): + if self.cInfo["policy"].pkgByName("rhpki-common") or os.path.exists("/var/lib/rhpki-*"): + return True + return False + + def setup(self): + self.addCopySpec("/var/lib/rhpki-*/conf/*cfg*") + self.addCopySpec("/var/lib/rhpki-*/conf/*.ldif") + self.addCopySpec("/var/lib/rhpki-*/logs/*") + return + + diff --git a/src/lib/sos/plugins/ds.py b/src/lib/sos/plugins/ds.py new file mode 100644 index 00000000..f1de72ea --- /dev/null +++ b/src/lib/sos/plugins/ds.py @@ -0,0 +1,43 @@ +## Copyright (C) 2007 Red Hat, Inc., Kent Lamb <klamb@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 +import os + +class ds(sos.plugintools.PluginBase): + """Directory Server information + """ + + ds_version = None + + def checkenabled(self): + if self.cInfo["policy"].pkgByName("redhat-ds-base") or os.path.exists("/etc/dirsrv"): + self.ds_version = "ds8" + return True + elif self.cInfo["policy"].pkgByName("redhat-ds-7") or os.path.exists("/opt/redhat-ds"): + self.ds_version = "ds7" + return True + return False + + def setup(self): + if "ds8" in self.ds_version: + self.addCopySpec("/etc/dirsrv/slapd*") + self.addCopySpec("/var/log/dirsrv/*") + if "ds7" in self.ds_version: + self.addCopySpec("/opt/redhat-ds/slapd-*/config") + self.addCopySpec("/opt/redhat-ds/slapd-*/logs") + return + diff --git a/src/lib/sos/plugins/general.py b/src/lib/sos/plugins/general.py index 5ed01e4b..bd0a4710 100644 --- a/src/lib/sos/plugins/general.py +++ b/src/lib/sos/plugins/general.py @@ -30,7 +30,10 @@ class general(sos.plugintools.PluginBase): self.addCopySpec("/etc/sos.conf") self.addCopySpec("/etc/sysconfig") self.addCopySpec("/proc/stat") + # Capture dmesg from system start 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") diff --git a/src/lib/sos/plugins/hardware.py b/src/lib/sos/plugins/hardware.py index 03f776e6..ac3f7da0 100644 --- a/src/lib/sos/plugins/hardware.py +++ b/src/lib/sos/plugins/hardware.py @@ -44,5 +44,7 @@ class hardware(sos.plugintools.PluginBase): self.collectExtOutput("/sbin/lsusb") self.collectExtOutput("/usr/bin/lshal") + self.collectExtOutput("/usr/bin/systool -c fc_host -v") + self.collectExtOutput("/usr/bin/systool -c scsi_host -v") return diff --git a/src/lib/sos/plugins/ipa.py b/src/lib/sos/plugins/ipa.py new file mode 100644 index 00000000..a6257966 --- /dev/null +++ b/src/lib/sos/plugins/ipa.py @@ -0,0 +1,35 @@ +## Copyright (C) 2007 Red Hat, Inc., Kent Lamb <klamb@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 +import os + +class ipa(sos.plugintools.PluginBase): + """IPA diagnostic information + """ + # ntp and dirserver stuff are covered in existing sos plugins, so we really only + # need to get kerberos and ipa specific addons. + + def checkenabled(self): + if self.cInfo["policy"].pkgByName("ipa-server") or os.path.exists("/etc/ipa"): + return True + return False + + def setup(self): + self.addCopySpec("/etc/dirsrv/ds.keytab") + self.addCopySpec("/etc/ipa/ipa.conf") + return + diff --git a/src/lib/sos/plugins/networking.py b/src/lib/sos/plugins/networking.py index 11a7de18..e86603ca 100644 --- a/src/lib/sos/plugins/networking.py +++ b/src/lib/sos/plugins/networking.py @@ -66,6 +66,7 @@ class networking(sos.plugintools.PluginBase): for eth in self.get_interface_name(ifconfigFile): self.collectExtOutput("/sbin/ethtool "+eth) self.collectExtOutput("/sbin/ethtool -i "+eth) + self.collectExtOutput("/sbin/ethtool -k "+eth) self.collectExtOutput("/sbin/ethtool -S "+eth) if self.getOption("traceroute"): self.collectExtOutput("/bin/traceroute -n rhn.redhat.com") diff --git a/src/lib/sos/plugins/samba.py b/src/lib/sos/plugins/samba.py index 9700790a..1e33758b 100644 --- a/src/lib/sos/plugins/samba.py +++ b/src/lib/sos/plugins/samba.py @@ -21,6 +21,7 @@ class samba(sos.plugintools.PluginBase): self.addCopySpec("/etc/samba") self.addCopySpec("/var/log/samba/*") self.addCopySpec("/etc/krb5.conf") + self.addCopySpec("/etc/krb5.keytab") 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/sar.py b/src/lib/sos/plugins/sar.py new file mode 100644 index 00000000..26e97715 --- /dev/null +++ b/src/lib/sos/plugins/sar.py @@ -0,0 +1,37 @@ +### 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 sar(sos.plugintools.PluginBase): + """Generate the sar file from /var/log/sa/saXX files + """ + def setup(self): + path="/var/log/sa" + dirList=os.listdir(path) + # find all the sa file that don't have an existing sar file + for fname in dirList: + if fname[0:2] == 'sa' and fname[2:3] != 'r': + sar_filename = 'sar' + fname[2:4] + if sar_filename not in dirList: + sar_command = "/usr/bin/sar -A -f /var/log/sa/" + fname + self.collectOutputNow(sar_command, sar_filename, root_symlink=sar_filename) + return + + def checkenabled(self): + if os.path.exists("/var/log/sa") and os.path.exists("/usr/bin/sar"): + return True + return False + diff --git a/src/lib/sos/plugins/smartcard.py b/src/lib/sos/plugins/smartcard.py new file mode 100644 index 00000000..aa9cedd2 --- /dev/null +++ b/src/lib/sos/plugins/smartcard.py @@ -0,0 +1,36 @@ +## Copyright (C) 2007 Sadique Puthen <sputhenp@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 +import os + +class smartcard(sos.plugintools.PluginBase): + """Smart Card related information + """ + + def checkenabled(self): + if self.cInfo["policy"].pkgByName("pam_pkcs11") or os.path.exists("/etc/pam_pkcs11/pam_pkcs11.conf"): + return True + return False + + def setup(self): + self.addCopySpec("/etc/reader.conf") + self.addCopySpec("/etc/reader.conf.d/") + self.addCopySpec("/etc/pam_pkcs11/") + self.collectExtOutput("/usr/bin/pkcs11_inspect debug") + self.collectExtOutput("/usr/bin/pklogin_finder debug") + self.collectExtOutput("/bin/ls -l /usr/lib/pam_pkcs11/") + return diff --git a/src/lib/sos/plugins/xen.py b/src/lib/sos/plugins/xen.py index 0760269c..66198a0a 100644 --- a/src/lib/sos/plugins/xen.py +++ b/src/lib/sos/plugins/xen.py @@ -68,7 +68,6 @@ class xen(sos.plugintools.PluginBase): # default of dom0, collect lots of system information self.addCopySpec("/var/log/xen") self.addCopySpec("/etc/xen") - self.collectExtOutput("/usr/bin/xenstore-ls") self.collectExtOutput("/usr/sbin/xm dmesg") self.collectExtOutput("/usr/sbin/xm info") self.collectExtOutput("/usr/sbin/xm list") diff --git a/src/sos.conf b/src/sos.conf index 0e6f1f4c..22cd4557 100644 --- a/src/sos.conf +++ b/src/sos.conf @@ -7,8 +7,7 @@ smtp_server = None [plugins] -#disable = plugin1 -#disable = plugin2 +#disable = plugin1, plugin2, plugin3 [tunables] diff --git a/src/sos.spec b/src/sos.spec index b66eca4a..cff1dc17 100644 --- a/src/sos.spec +++ b/src/sos.spec @@ -5,10 +5,10 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 1.8 -Release: 5%{?dist} +Release: 6%{?dist} Group: Application/Tools Source0: https://fedorahosted.org/releases/s/o/sos/%{name}-%{version}.tar.gz -License: GPLv2 +License: GPLv2+ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildArch: noarch Url: http://fedorahosted.org/sos @@ -46,7 +46,7 @@ rm -rf ${RPM_BUILD_ROOT} %{_sbindir}/sysreport.legacy /usr/share/sysreport /usr/share/sos/rhsupport.pub -%{python_sitelib}/sos/ +%{python_sitelib}/* %{_mandir}/man1/sosreport.1.gz %{_localedir}/*/LC_MESSAGES/sos.mo %doc README README.rh-upload-core TODO LICENSE ChangeLog |