aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stokes <hackr@cypherbook.com>2013-03-25 08:47:02 -0400
committerAdam Stokes <hackr@cypherbook.com>2013-03-25 08:47:02 -0400
commit3b5ecf3c4a041c4494121d7d5dd36e0fc047910a (patch)
tree52f626c25a6f8f48be0d04e40c3623da0f6491aa
parent183d503016c44981ebe6090f07f73fbea7b1b019 (diff)
downloadsos-3b5ecf3c4a041c4494121d7d5dd36e0fc047910a.tar.gz
Port several plugins to Debian/Ubuntu
[ Louis Bouchard ] - Ported several plugins to work across Red Hat, Debian and Ubuntu. Signed-off-by: Adam Stokes <hackr@cypherbook.com>
-rw-r--r--.gitignore1
-rw-r--r--sos/plugins/acpid.py14
-rw-r--r--sos/plugins/cobbler.py18
-rw-r--r--sos/plugins/dpkg.py2
-rw-r--r--sos/plugins/general.py23
-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
10 files changed, 84 insertions, 15 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/sos/plugins/acpid.py b/sos/plugins/acpid.py
index bc335eea..42840e7d 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 AcpidRedHat(acpid, RedHatPlugin):
"""acpid related information
"""
def setup(self):
self.addCopySpecs([
"/var/log/acpid*",
"/etc/acpi/events/power.conf"])
+
+class AcpidDebian(acpid, DebianPlugin, UbuntuPlugin):
+ """acpid related information for Debian and Ubuntu
+ """
+ def setup(self):
+ self.addCopySpecs([
+ "/etc/acpi/events/powerbtn*"])
diff --git a/sos/plugins/cobbler.py b/sos/plugins/cobbler.py
index 183d11fd..08847309 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 CobblerRedHat(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 CobblerDebianPlugin(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/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..1ad03055 100644
--- a/sos/plugins/general.py
+++ b/sos/plugins/general.py
@@ -97,6 +97,29 @@ class GeneralDebian(general, DebianPlugin, UbuntuPlugin):
super(GeneralDebian, self).setup()
self.addCopySpecs([
"/etc/debian_version",
+ "/etc/default",
"/var/log/up2date",
"/etc/lsb-release"
])
+class GeneralUbuntu(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..3cece4cc 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 SystemRedHat(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 SystemDebian(Plugin, 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):