From 05c74a802dc6e922201cb706bf516b94e6a0c415 Mon Sep 17 00:00:00 2001 From: astokes Date: Tue, 13 Jan 2009 15:20:55 +0000 Subject: several new plugins added git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@549 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/lib/sos/plugins/anaconda.py | 11 +++++---- src/lib/sos/plugins/cs.py | 49 +++++++++++++++++++++++++++++++++++++++ src/lib/sos/plugins/ds.py | 43 ++++++++++++++++++++++++++++++++++ src/lib/sos/plugins/general.py | 3 +++ src/lib/sos/plugins/hardware.py | 2 ++ src/lib/sos/plugins/ipa.py | 35 ++++++++++++++++++++++++++++ src/lib/sos/plugins/networking.py | 1 + src/lib/sos/plugins/samba.py | 1 + src/lib/sos/plugins/sar.py | 37 +++++++++++++++++++++++++++++ src/lib/sos/plugins/smartcard.py | 36 ++++++++++++++++++++++++++++ src/lib/sos/plugins/xen.py | 1 - 11 files changed, 214 insertions(+), 5 deletions(-) create mode 100644 src/lib/sos/plugins/cs.py create mode 100644 src/lib/sos/plugins/ds.py create mode 100644 src/lib/sos/plugins/ipa.py create mode 100644 src/lib/sos/plugins/sar.py create mode 100644 src/lib/sos/plugins/smartcard.py (limited to 'src/lib') 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 + +### 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 + +## 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 + +## 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 + +### 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") -- cgit