diff options
-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 """ |