aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--sos/plugins/postgresql.py39
-rw-r--r--sos/plugins/soundcard.py35
3 files changed, 62 insertions, 13 deletions
diff --git a/AUTHORS b/AUTHORS
index d90785fb..7aeeac4d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,5 +1,6 @@
Adam Stokes <adam.stokes@ubuntu.com>
Ben Turner <bturner@redhat.com>
+Chris J Arges <chris.j.arges@ubuntu.com>
Eric Williams <eric.williams@canonical.com>
Eugene Teo <eteo@redhat.com>
Gary Kotton <gkotton@redhat.com>
diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py
index 1ae269fb..084d70a7 100644
--- a/sos/plugins/postgresql.py
+++ b/sos/plugins/postgresql.py
@@ -4,12 +4,14 @@ import shlex
import subprocess
import tempfile
-from sos.plugins import Plugin, RedHatPlugin
+from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin
from sos.utilities import find
-class postgresql(Plugin, RedHatPlugin):
+class PostgreSQL(Plugin):
"""PostgreSQL related information"""
+ plugin_name = "postgresql"
+
packages = ('postgresql',)
tmp_dir = None
@@ -44,6 +46,17 @@ class postgresql(Plugin, RedHatPlugin):
else:
self.add_alert("WARN: password must be supplied to dump a database.")
+ def postproc(self):
+ import shutil
+ if self.tmp_dir:
+ shutil.rmtree(self.tmp_dir)
+
+class RedHatPostgreSQL(PostgreSQL, RedHatPlugin):
+ """PostgreSQL related information for Red Hat distributions"""
+
+ def setup(self):
+ super(RedHatPostgreSQL, self).setup()
+
# Copy PostgreSQL log files.
for file in find("*.log", self.get_option("pghome")):
self.add_copy_spec(file)
@@ -54,8 +67,22 @@ class postgresql(Plugin, RedHatPlugin):
self.add_copy_spec(os.path.join(self.get_option("pghome"), "data" , "PG_VERSION"))
self.add_copy_spec(os.path.join(self.get_option("pghome"), "data" , "postmaster.opts"))
+class DebianPostgreSQL(PostgreSQL, DebianPlugin, UbuntuPlugin):
+ """PostgreSQL related information for Debian/Ubuntu distributions"""
+
+ def setup(self):
+ super(DebianPostgreSQL, self).setup()
+
+ # Copy PostgreSQL log files.
+ self.add_copy_spec("/var/log/postgresql/*.log")
+ # Copy PostgreSQL config files.
+ self.add_copy_spec("/etc/postgresql/*/main/*.conf")
+
+ self.add_copy_spec("/var/lib/postgresql/*/main/PG_VERSION")
+ self.add_copy_spec("/var/lib/postgresql/*/main/postmaster.opts")
+
+
+
+
+
- def postproc(self):
- import shutil
- if self.tmp_dir:
- shutil.rmtree(self.tmp_dir)
diff --git a/sos/plugins/soundcard.py b/sos/plugins/soundcard.py
index 0a01499c..0aec3282 100644
--- a/sos/plugins/soundcard.py
+++ b/sos/plugins/soundcard.py
@@ -12,23 +12,44 @@
## 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 soundcard(Plugin, RedHatPlugin):
+
+class Soundcard(Plugin):
""" Sound card information
"""
+ plugin_name = "soundcard"
+
def default_enabled(self):
return False
def setup(self):
- self.add_copy_specs([
- "/proc/asound/*",
- "/etc/alsa/*",
- "/etc/asound.*"])
+ self.add_copy_spec("/proc/asound/*")
self.add_cmd_output("lspci | grep -i audio")
self.add_cmd_output("aplay -l")
self.add_cmd_output("aplay -L")
self.add_cmd_output("amixer")
- self.add_cmd_output("lsmod | grep snd | awk '{print $1}'", suggest_filename = "sndmodules_loaded")
+ self.add_cmd_output("lsmod | grep snd | awk '{print $1}'",\
+ suggest_filename = "sndmodules_loaded")
+
+class RedHatSoundcard(Soundcard, RedHatPlugin):
+ """ Sound card information for RedHat distros
+ """
+
+ def setup(self):
+ super(RedHatSoundcard, self).setup()
+
+ self.add_copy_specs([
+ "/etc/alsa/*",
+ "/etc/asound.*"])
+
+class DebianSoundcard(Soundcard, DebianPlugin, UbuntuPlugin):
+ """ Sound card information for Debian/Ubuntu distros
+ """
+
+ def setup(self):
+ super(DebianSoundcard, self).setup()
+
+ self.add_copy_spec("/etc/pulse/*")