aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2013-04-18 15:38:37 +0100
committerBryn M. Reeves <bmr@redhat.com>2013-04-18 15:40:15 +0100
commit57656a43be54d4c69098331659fdeafca8638131 (patch)
tree0944edb2a07543bfc53ad2943cb49e0799fe8369
parent9319a58629d212a2883b397bd6dfb11ab84229f4 (diff)
parentabb7c298f64c0609422eee219bd1b334165d30d1 (diff)
downloadsos-57656a43be54d4c69098331659fdeafca8638131.tar.gz
Merge branch 'new_ubuntu_plugin'
Conflicts: sos/plugins/auditd.py sos/plugins/corosync.py sos/plugins/dovecot.py sos/plugins/general.py sos/plugins/ldap.py sos/plugins/lsbrelease.py sos/plugins/mysql.py sos/plugins/named.py sos/plugins/networking.py sos/plugins/nis.py sos/plugins/ntp.py sos/plugins/pam.py sos/plugins/postfix.py sos/plugins/pxe.py sos/plugins/samba.py sos/plugins/sendmail.py sos/plugins/snmp.py sos/plugins/startup.py sos/policies/debian.py Fixed up numerous bits of breakage due to the recent PATH changes in master and also refactored some of the newly ported plug-ins to reduce the amount of code duplication between distro versions of common plug-ins. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/auditd.py13
-rw-r--r--sos/plugins/corosync.py23
-rw-r--r--sos/plugins/devicemapper.py4
-rw-r--r--sos/plugins/dhcp.py2
-rw-r--r--sos/plugins/dovecot.py29
-rw-r--r--sos/plugins/general.py6
-rw-r--r--sos/plugins/ldap.py35
-rw-r--r--sos/plugins/logrotate.py4
-rw-r--r--sos/plugins/lsbrelease.py5
-rw-r--r--sos/plugins/mysql.py39
-rw-r--r--sos/plugins/named.py71
-rw-r--r--sos/plugins/networking.py55
-rw-r--r--sos/plugins/nis.py5
-rw-r--r--sos/plugins/ntp.py28
-rw-r--r--sos/plugins/pam.py28
-rw-r--r--sos/plugins/postfix.py29
-rw-r--r--sos/plugins/psacct.py26
-rw-r--r--sos/plugins/pxe.py34
-rw-r--r--sos/plugins/samba.py27
-rw-r--r--sos/plugins/sendmail.py26
-rw-r--r--sos/plugins/snmp.py25
-rw-r--r--sos/plugins/startup.py30
-rw-r--r--sos/policies/debian.py4
23 files changed, 453 insertions, 95 deletions
diff --git a/sos/plugins/auditd.py b/sos/plugins/auditd.py
index 27dda2ba..6bc6bf49 100644
--- a/sos/plugins/auditd.py
+++ b/sos/plugins/auditd.py
@@ -12,14 +12,17 @@
## 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 Auditd(Plugin, RedHatPlugin):
+class auditd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Auditd related information
"""
- option_list = [("syslogsize", "max size (MiB) to collect per syslog file", "", 15)]
+ option_list = [("logsize", "maximum size (MiB) of logs to collect",
+ "", 15)]
def setup(self):
- self.add_copy_specs(["/etc/audit/auditd.conf", "/etc/audit/audit.rules"])
- self.add_copy_spec_limit("/var/log/audit*", sizelimit = self.get_option("syslogsize"))
+ self.add_copy_specs(["/etc/audit/auditd.conf",
+ "/etc/audit/audit.rules"])
+ self.add_copy_spec_limit("/var/log/audit*",
+ sizelimit = self.get_option("syslogsize"))
diff --git a/sos/plugins/corosync.py b/sos/plugins/corosync.py
index 2c2bf35b..79333c2f 100644
--- a/sos/plugins/corosync.py
+++ b/sos/plugins/corosync.py
@@ -12,13 +12,13 @@
## 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 corosync(Plugin, RedHatPlugin):
+class Corosync(Plugin):
""" corosync information
"""
- files = ('corosync',)
+ plugin_name = "corosync"
packages = ('corosync',)
def setup(self):
@@ -34,3 +34,20 @@ class corosync(Plugin, RedHatPlugin):
self.add_cmd_output("corosync-objctl -w runtime.blackbox.dump_state=$(date +\%s)")
self.add_cmd_output("corosync-objctl -w runtime.blackbox.dump_flight_data=$(date +\%s)")
self.call_ext_prog("killall -USR2 corosync")
+
+class RedHatCorosync(Corosync, RedHatPlugin):
+ """ corosync information for RedHat based distribution
+ """
+
+ def setup(self):
+ super(RedHatCorosync, self).setup()
+
+
+class DebianCorosync(Corosync, DebianPlugin, UbuntuPlugin):
+ """ corosync information for Debian and Ubuntu distributions
+ """
+
+ def setup(self):
+ super(DebianCorosync, self).setup()
+
+ files = ('/usr/sbin/corosync',)
diff --git a/sos/plugins/devicemapper.py b/sos/plugins/devicemapper.py
index 1aded5b0..5a3e027c 100644
--- a/sos/plugins/devicemapper.py
+++ b/sos/plugins/devicemapper.py
@@ -19,8 +19,8 @@ class devicemapper(Plugin, RedHatPlugin):
"""device-mapper related information (dm, lvm, multipath)
"""
- option_list = [("lvmdump", 'collect raw metadata from PVs', 'slow', False)]
- option_list = [("lvmdump-a", 'use the -a option of lvmdump (requires the "lvmdump" option)', 'slow', False)]
+ option_list = [("lvmdump", 'collect raw metadata from PVs', 'slow', False),
+ ("lvmdump-a", 'use the -a option of lvmdump (requires the "lvmdump" option)', 'slow', False)]
dmraid_options = ['V','b','r','s','tay','rD']
def do_lvmdump(self):
diff --git a/sos/plugins/dhcp.py b/sos/plugins/dhcp.py
index d66dfec1..71946c2b 100644
--- a/sos/plugins/dhcp.py
+++ b/sos/plugins/dhcp.py
@@ -32,7 +32,7 @@ class RedHatDhcp(Dhcp, RedHatPlugin):
"/etc/dhcpd.conf",
"/etc/dhcp"])
-class UbuntuDhcp(dhcp, UbuntuPlugin):
+class UbuntuDhcp(Dhcp, UbuntuPlugin):
"""DHCP related information for Debian based distributions"""
files = ('/etc/init.d/udhcpd',)
diff --git a/sos/plugins/dovecot.py b/sos/plugins/dovecot.py
index b3c5f929..2d92a6b9 100644
--- a/sos/plugins/dovecot.py
+++ b/sos/plugins/dovecot.py
@@ -12,13 +12,32 @@
## 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 dovecot(Plugin, RedHatPlugin):
+class Dovecot(Plugin):
"""dovecot server related information
"""
+
+ plugin_name = "dovecot"
+
+ def setup(self):
+ self.add_copy_spec("/etc/dovecot*")
+ self.add_cmd_output("dovecot -n")
+
+class RedHatDovecot(Dovecot, RedHatPlugin):
+ """dovecot server related information for RedHat based distribution
+ """
def setup(self):
- if os.path.exists("/etc/dovecot.conf"):
- self.add_copy_spec("/etc/dovecot*")
- self.add_cmd_output("dovecot -n")
+ super(RedHatDovecot, self).setup()
+
+ packages = ('dovecot', )
+ files = ('/etc/dovecot.conf',)
+
+class DebianDovecot(Dovecot, DebianPlugin, UbuntuPlugin):
+ """dovecot server related information for Debian based distribution
+ """
+ def setup(self):
+ super(DebianDovecot, self).setup()
+
+ files = ('/etc/dovecot/README',)
diff --git a/sos/plugins/general.py b/sos/plugins/general.py
index 01cc60c1..dc57ba95 100644
--- a/sos/plugins/general.py
+++ b/sos/plugins/general.py
@@ -98,17 +98,15 @@ class DebianGeneral(General, DebianPlugin):
self.add_copy_specs([
"/etc/debian_version",
"/etc/default",
- "/var/log/up2date",
"/etc/lsb-release"
])
-class UbuntuGeneral(General, UbuntuPlugin):
+class UbuntuGeneral(DebianGeneral, UbuntuPlugin):
"""Basic system information for Ubuntu based distributions"""
def setup(self):
super(UbuntuGeneral, self).setup()
self.add_copy_specs([
"/etc/os-release",
- "/var/log/ufw.log",
"/var/log/apport.log",
"/var/log/syslog",
"/var/log/udev",
@@ -122,4 +120,4 @@ class UbuntuGeneral(General, UbuntuPlugin):
"/var/log/unattended-upgrades",
"/var/log/upstart"
])
- self.add_cmd_output("ufw app list",root_symlink="ufw")
+
diff --git a/sos/plugins/ldap.py b/sos/plugins/ldap.py
index 211c1429..3fce4278 100644
--- a/sos/plugins/ldap.py
+++ b/sos/plugins/ldap.py
@@ -12,14 +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
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+import os
-class ldap(Plugin, RedHatPlugin):
+class Ldap(Plugin):
"""LDAP related information
"""
- files = ('/etc/openldap/ldap.conf',)
- packages = ('openldap', 'nss-pam-ldapd')
+ plugin_name = "ldap"
+ ldap_conf = "/etc/openldap/ldap.conf"
def get_ldap_opts(self):
# capture /etc/openldap/ldap.conf options in dict
@@ -28,14 +29,38 @@ class ldap(Plugin, RedHatPlugin):
results={}
tmplist=[]
for i in ldapopts:
- t=self.do_regex_find_all(r"^(%s)\s+(.*)" % i,"/etc/openldap/ldap.conf")
+ t=self.do_regex_find_all(r"^(%s)\s+(.*)" % i,self.ldap_conf)
for x in t:
results[x[0]]=x[1].rstrip("\n")
return results
def setup(self):
+ super(Ldap, self).setup()
+
+class RedHatLdap(Ldap, RedHatPlugin):
+ """LDAP related information for RedHat based distribution
+ """
+
+ packages = ('openldap', 'nss-pam-ldapd')
+
+ def setup(self):
+ super(RedHatLdap, self).setup()
self.add_copy_specs(["/etc/ldap.conf", "/etc/openldap", "/etc/nslcd.conf"])
def postproc(self):
self.do_file_sub("/etc/ldap.conf", r"(\s*bindpw\s*)\S+", r"\1***")
self.do_file_sub("/etc/nslcd.conf", r"(\s*bindpw\s*)\S+", r"\1***")
+
+class DebianLdap(Ldap, DebianPlugin, UbuntuPlugin):
+ """LDAP related information for Debian based distribution
+ """
+
+ ldap_conf = "/etc/ldap/ldap.conf"
+ packages = ('slapd', 'ldap-utils')
+
+ def setup(self):
+ super(DebianLdap, self).setup()
+
+ def setup(self):
+ self.add_copy_specs(["/etc/ldap/ldap.conf", "/etc/ldap/slapd.d"])
+
diff --git a/sos/plugins/logrotate.py b/sos/plugins/logrotate.py
index 3a56a549..960e4b7e 100644
--- a/sos/plugins/logrotate.py
+++ b/sos/plugins/logrotate.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 logrotate(Plugin, RedHatPlugin):
+class logrotate(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""logrotate configuration files and debug info
"""
diff --git a/sos/plugins/lsbrelease.py b/sos/plugins/lsbrelease.py
index aa3b2888..e3e996e9 100644
--- a/sos/plugins/lsbrelease.py
+++ b/sos/plugins/lsbrelease.py
@@ -13,9 +13,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 lsbrelease(Plugin, RedHatPlugin):
+class lsbrelease(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""Linux Standard Base information
"""
diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py
index 3a3fdbdd..e3c971fe 100644
--- a/sos/plugins/mysql.py
+++ b/sos/plugins/mysql.py
@@ -12,18 +12,41 @@
## 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 mysql(Plugin, RedHatPlugin):
+class Mysql(Plugin):
"""MySQL related information
"""
- files = ('/etc/my.cnf',)
+ plugin_name = "mysql"
+ mysql_cnf = "/etc/my.cnf"
+
+ def setup(self):
+ super(Mysql, self).setup()
+ self.add_copy_specs([self.mysql_cnf,
+ "/var/log/mysql*"])
+
+
+class RedHatMysql(Mysql, RedHatPlugin):
+ """MySQL related information for RedHat based distributions
+ """
+
packages = ('mysql-server', 'mysql')
def setup(self):
- self.add_copy_specs([
- "/etc/my.cnf",
- "/etc/sysconfig/network",
- "/etc/ld.so.conf.d/mysql*",
- "/var/log/mysql*"])
+ self.mysql_cnf = "/etc/my.cnf"
+ super(RedHatMysql, self).setup()
+ self.add_copy_spec("/etc/ld.so.conf.d/mysql*")
+
+
+class DebianMysql(Mysql, DebianPlugin, UbuntuPlugin):
+ """MySQL related information for Debian based distributions
+ """
+
+ packages = ('mysql-server', 'mysql-common')
+
+ def setup(self):
+ self.mysql_cnf = "/etc/mysql/my.cnf"
+ super(DebianMysql, self).setup()
+ self.add_copy_spec("/etc/mysql/conf.d/mysql*")
diff --git a/sos/plugins/named.py b/sos/plugins/named.py
index 99f950f4..8a347f8e 100644
--- a/sos/plugins/named.py
+++ b/sos/plugins/named.py
@@ -12,39 +12,74 @@
## 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 os.path import normpath, join, exists
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+import commands
-class named(Plugin, RedHatPlugin):
+class Named(Plugin):
"""named related information
"""
- files = ('/etc/named.conf', '/etc/sysconfig/named')
- packages = ('bind',)
+ plugin_name = "named"
+ named_conf = "/etc/named.conf"
+ config_files = named_conf
+
+ def setup(self):
+ for cfg in config_files:
+ if exists(cfg):
+ self.add_copy_spec(cfg)
+ self.add_copy_spec(self.get_dns_dir(cfg))
+ self.add_forbidden_path(join(self.get_dns_dir(cfg),
+ "chroot/dev"))
+ self.add_forbidden_path(join(self.get_dns_dir(cfg),
+ "chroot/proc"))
def get_dns_dir(self, config_file):
""" grab directory path from named{conf,boot}
"""
directory_list = self.do_regex_find_all("directory\s+\"(.*)\"", config_file)
- return normpath(directory_list[0])
+ if directory_list:
+ return normpath(directory_list[0])
+ else:
+ return ""
- def setup(self):
- config_files = ("/etc/named.conf",
+ def postproc(self):
+ match = r"(\s*arg \"password )[^\"]*"
+ subst = r"\1******"
+ self.do_file_sub(named_conf, match, subst)
+
+
+class RedHatNamed(Named, RedHatPlugin):
+ """named related information for RedHat based distribution
+ """
+
+ named_conf = "/etc/named.conf"
+ config_files = ("/etc/named.conf",
"/etc/named.boot")
- for cfg in config_files:
- if exists(cfg):
- self.add_copy_spec(cfg)
- self.add_copy_spec(self.get_dns_dir(cfg))
- self.add_forbidden_path(join(self.get_dns_dir(cfg),"chroot/dev"))
- self.add_forbidden_path(join(self.get_dns_dir(cfg),"chroot/proc"))
+ files = (named_conf, '/etc/sysconfig/named')
+ packages = ('bind',)
+ def setup(self):
+ super(RedHatNamed, self).setup()
self.add_copy_spec("/etc/named/")
self.add_copy_spec("/etc/sysconfig/named")
self.add_cmd_output("klist -ket /etc/named.keytab")
self.add_forbidden_path("/etc/named.keytab")
return
- def postproc(self):
- match = r"(\s*arg \"password )[^\"]*"
- subst = r"\1******"
- self.do_file_sub("/etc/named.conf", match, subst)
+
+class DebianNamed(Named, DebianPlugin, UbuntuPlugin):
+ """named related information for Debian based distribution
+ """
+
+ files = ('/etc/bind/named.conf')
+ packages = ('bind9',)
+ named_conf = "/etc/bind/named.conf"
+ config_files = (named_conf,
+ "/etc/bind/named.conf.options",
+ "/etc/bind/named.conf.local")
+
+ def setup(self):
+ super(DebianNamed, self).setup()
+ self.add_copy_spec("/etc/bind/")
+ return
+
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
index 3ff8fe7a..8e1fb295 100644
--- a/sos/plugins/networking.py
+++ b/sos/plugins/networking.py
@@ -12,14 +12,20 @@
## 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
import re
-class networking(Plugin, RedHatPlugin):
+class Networking(Plugin):
"""network related information
"""
- option_list = [("traceroute", "collects a traceroute to rhn.redhat.com", "slow", False)]
+ plugin_name = "networking"
+ trace_host = "www.example.com"
+ option_list = [("traceroute", "collects a traceroute to %s" % trace_host,
+ "slow", False)]
+
+ def setup(self):
+ super(Networking, self).setup()
def get_bridge_name(self,brctl_out):
"""Return a list for which items are bridge name according to the
@@ -69,7 +75,12 @@ class networking(Plugin, RedHatPlugin):
"/etc/xinetd.conf",
"/etc/xinetd.d",
"/etc/host*",
- "/etc/resolv.conf"])
+ "/etc/resolv.conf"
+ "/etc/network*",
+ "/etc/NetworkManager/NetworkManager.conf",
+ "/etc/NetworkManager/system-connections",
+ "/etc/dnsmasq*"])
+
ip_addr_file=self.get_cmd_output_now("ip -o addr", root_symlink = "ip_addr")
ip_addr_out=self.call_ext_prog("ip -o addr")
self.add_cmd_output("route -n", root_symlink = "route")
@@ -96,8 +107,6 @@ class networking(Plugin, RedHatPlugin):
self.add_cmd_output("ethtool -a "+eth)
self.add_cmd_output("ethtool -c "+eth)
self.add_cmd_output("ethtool -g "+eth)
- if self.get_option("traceroute"):
- self.add_cmd_output("traceroute -n rhn.redhat.com")
if os.path.exists("brctl"):
brctl_file=self.add_cmd_output("brctl show")
@@ -105,5 +114,39 @@ class networking(Plugin, RedHatPlugin):
if brctl_out:
for br_name in self.get_bridge_name(brctl_out):
self.add_cmd_output("brctl showstp "+br_name)
+
+ if self.get_option("traceroute"):
+ self.add_cmd_output("/bin/traceroute -n %s" % trace_host)
+
return
+ def postproc(self):
+ for root, dirs, files in os.walk("/etc/NetworkManager/system-connections"):
+ for net_conf in files:
+ self.do_file_sub("/etc/NetworkManager/system-connections/"+net_conf, r"psk=(.*)",r"psk=***")
+
+class RedHatNetworking(Networking, RedHatPlugin):
+ """network related information for RedHat based distribution
+ """
+ trace_host = "rhn.redhat.com"
+ def setup(self):
+ super(RedHatNetworking, self).setup()
+
+class UbuntuNetworking(Networking, UbuntuPlugin):
+ """network related information for Ubuntu based distribution
+ """
+ trace_host = "archive.ubuntu.com"
+
+ def setup(self):
+ super(UbuntuNetworking, self).setup()
+
+ self.add_copy_specs([
+ "/etc/resolvconf",
+ "/etc/ufw",
+ "/var/log/ufw.Log",
+ "/etc/resolv.conf"])
+ self.add_cmd_output("/usr/sbin/ufw status")
+ self.add_cmd_output("/usr/sbin/ufw app list")
+ if self.get_option("traceroute"):
+ self.add_cmd_output("/usr/sbin/traceroute -n %s" % trace_host)
+
diff --git a/sos/plugins/nis.py b/sos/plugins/nis.py
index 573581e8..8f98d325 100644
--- a/sos/plugins/nis.py
+++ b/sos/plugins/nis.py
@@ -15,9 +15,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 nis(Plugin, RedHatPlugin):
+class nis(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""NIS related information
"""
diff --git a/sos/plugins/ntp.py b/sos/plugins/ntp.py
index 45f428d9..dff9f985 100644
--- a/sos/plugins/ntp.py
+++ b/sos/plugins/ntp.py
@@ -12,14 +12,36 @@
## 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 ntp(Plugin, RedHatPlugin):
+class Ntp(Plugin):
"""NTP related information
"""
+ plugin_name = "ntp"
+
packages = ('ntp',)
def setup(self):
- self.add_cmd_output("ntpstat")
+ self.add_copy_spec("/etc/ntp.conf")
self.add_cmd_output("ntptime")
+
+
+class RedHatNtp(Ntp, RedHatPlugin):
+ """NTP related information for RedHat based distributions
+ """
+
+ def setup(self):
+ super(RedHatNtp, self).setup()
+ self.add_copy_spec("/etc/sysconfig/ntpd")
+ self.add_cmd_output("ntpstat")
+
+
+class DebianNtp(Ntp, DebianPlugin, UbuntuPlugin):
+ """NTP related information for Debian based distributions
+ """
+
+ def setup(self):
+ super(DebianNtp, self).setup()
+ self.add_copy_spec('/etc/default/ntp')
+
diff --git a/sos/plugins/pam.py b/sos/plugins/pam.py
index 701f0c8b..307a405b 100644
--- a/sos/plugins/pam.py
+++ b/sos/plugins/pam.py
@@ -12,12 +12,34 @@
## 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 pam(Plugin, RedHatPlugin):
+class Pam(Plugin):
"""PAM related information
"""
+
+ plugin_name = "pam"
+ security_libs = ""
+
def setup(self):
self.add_copy_spec("/etc/pam.d")
self.add_copy_spec("/etc/security")
- self.add_cmd_output("ls -lanF /lib*/security")
+ self.add_cmd_output("ls -lanF %s" % self.security_libs)
+
+class RedHatPam(Pam, RedHatPlugin):
+ """PAM related information for RedHat based distribution
+ """
+ security_libs = "/lib*/security"
+
+ def setup(self):
+ super(RedHatPam, self).setup()
+
+
+class DebianPam(Pam, DebianPlugin, UbuntuPlugin):
+ """PAM related information for Debian based distribution
+ """
+ security_libs = "/lib/x86_64-linux-gnu/security"
+
+ def setup(self):
+ super(DebianPam, self).setup()
+
diff --git a/sos/plugins/postfix.py b/sos/plugins/postfix.py
index 87857553..6f0f9b4d 100644
--- a/sos/plugins/postfix.py
+++ b/sos/plugins/postfix.py
@@ -12,18 +12,39 @@
## 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 postfix(Plugin, RedHatPlugin):
+class Postfix(Plugin):
"""mail server related information
"""
+ plugin_name = "postfix"
- files = ('/etc/rc.d/init.d/postfix',)
packages = ('postfix',)
def setup(self):
self.add_copy_specs([
- "/etc/mail",
"/etc/postfix/main.cf",
"/etc/postfix/master.cf"])
self.add_cmd_output("postconf")
+
+class RedHatPostfix(Postfix, RedHatPlugin):
+ """mail server related information for RedHat based distributions
+ """
+
+ files = ('/etc/rc.d/init.d/postfix',)
+ packages = ('postfix',)
+
+ def setup(self):
+ super(RedHatPostfix, self).setup()
+ self.add_copy_spec("/etc/mail")
+
+class DebianPostfix(Postfix, DebianPlugin, UbuntuPlugin):
+ """mail server related information for Debian based Distribution
+ """
+
+ packages = ('postfix',)
+
+ def setup(self):
+ super(DebianPostfix, self).setup()
+ self.add_copy_spec("/etc/postfix/dynamicmaps.cf")
diff --git a/sos/plugins/psacct.py b/sos/plugins/psacct.py
index 528f141c..74bd9f06 100644
--- a/sos/plugins/psacct.py
+++ b/sos/plugins/psacct.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 psacct(Plugin, RedHatPlugin):
+class Psacct(Plugin):
"""Process accounting related information
"""
@@ -23,7 +23,29 @@ class psacct(Plugin, RedHatPlugin):
packages = [ "psacct" ]
+
+class RedHatPsacct(Psacct, RedHatPlugin):
+ """Process accounting related information for RedHat based distributions
+ """
+ plugin_name = "psacct"
+
+ packages = [ "psacct" ]
+
def setup(self):
+ super(RedHatPsacct, self).setup()
self.add_copy_spec("/var/account/pacct")
if self.get_option("all"):
self.add_copy_spec("/var/account/pacct*.gz")
+
+class DebianPsacct(Psacct, DebianPlugin, UbuntuPlugin):
+ """Process accounting related information for Debian based distributions
+ """
+
+ plugin_name = "acct"
+ packages = [ "acct" ]
+
+ def setup(self):
+ super(DebianPsacct, self).setup()
+ self.add_copy_specs(["/var/log/account/pacct", "/etc/default/acct"])
+ if self.get_option("all"):
+ self.add_copy_spec("/var/log/account/pacct*.gz")
diff --git a/sos/plugins/pxe.py b/sos/plugins/pxe.py
index 08810c22..fcb1a4b7 100644
--- a/sos/plugins/pxe.py
+++ b/sos/plugins/pxe.py
@@ -12,18 +12,42 @@
## 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 pxe(Plugin, RedHatPlugin):
+class Pxe(Plugin):
"""PXE related information
"""
- option_list = [("tftpboot", 'gathers content in /tftpboot', 'slow', False)]
- files = ('pxeos',)
+ option_list = [("tftpboot", 'gathers content from the tftpboot path',
+ 'slow', False)]
+ plugin_name = "pxe"
+
+
+class RedHatPxe(Pxe, RedHatPlugin):
+ """PXE related information for RedHat based distributions
+ """
+
+ files = ('/usr/sbin/pxeos',)
packages = ('system-config-netboot-cmd',)
def setup(self):
- self.add_cmd_output("pxeos -l")
+ super(RedHatPxe, self).setup()
+ self.add_cmd_output("/usr/sbin/pxeos -l")
self.add_copy_spec("/etc/dhcpd.conf")
if self.get_option("tftpboot"):
self.add_copy_spec("/tftpboot")
+
+
+class DebianPxe(Pxe, DebianPlugin, UbuntuPlugin):
+ """PXE related information for Ubuntu based distributions
+ """
+
+ packages = ('tftpd-hpa',)
+
+ def setup(self):
+ super(DebianPxe, self).setup()
+ self.add_copy_spec("/etc/dhcp/dhcpd.conf")
+ self.add_copy_spec("/etc/default/tftpd-hpa")
+ if self.get_option("tftpboot"):
+ self.add_copy_spec("/var/lib/tftpboot")
diff --git a/sos/plugins/samba.py b/sos/plugins/samba.py
index 23f3d7b4..d4e2fe82 100644
--- a/sos/plugins/samba.py
+++ b/sos/plugins/samba.py
@@ -12,17 +12,34 @@
## 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 samba(Plugin, RedHatPlugin):
+class Samba(Plugin):
"""Samba related information
"""
+ plugin_name = "samba"
+
def setup(self):
self.add_copy_specs([
"/etc/samba",
- "/var/log/samba/*",
- "/etc/krb5.conf",
- "/etc/krb5.keytab"])
+ "/var/log/samba/*",])
self.add_cmd_output("wbinfo -g")
self.add_cmd_output("wbinfo -u")
self.add_cmd_output("testparm -s -v")
+
+
+class RedHatSamba(Samba, RedHatPlugin):
+ """Samba related information for RedHat based distributions
+ """
+ def setup(self):
+ super(RedHatSamba, self).setup()
+ # FIXME: krb5 specific
+ self.add_copy_specs([
+ "/etc/krb5.conf",
+ "/etc/krb5.keytab"])
+
+class DebianSamba(Samba, DebianPlugin, UbuntuPlugin):
+ """Samba related information for Debian based distributions
+ """
+ def setup(self):
+ super(DebianSamba, self).setup()
diff --git a/sos/plugins/sendmail.py b/sos/plugins/sendmail.py
index 61315a27..4efbf95d 100644
--- a/sos/plugins/sendmail.py
+++ b/sos/plugins/sendmail.py
@@ -14,14 +14,36 @@
## 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 sendmail(Plugin, RedHatPlugin):
+class Sendmail(Plugin):
"""sendmail information
"""
+ plugin_name = "sendmail"
+
+ packages = ('sendmail',)
+
+
+class RedHatSendmail(Sendmail, RedHatPlugin):
+ """sendmail information for RedHat based distributions
+ """
+
files = ('/etc/rc.d/init.d/sendmail',)
packages = ('sendmail',)
def setup(self):
+ super(RedHatSendmail, self).setup()
self.add_copy_specs(["/etc/mail/*", "/var/log/maillog"])
+
+class DebianSendmail(Sendmail, DebianPlugin, UbuntuPlugin):
+ """sendmail information for Debian based distributions
+ """
+
+ files = ('/etc/init.d/sendmail',)
+ packages = ('sendmail',)
+
+ def setup(self):
+ super(DebianSendmail, self).setup()
+ self.add_copy_specs(["/etc/mail/*", "/var/log/mail.*"])
diff --git a/sos/plugins/snmp.py b/sos/plugins/snmp.py
index ec438dfb..177c0e26 100644
--- a/sos/plugins/snmp.py
+++ b/sos/plugins/snmp.py
@@ -14,14 +14,33 @@
## 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 snmp(Plugin, RedHatPlugin):
+class Snmp(Plugin):
"""snmp related information
"""
+ plugin_name = "snmp"
files = ('/etc/snmp/snmpd.conf',)
- packages = ('net-snmp',)
def setup(self):
self.add_copy_spec("/etc/snmp")
+
+class RedHatSnmp(Snmp, RedHatPlugin):
+ """snmp related information for RedHat based distributions
+ """
+
+ packages = ('net-snmp',)
+
+ def setup(self):
+ super(RedHatSnmp, self).setup()
+
+class DebianSnmp(Snmp, DebianPlugin, UbuntuPlugin):
+ """snmp related information for Debian based distributions
+ """
+
+ packages = ('snmp',)
+
+ def setup(self):
+ super(DebianSnmp, self).setup()
diff --git a/sos/plugins/startup.py b/sos/plugins/startup.py
index 18326f35..76d85efe 100644
--- a/sos/plugins/startup.py
+++ b/sos/plugins/startup.py
@@ -12,17 +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 startup(Plugin, RedHatPlugin):
+class Startup(Plugin):
"""startup information
"""
+ plugin_name = "startup"
+
option_list = [("servicestatus", "get a status of all running services", "slow", False)]
def setup(self):
+ if self.get_option('servicestatus'):
+ self.add_cmd_output("/sbin/service --status-all")
+ self.add_cmd_output("/sbin/runlevel")
+
+class RedHatStartup(Startup, RedHatPlugin):
+ """startup information for RedHat based distributions
+ """
+
+ def setup(self):
+ super(RedHatStartup, self).setup()
self.add_copy_spec("/etc/rc.d")
+ self.add_cmd_output("/sbin/chkconfig --list", root_symlink = "chkconfig")
+
+class DebianStartup(Startup, DebianPlugin, UbuntuPlugin):
+ """startup information
+ """
+
+ def setup(self):
+ super(DebianStartup, self).setup()
+ self.add_copy_spec("/etc/rc*.d")
- self.add_cmd_output("chkconfig --list", root_symlink = "chkconfig")
+ self.add_cmd_output("/sbin/initctl show-config", root_symlink = "initctl")
if self.get_option('servicestatus'):
- self.add_cmd_output("service --status-all")
- self.add_cmd_output("runlevel")
+ self.add_cmd_output("/sbin/initctl list")
diff --git a/sos/policies/debian.py b/sos/policies/debian.py
index 409ba85a..b6009aa8 100644
--- a/sos/policies/debian.py
+++ b/sos/policies/debian.py
@@ -16,6 +16,10 @@ class DebianPolicy(LinuxPolicy):
def __init__(self):
super(DebianPolicy, self).__init__()
+ self.report_name = ""
+ self.ticket_number = ""
+ self.package_manager = PackageManager("dpkg-query -W -f='${Package}|${Version}\\n' \*")
+ self.valid_subclasses = [DebianPlugin]
@classmethod
def check(self):