diff options
author | Adam Stokes <hackr@cypherbook.com> | 2012-03-09 15:46:20 -0500 |
---|---|---|
committer | Adam Stokes <hackr@cypherbook.com> | 2012-03-09 15:52:20 -0500 |
commit | 1d3c2fa95ad75d87c412b07f43143f35f8138687 (patch) | |
tree | d36e94072e81139575824587e1dd665374b27beb | |
parent | 87f0789fe6cdccb269d07b44d2f786c1fb34e3ea (diff) | |
download | sos-1d3c2fa95ad75d87c412b07f43143f35f8138687.tar.gz |
sos/plugins: More cross distribution plugin enhancements
Signed-off-by: Adam Stokes <hackr@cypherbook.com>
-rw-r--r-- | sos/plugins/crontab.py | 8 | ||||
-rw-r--r-- | sos/plugins/i18n.py | 7 | ||||
-rw-r--r-- | sos/plugins/ipsec.py | 24 | ||||
-rw-r--r-- | sos/plugins/iscsi.py | 25 | ||||
-rw-r--r-- | sos/plugins/memory.py | 4 | ||||
-rw-r--r-- | sos/plugins/nscd.py | 5 | ||||
-rw-r--r-- | sos/plugins/openssl.py | 23 | ||||
-rw-r--r-- | sos/plugins/radius.py | 26 | ||||
-rw-r--r-- | sos/plugins/sssd.py | 21 | ||||
-rw-r--r-- | sos/plugins/x11.py | 5 |
10 files changed, 118 insertions, 30 deletions
diff --git a/sos/plugins/crontab.py b/sos/plugins/crontab.py index ae0a55d3..3df0a688 100644 --- a/sos/plugins/crontab.py +++ b/sos/plugins/crontab.py @@ -12,12 +12,14 @@ ## 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 -import os +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class crontab(Plugin, RedHatPlugin): +class crontab(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """Crontab information """ + + plugin_name = "crontab" + def setup(self): self.addCopySpec("/etc/cron*") self.collectExtOutput("/usr/bin/crontab -l -u root", suggest_filename = "root_crontab") diff --git a/sos/plugins/i18n.py b/sos/plugins/i18n.py index 2640f32d..fb87f98c 100644 --- a/sos/plugins/i18n.py +++ b/sos/plugins/i18n.py @@ -12,12 +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 -import os +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class i18n(Plugin, RedHatPlugin): +class i18n(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """i18n related information """ def setup(self): self.addCopySpec("/etc/X11/xinit/xinput.d/*") - self.collectExtOutput("/usr/bin/locale") + self.collectExtOutput("/usr/bin/locale") diff --git a/sos/plugins/ipsec.py b/sos/plugins/ipsec.py index 994b8f1b..67923801 100644 --- a/sos/plugins/ipsec.py +++ b/sos/plugins/ipsec.py @@ -14,15 +14,31 @@ ## 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 exists +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class ipsec(Plugin, RedHatPlugin): +class ipsec(Plugin): """ipsec related information """ - files = ('/etc/racoon/racoon.conf',) + plugin_name = "ipsec" packages = ('ipsec-tools',) +class RedHatIpsec(ipsec, RedHatPlugin): + """ipsec related information for Red Hat distributions + """ + + files = ('/etc/racoon/racoon.conf',) + def setup(self): self.addCopySpec("/etc/racoon") + +class DebianIpsec(ipsec, DebianPlugin, UbuntuPlugin): + """ipsec related information for Debian distributions + """ + + files = ('/etc/ipsec-tools.conf',) + + def setup(self): + self.addCopySpecs(["/etc/ipsec-tools.conf", + "/etc/ipsec-tools.d", + "/etc/default/setkey"]) diff --git a/sos/plugins/iscsi.py b/sos/plugins/iscsi.py index 56c5149b..08e82db4 100644 --- a/sos/plugins/iscsi.py +++ b/sos/plugins/iscsi.py @@ -12,13 +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 iscsi(Plugin, RedHatPlugin): +class iscsi(Plugin): """iscsi-initiator related information """ + + plugin_name = "iscsi" + +class RedHatIscsi(iscsi, RedHatPlugin): + """iscsi-initiator related information Red Hat based distributions + """ def setup(self): + super(RedHatIscsi, self).setup() self.addCopySpecs([ "/etc/iscsi/iscsid.conf", "/etc/iscsi/initiatorname.iscsi", "/var/lib/iscsi"]) + +class DebianIscsi(iscsi, DebianPlugin, UbuntuPlugin): + """iscsi-initiator related information Debian based distributions + """ + + packages = ('iscsitarget',) + + def setup(self): + super(DebianIscsi, self).setup() + self.addCopySpecs([ + "/etc/iet", + "/etc/sysctl.d/30-iscsitarget.conf", + "/etc/default/iscsitarget" + ]) diff --git a/sos/plugins/memory.py b/sos/plugins/memory.py index 3ee8ef7e..8bb837fd 100644 --- a/sos/plugins/memory.py +++ b/sos/plugins/memory.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 memory(Plugin, RedHatPlugin): +class memory(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """memory usage information """ def setup(self): diff --git a/sos/plugins/nscd.py b/sos/plugins/nscd.py index 26ec3afc..5c98e864 100644 --- a/sos/plugins/nscd.py +++ b/sos/plugins/nscd.py @@ -14,10 +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 os.path import exists +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class nscd(Plugin, RedHatPlugin): +class nscd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """NSCD related information """ diff --git a/sos/plugins/openssl.py b/sos/plugins/openssl.py index 07f8a35b..9bf3e574 100644 --- a/sos/plugins/openssl.py +++ b/sos/plugins/openssl.py @@ -14,14 +14,31 @@ ## 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 openssl(Plugin, RedHatPlugin): +class openssl(Plugin): """openssl related information """ - files = ('/etc/pki/tls/openssl.cnf',) + plugin_name = "openssl" packages = ('openssl',) +class RedHatOpenssl(openssl, RedHatPlugin): + """openssl related information for Red Hat distributions + """ + + files = ('/etc/pki/tls/openssl.cnf',) + def setup(self): + super(RedHatOpenssl, self).setup() self.addCopySpec("/etc/pki/tls/openssl.cnf") + +class DebianOpenssl(openssl, DebianPlugin, UbuntuPlugin): + """openssl related information for Debian distributions + """ + + files = ('/etc/ssl/openssl.cnf',) + + def setup(self): + super(DebianOpenssl, self).setup() + self.addCopySpec("/etc/ssl/openssl.cnf") diff --git a/sos/plugins/radius.py b/sos/plugins/radius.py index 32980626..df1442b1 100644 --- a/sos/plugins/radius.py +++ b/sos/plugins/radius.py @@ -14,18 +14,38 @@ ## 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 radius(Plugin, RedHatPlugin): +class radius(Plugin): """radius related information """ - files = ('/etc/raddb',) + plugin_name = "radius" packages = ('freeradius',) +class RedHatRadius(radius, RedHatPlugin): + """radius related information on Red Hat distributions + """ + + files = ('/etc/raddb',) + def setup(self): + super(RedHatRadius, self).setup() self.addCopySpecs(["/etc/raddb", "/etc/pam.d/radiusd", "/var/log/radius"]) def postproc(self): self.doRegexSub("/etc/raddb/sql.conf", r"(\s*password\s*=\s*)\S+", r"\1***") + +class DebianRadius(radius, DebianPlugin, UbuntuPlugin): + """radius related information on Debian distributions + """ + + files = ('/etc/freeradius',) + + def setup(self): + super(DebianRadius, self).setup() + self.addCopySpecs(["/etc/freeradius", + "/etc/pam.d/radiusd", + "/etc/default/freeradius", + "/var/log/freeradius"]) diff --git a/sos/plugins/sssd.py b/sos/plugins/sssd.py index 8e6e4edf..a1ffe998 100644 --- a/sos/plugins/sssd.py +++ b/sos/plugins/sssd.py @@ -14,14 +14,29 @@ ## 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 -import os +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class sssd(Plugin, RedHatPlugin): +class sssd(Plugin): """sssd-related Diagnostic Information """ + plugin_name = "sssd" packages = ('sssd',) def setup(self): self.addCopySpecs(["/etc/sssd", "/var/log/sssd/*"]) + +class RedHatSssd(sssd, RedHatPlugin): + """sssd-related Diagnostic Information on Red Hat based distributions + """ + + def setup(self): + super(RedHatSssd, self).setup() + +class DebianSssd(sssd, DebianPlugin, RedHatPlugin): + """sssd-related Diagnostic Information on Debian based distributions + """ + + def setup(self): + super(DebianSssd, self).setup() + self.addCopySpecs(["/etc/default/sssd"]) diff --git a/sos/plugins/x11.py b/sos/plugins/x11.py index 22c77617..a760e6bc 100644 --- a/sos/plugins/x11.py +++ b/sos/plugins/x11.py @@ -12,10 +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 os.path import exists +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin -class x11(Plugin, RedHatPlugin): +class x11(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): """X related information """ |