diff options
author | Jesse Jaggars <jjaggars@redhat.com> | 2012-03-08 17:27:57 -0600 |
---|---|---|
committer | Jesse Jaggars <jjaggars@redhat.com> | 2012-03-08 17:27:57 -0600 |
commit | a36701a1923f49fd6dbb20931c6b7cac85e5f659 (patch) | |
tree | 538abfa8f5ed1c3898de63da3b6fce84d0a660c6 | |
parent | bbc6890f9ef4a7612c6960a522df4b0cd099054e (diff) | |
download | sos-a36701a1923f49fd6dbb20931c6b7cac85e5f659.tar.gz |
Squashed commit of the following:
commit 103883b65d0e15310e5349b7e0f3ebb4fe23d9ba
Author: Adam Stokes <hackr@cypherbook.com>
Date: Thu Mar 8 17:31:13 2012 -0500
sos/plugins/autofs: Make autofs cross distro compatible
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
commit 813b7c90a76438fdb7b6d6f0b6a9a16faaeac271
Author: Adam Stokes <hackr@cypherbook.com>
Date: Thu Mar 8 14:48:02 2012 -0500
sos/plugins: Second round of enhancements to several plugins to allow for cross
distribution analyzation.
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
commit f9fc1b3402cfa1cefcd822596696b0a52b9921e5
Author: Adam Stokes <hackr@cypherbook.com>
Date: Thu Mar 8 14:26:36 2012 -0500
sos/plugins/apache: Make sure tuple knows its a tuple
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
commit d52eda7e96734ea89ebe05ed63ea68979c7cfb58
Author: Adam Stokes <hackr@cypherbook.com>
Date: Thu Mar 8 14:12:18 2012 -0500
sos/plugins: Several plugin enhancements to reflect new
plugin heirarchy for multiple distributions
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
commit a36ed3cac5c557073604d7b0c98e50d1c162b714
Author: Adam Stokes <hackr@cypherbook.com>
Date: Thu Mar 8 14:11:12 2012 -0500
sos/plugins: New Apport Plugin
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
commit 168e688448d623b3b222aab1bd5f673e9ebb467c
Author: Adam Stokes <hackr@cypherbook.com>
Date: Thu Mar 8 14:06:54 2012 -0500
plugins/dhcp: Merge udhcp and dhcp into same plugin
Signed-off-by: Jesse Jaggars <jjaggars@redhat.com>
-rw-r--r-- | sos/plugins/apache.py | 25 | ||||
-rw-r--r-- | sos/plugins/apport.py (renamed from sos/plugins/udhcp.py) | 14 | ||||
-rw-r--r-- | sos/plugins/autofs.py | 27 | ||||
-rw-r--r-- | sos/plugins/dhcp.py | 23 | ||||
-rw-r--r-- | sos/plugins/gdm.py | 4 | ||||
-rw-r--r-- | sos/plugins/hardware.py | 16 | ||||
-rw-r--r-- | sos/plugins/initrd.py | 4 | ||||
-rw-r--r-- | sos/plugins/kdump.py | 28 | ||||
-rw-r--r-- | sos/plugins/kernel.py | 4 | ||||
-rw-r--r-- | sos/plugins/kvm.py | 4 | ||||
-rw-r--r-- | sos/plugins/libvirt.py | 5 | ||||
-rw-r--r-- | sos/plugins/printing.py | 4 | ||||
-rw-r--r-- | sos/plugins/sar.py | 5 | ||||
-rw-r--r-- | sos/plugins/ssh.py | 4 | ||||
-rw-r--r-- | sos/plugins/xinetd.py | 4 |
15 files changed, 126 insertions, 45 deletions
diff --git a/sos/plugins/apache.py b/sos/plugins/apache.py index a85f56ac..10159201 100644 --- a/sos/plugins/apache.py +++ b/sos/plugins/apache.py @@ -12,16 +12,37 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class apache(Plugin, RedHatPlugin): +class apache(Plugin): """Apache related information """ + plugin_name = "apache" + optionList = [("log", "gathers all apache logs", "slow", False)] +class RedHatApache(apache, RedHatPlugin): + """Apache related information for Red Hat distributions + """ + files = ('/etc/httpd/conf/httpd.conf',) + def setup(self): + super(RedHatApache, self).setup() self.addCopySpecs([ "/etc/httpd/conf/httpd.conf", "/etc/httpd/conf.d/*.conf"]) if self.getOption("log"): self.addCopySpec("/var/log/httpd/*") + +class DebianApache(apache, DebianPlugin, UbuntuPlugin): + """Apache related information for Debian distributions + """ + files = ('/etc/apache2/apache2.conf',) + + def setup(self): + super(DebianApache, self).setup() + self.addCopySpecs([ + "/etc/apache2/*", + "/etc/default/apache2"]) + if self.getOption("log"): + self.addCopySpec("/var/log/apache2/*") diff --git a/sos/plugins/udhcp.py b/sos/plugins/apport.py index 9b84d31b..83618dbe 100644 --- a/sos/plugins/udhcp.py +++ b/sos/plugins/apport.py @@ -13,16 +13,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, UbuntuPlugin +from sos.plugins import Plugin, DebianPlugin, UbuntuPlugin -class udhcp(Plugin, UbuntuPlugin): - """DHCP related information +class apport(Plugin, DebianPlugin, UbuntuPlugin): + """apport information """ - files = ('/etc/init.d/udhcpd',) - packages = ('udhcpd',) - def setup(self): - self.addCopySpecs([ - "/etc/default/udhcpd", - "/etc/udhcpd.conf" - ]) + self.addCopySpec("/etc/apport/*") diff --git a/sos/plugins/autofs.py b/sos/plugins/autofs.py index dc7c653d..d2c422f1 100644 --- a/sos/plugins/autofs.py +++ b/sos/plugins/autofs.py @@ -14,21 +14,23 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin import os, re -class autofs(Plugin, RedHatPlugin): +class autofs(Plugin): """autofs server-related information """ - files = ('/etc/sysconfig/autofs',) + plugin_name = "autofs" + + files = ('/etc/sysconfig/autofs', '/etc/default/autofs') packages = ('autofs',) def checkdebug(self): """ testing if autofs debug has been enabled anywhere """ # Global debugging - opt = self.fileGrep(r"^(DEFAULT_LOGGING|DAEMONOPTIONS)=(.*)", "/etc/sysconfig/autofs") + opt = self.fileGrep(r"^(DEFAULT_LOGGING|DAEMONOPTIONS)=(.*)", *self.files) for opt1 in opt: for opt2 in opt1.split(" "): if opt2 in ("--debug", "debug"): @@ -38,16 +40,29 @@ class autofs(Plugin, RedHatPlugin): def getdaemondebug(self): """ capture daemon debug output """ - debugout = self.fileGrep(r"^(daemon.*)\s+(\/var\/log\/.*)", "/etc/sysconfig/autofs") + debugout = self.fileGrep(r"^(daemon.*)\s+(\/var\/log\/.*)", *self.files) for i in debugout: return i[1] def setup(self): self.addCopySpec("/etc/auto*") - 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'") if self.checkdebug(): self.addCopySpec(self.getdaemondebug()) + +class RedHatAutofs(autofs, RedHatPlugin): + """autofs server-related on RedHat based distributions""" + + def setup(self): + super(RedHatAutofs, self).setup() + self.collectExtOutput("/bin/rpm -qV autofs") + +class DebianAutofs(autofs, DebianPlugin, UbuntuPlugin): + """autofs server-related on Debian based distributions""" + + def setup(self): + super(DebianAutofs, self).setup() + self.collectExtOutput("/usr/bin/dpkg-query -s autofs") diff --git a/sos/plugins/dhcp.py b/sos/plugins/dhcp.py index e43e0c3d..7ed2e7e1 100644 --- a/sos/plugins/dhcp.py +++ b/sos/plugins/dhcp.py @@ -12,16 +12,35 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin -class dhcp(Plugin, RedHatPlugin): +class dhcp(Plugin): """DHCP related information """ + plugin_name = "dhcp" + +class DhcpRedHat(dhcp, RedHatPlugin): + """DHCP related information for Red Hat based distributions""" + files = ('/etc/rc.d/init.d/dhcpd',) packages = ('dhcp',) def setup(self): + super(DhcpRedHat, self).setup() self.addCopySpecs([ "/etc/dhcpd.conf", "/etc/dhcp"]) + +class DhcpDebian(dhcp, UbuntuPlugin): + """DHCP related information for Debian based distributions""" + + files = ('/etc/init.d/udhcpd',) + packages = ('udhcpd',) + + def setup(self): + super(DhcpDebian, self).setup() + self.addCopySpecs([ + "/etc/default/udhcpd", + "/etc/udhcpd.conf" + ]) diff --git a/sos/plugins/gdm.py b/sos/plugins/gdm.py index 63cae615..a6b3bf2a 100644 --- a/sos/plugins/gdm.py +++ b/sos/plugins/gdm.py @@ -12,9 +12,9 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class gdm(Plugin, RedHatPlugin): +class gdm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """gdm related information """ def setup(self): diff --git a/sos/plugins/hardware.py b/sos/plugins/hardware.py index 09248b7a..7398656a 100644 --- a/sos/plugins/hardware.py +++ b/sos/plugins/hardware.py @@ -12,12 +12,15 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin +from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin from glob import glob -class hardware(Plugin, RedHatPlugin, UbuntuPlugin): +class hardware(Plugin, DebianPlugin, UbuntuPlugin): """hardware related information """ + + plugin_name = "hardware" + def setup(self): self.addCopySpecs([ "/proc/partitions", @@ -37,7 +40,6 @@ class hardware(Plugin, RedHatPlugin, UbuntuPlugin): "/proc/s390dbf/tape", "/sys/bus/scsi", "/sys/state"]) - self.collectExtOutput(glob("/usr/share/rhn/up2date*client/hardware.py")[0]) # RHBZ#572353 self.collectExtOutput("""/bin/echo -e "lspci:\n" ; /sbin/lspci ; /bin/echo -e "\nlspci -nvv:\n" ; /sbin/lspci -nvv ; /bin/echo -e "\nlspci -tv:\n" ; /sbin/lspci -tv""", suggest_filename = "lspci", root_symlink = "lspci") self.collectExtOutput("/usr/sbin/dmidecode", root_symlink = "dmidecode") @@ -50,3 +52,11 @@ class hardware(Plugin, RedHatPlugin, UbuntuPlugin): self.collectExtOutput("/usr/bin/lshal") self.collectExtOutput("/usr/bin/systool -c fc_host -v") self.collectExtOutput("/usr/bin/systool -c scsi_host -v") + +class RedHatHardware(hardware, RedHatPlugin): + """hardware related information for Red Hat distribution + """ + + def setup(self): + super(RedHatHardware, self).setup() + self.collectExtOutput(glob("/usr/share/rhn/up2date*client/hardware.py")[0]) # RHBZ#572353 diff --git a/sos/plugins/initrd.py b/sos/plugins/initrd.py index 351e532d..2a3ecb3d 100644 --- a/sos/plugins/initrd.py +++ b/sos/plugins/initrd.py @@ -12,10 +12,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin from glob import glob -class initrd(Plugin, RedHatPlugin): +class initrd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """initrd related information """ def setup(self): diff --git a/sos/plugins/kdump.py b/sos/plugins/kdump.py index 56c0b9ab..51948c8c 100644 --- a/sos/plugins/kdump.py +++ b/sos/plugins/kdump.py @@ -12,18 +12,40 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin from os.path import exists -class kdump(Plugin, RedHatPlugin): +class kdump(Plugin): """Kdump related information """ + plugin_name = "kdump" + + def setup(self): + self.addCopySpecs([ + "/proc/cmdline" + ]) + +class RedHatKdump(kdump, RedHatPlugin): + """Kdump related information for Red Hat distributions + """ + files = ('/etc/kdump.conf',) packages = ('kexec-tools',) def setup(self): self.addCopySpecs([ "/etc/kdump.conf", - "/proc/cmdline", "/etc/udev/rules.d/*kexec.rules"]) + +class DebianKdump(kdump, DebianPlugin, UbuntuPlugin): + """Kdump related information for Debian distributions + """ + + files = ('/etc/default/kdump-tools',) + packages = ('kdump-tools',) + + def setup(self): + self.addCopySpecs([ + "/etc/default/kdump-tools" + ]) diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py index 8a0e860c..d1d5f93f 100644 --- a/sos/plugins/kernel.py +++ b/sos/plugins/kernel.py @@ -12,10 +12,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin import os, re -class kernel(Plugin, RedHatPlugin): +class kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """kernel related information """ optionList = [("modinfo", 'gathers information on all kernel modules', 'fast', True)] diff --git a/sos/plugins/kvm.py b/sos/plugins/kvm.py index 46624282..a3e314a4 100644 --- a/sos/plugins/kvm.py +++ b/sos/plugins/kvm.py @@ -15,10 +15,10 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin import os -class kvm(Plugin, RedHatPlugin): +class kvm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """KVM related information """ diff --git a/sos/plugins/libvirt.py b/sos/plugins/libvirt.py index 4eba7963..44571e7e 100644 --- a/sos/plugins/libvirt.py +++ b/sos/plugins/libvirt.py @@ -12,8 +12,9 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin -class libvirt(Plugin, RedHatPlugin, UbuntuPlugin): +from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin + +class libvirt(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): """libvirt-related information """ def setup(self): diff --git a/sos/plugins/printing.py b/sos/plugins/printing.py index 48c25901..986477a3 100644 --- a/sos/plugins/printing.py +++ b/sos/plugins/printing.py @@ -12,9 +12,9 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class printing(Plugin, RedHatPlugin): +class printing(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """printing related information (cups) """ optionList = [("cups", "max size (MiB) to collect per cups log file", diff --git a/sos/plugins/sar.py b/sos/plugins/sar.py index f6c283d2..1f52a84b 100644 --- a/sos/plugins/sar.py +++ b/sos/plugins/sar.py @@ -12,11 +12,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin from os import listdir -from os.path import exists -class sar(Plugin, RedHatPlugin): +class sar(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """Generate the sar file from /var/log/sa/saXX files """ diff --git a/sos/plugins/ssh.py b/sos/plugins/ssh.py index 9cc02345..c925c567 100644 --- a/sos/plugins/ssh.py +++ b/sos/plugins/ssh.py @@ -14,9 +14,9 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class ssh(Plugin, RedHatPlugin): +class ssh(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """ssh-related information """ def setup(self): diff --git a/sos/plugins/xinetd.py b/sos/plugins/xinetd.py index 8bce1fe4..ba9e1c8d 100644 --- a/sos/plugins/xinetd.py +++ b/sos/plugins/xinetd.py @@ -14,10 +14,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin import os -class xinetd(Plugin, RedHatPlugin): +class xinetd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """xinetd information """ |