aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2013-03-26 03:49:11 -0700
committerBryn M. Reeves <bmr@redhat.com>2013-03-26 03:49:11 -0700
commit2fcb1f4a6fbf5abda746bf1470edb55ccc6b01a6 (patch)
tree27ff7235827e0d93f2fd272f7b07d67b7f5e7980
parent03194f76076932120557b591664f5402b59232e0 (diff)
parent2f9dcd617355e7946fdfa6c2380aaac4c3d7d97d (diff)
downloadsos-2fcb1f4a6fbf5abda746bf1470edb55ccc6b01a6.tar.gz
Merge pull request #103 from battlemidget/patch-1
Port several plugins to Debian/Ubuntu
-rw-r--r--.gitignore1
-rw-r--r--man/en/sosreport.12
-rw-r--r--sos/plugins/acpid.py14
-rw-r--r--sos/plugins/cgroups.py4
-rw-r--r--sos/plugins/cobbler.py18
-rw-r--r--sos/plugins/dhcp.py4
-rw-r--r--sos/plugins/dpkg.py2
-rw-r--r--sos/plugins/general.py25
-rw-r--r--sos/plugins/process.py4
-rw-r--r--sos/plugins/squid.py4
-rw-r--r--sos/plugins/system.py25
-rw-r--r--sos/plugins/systemtap.py4
-rw-r--r--sos/plugins/udev.py4
-rw-r--r--sos/policies/__init__.py3
14 files changed, 93 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore
index 54303d03..52a89859 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ cover/
*.mo
sos.conf.5.gz
sosreport.1.gz
+venv
diff --git a/man/en/sosreport.1 b/man/en/sosreport.1
index b5a56974..eeda57a9 100644
--- a/man/en/sosreport.1
+++ b/man/en/sosreport.1
@@ -1,4 +1,4 @@
-.TH SOSREPORT 1 "Tue Apr 08 2010"
+.TH SOSREPORT 1 "Mon Mar 25 2013"
.SH NAME
sosreport \- Collect and package diagnostic and support data
.SH SYNOPSIS
diff --git a/sos/plugins/acpid.py b/sos/plugins/acpid.py
index bc335eea..1c092e42 100644
--- a/sos/plugins/acpid.py
+++ b/sos/plugins/acpid.py
@@ -12,12 +12,22 @@
## 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 acpid(Plugin, RedHatPlugin):
+class acpid(Plugin):
+ plugin_name = "acpid"
+
+class RedHatAcpid(acpid, RedHatPlugin):
"""acpid related information
"""
def setup(self):
self.addCopySpecs([
"/var/log/acpid*",
"/etc/acpi/events/power.conf"])
+
+class DebianAcpid(acpid, DebianPlugin, UbuntuPlugin):
+ """acpid related information for Debian and Ubuntu
+ """
+ def setup(self):
+ self.addCopySpecs([
+ "/etc/acpi/events/powerbtn*"])
diff --git a/sos/plugins/cgroups.py b/sos/plugins/cgroups.py
index 73e6ac93..5b217760 100644
--- a/sos/plugins/cgroups.py
+++ b/sos/plugins/cgroups.py
@@ -14,12 +14,14 @@
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
-class cgroups(Plugin, DebianPlugin, UbuntuPlugin):
+class cgroups(Plugin):
"""cgroup subsystem information
"""
plugin_name = "cgroups"
+class DebianCgroups(cgroups, DebianPlugin, UbuntuPlugin):
+
files = ('/proc/cgroups',)
def setup(self):
diff --git a/sos/plugins/cobbler.py b/sos/plugins/cobbler.py
index 183d11fd..5ad1d062 100644
--- a/sos/plugins/cobbler.py
+++ b/sos/plugins/cobbler.py
@@ -12,9 +12,12 @@
## 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 cobbler(Plugin, RedHatPlugin):
+class cobbler(Plugin):
+ plugin_name = "cobbler"
+
+class RedHatCobbler(cobbler, RedHatPlugin):
"""cobbler related information
"""
@@ -25,3 +28,14 @@ class cobbler(Plugin, RedHatPlugin):
self.addCopySpec("/var/log/cobbler")
self.addCopySpec("/var/lib/rhn/kickstarts")
self.addCopySpec("/var/lib/cobbler")
+
+class DebianCobbler(cobbler, DebianPlugin, UbuntuPlugin):
+ """cobbler related information for Debian and Ubuntu
+ """
+
+ packages = ('cobbler',)
+
+ def setup(self):
+ self.addCopySpec("/etc/cobbler")
+ self.addCopySpec("/var/log/cobbler")
+ self.addCopySpec("/var/lib/cobbler")
diff --git a/sos/plugins/dhcp.py b/sos/plugins/dhcp.py
index 7ed2e7e1..772ea35b 100644
--- a/sos/plugins/dhcp.py
+++ b/sos/plugins/dhcp.py
@@ -20,7 +20,7 @@ class dhcp(Plugin):
plugin_name = "dhcp"
-class DhcpRedHat(dhcp, RedHatPlugin):
+class RedHatDhcp(dhcp, RedHatPlugin):
"""DHCP related information for Red Hat based distributions"""
files = ('/etc/rc.d/init.d/dhcpd',)
@@ -32,7 +32,7 @@ class DhcpRedHat(dhcp, RedHatPlugin):
"/etc/dhcpd.conf",
"/etc/dhcp"])
-class DhcpDebian(dhcp, UbuntuPlugin):
+class UbuntuDhcp(dhcp, UbuntuPlugin):
"""DHCP related information for Debian based distributions"""
files = ('/etc/init.d/udhcpd',)
diff --git a/sos/plugins/dpkg.py b/sos/plugins/dpkg.py
index 5f8d38a1..2610ce57 100644
--- a/sos/plugins/dpkg.py
+++ b/sos/plugins/dpkg.py
@@ -20,4 +20,4 @@ class dpkg(Plugin, DebianPlugin, UbuntuPlugin):
"""
def setup(self):
self.addCopySpec("/var/log/dpkg.log")
- self.addCmdOutput("/usr/bin/dpkg-query -W -f='${Package}-${Version}-${Architecture}\n' \*", root_symlink = "installed-debs")
+ self.addCmdOutput("/usr/bin/dpkg -l", root_symlink = "installed-debs")
diff --git a/sos/plugins/general.py b/sos/plugins/general.py
index eccb1f57..62c7e441 100644
--- a/sos/plugins/general.py
+++ b/sos/plugins/general.py
@@ -90,13 +90,36 @@ class RedHatGeneral(general, RedHatPlugin):
r"(\s*proxyPassword\s*=\s*)\S+", r"\1***")
-class GeneralDebian(general, DebianPlugin, UbuntuPlugin):
+class DebianGeneral(general, DebianPlugin, UbuntuPlugin):
"""Basic system information for Debian based distributions"""
def setup(self):
super(GeneralDebian, self).setup()
self.addCopySpecs([
"/etc/debian_version",
+ "/etc/default",
"/var/log/up2date",
"/etc/lsb-release"
])
+class UbuntuGeneral(general, UbuntuPlugin):
+ """Basic system information for Ubuntu based distributions"""
+
+ def setup(self):
+ super(GeneralUbuntu, self).setup()
+ self.addCopySpecs([
+ "/etc/os-release",
+ "/var/log/ufw.log",
+ "/var/log/apport.log",
+ "/var/log/syslog",
+ "/var/log/udev",
+ "/var/log/boot*",
+ "/var/log/dmesg*",
+ "/var/log/kern*",
+ "/var/log/mail*",
+ "/var/log/dist-upgrade",
+ "/var/log/landscape",
+ "/var/log/installer",
+ "/var/log/unattended-upgrades",
+ "/var/log/upstart"
+ ])
+ self.addCmdOutput("/usr/sbin/ufw app list",root_symlink="ufw")
diff --git a/sos/plugins/process.py b/sos/plugins/process.py
index 98b8a2fa..42ae5bf3 100644
--- a/sos/plugins/process.py
+++ b/sos/plugins/process.py
@@ -12,11 +12,11 @@
## 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 time
import os
-class process(Plugin, RedHatPlugin):
+class process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""process information
"""
def setup(self):
diff --git a/sos/plugins/squid.py b/sos/plugins/squid.py
index 29c06340..df18661b 100644
--- a/sos/plugins/squid.py
+++ b/sos/plugins/squid.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
-class squid(Plugin, RedHatPlugin):
+class squid(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""squid related information
"""
diff --git a/sos/plugins/system.py b/sos/plugins/system.py
index 0e9977e2..3033bd22 100644
--- a/sos/plugins/system.py
+++ b/sos/plugins/system.py
@@ -12,9 +12,12 @@
## 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 system(Plugin, RedHatPlugin):
+class system(Plugin):
+ plugin_name = "system"
+
+class RedHatSystem(system, RedHatPlugin):
"""core system related information
"""
def setup(self):
@@ -35,4 +38,22 @@ class system(Plugin, RedHatPlugin):
"/proc/sys/net/ipv6/neigh/*/base_reachable_time")
self.addCmdOutput("/usr/bin/crontab -l")
+
+class DebianSystem(system, DebianPlugin, UbuntuPlugin):
+ """core system related information for Debian and Ubuntu
+ """
+ def setup(self):
+ self.addCopySpecs([
+ "/proc/sys",
+ "/etc/cron*",
+ "/var/spool/cron*",
+ "/etc/syslog.conf",
+ "/etc/rsyslog.conf",
+ "/etc/ntp.conf" ])
+ self.addForbiddenPath(
+ "/proc/sys/net/ipv8/neigh/*/retrans_time")
+ self.addForbiddenPath(
+ "/proc/sys/net/ipv6/neigh/*/base_reachable_time")
+
+ self.addCmdOutput("/usr/bin/crontab -l")
diff --git a/sos/plugins/systemtap.py b/sos/plugins/systemtap.py
index 19ea5607..cd3634ec 100644
--- a/sos/plugins/systemtap.py
+++ b/sos/plugins/systemtap.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 systemtap(Plugin, RedHatPlugin):
+class systemtap(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""SystemTap information
"""
diff --git a/sos/plugins/udev.py b/sos/plugins/udev.py
index 4a71d02d..cb3aa97d 100644
--- a/sos/plugins/udev.py
+++ b/sos/plugins/udev.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 udev(Plugin, RedHatPlugin):
+class udev(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""udev related information
"""
def setup(self):
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py
index 7e2d3375..224abdd8 100644
--- a/sos/policies/__init__.py
+++ b/sos/policies/__init__.py
@@ -450,7 +450,8 @@ class LinuxPolicy(Policy):
self.ticketNumber = self.commons['cmdlineopts'].ticketNumber
self.reportName = self.sanitizeReportName(self.reportName)
- self.ticketNumber = self.sanitizeTicketNumber(self.ticketNumber)
+ if self.ticketNumber:
+ self.ticketNumber = self.sanitizeTicketNumber(self.ticketNumber)
if (self.reportName == ""):
self.reportName = "default"