diff options
author | Louis Bouchard <louis.bouchard@canonical.com> | 2013-04-23 15:06:49 +0200 |
---|---|---|
committer | Louis Bouchard <louis.bouchard@canonical.com> | 2013-04-23 15:28:44 +0200 |
commit | ee7f5229a07f1f506b3cf2cc82e1854cec5aba74 (patch) | |
tree | 15c44d5010a754c25e8a68ab437f3ba7fdb59a7b | |
parent | 8856596a68fc75ce36cb46b084b05097a4d6f5ff (diff) | |
download | sos-ee7f5229a07f1f506b3cf2cc82e1854cec5aba74.tar.gz |
ldap.py : improved data collection on Ubuntu/Debian
-rw-r--r-- | sos/plugins/ldap.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sos/plugins/ldap.py b/sos/plugins/ldap.py index 3fce4278..b16b7b30 100644 --- a/sos/plugins/ldap.py +++ b/sos/plugins/ldap.py @@ -36,6 +36,10 @@ class Ldap(Plugin): def setup(self): super(Ldap, self).setup() + self.add_copy_spec("/etc/ldap.conf") + + def postproc(self): + self.do_file_sub("/etc/ldap.conf", r"(\s*bindpw\s*)\S+", r"\1***") class RedHatLdap(Ldap, RedHatPlugin): """LDAP related information for RedHat based distribution @@ -45,10 +49,9 @@ class RedHatLdap(Ldap, RedHatPlugin): def setup(self): super(RedHatLdap, self).setup() - self.add_copy_specs(["/etc/ldap.conf", "/etc/openldap", "/etc/nslcd.conf"]) + self.add_copy_specs(["/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): @@ -61,6 +64,19 @@ class DebianLdap(Ldap, DebianPlugin, UbuntuPlugin): def setup(self): super(DebianLdap, self).setup() - def setup(self): - self.add_copy_specs(["/etc/ldap/ldap.conf", "/etc/ldap/slapd.d"]) + ldap_search = "ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// " + + self.add_copy_specs(["/etc/ldap/ldap.conf", "/etc/slapd.conf", "/etc/ldap/slapd.d"]) + self.add_cmd_output("ldapsearch -x -b '' -s base 'objectclass=*'") + self.add_cmd_output(ldap_search + "-b cn=config '(!(objectClass=olcSchemaConfig))'", + suggest_filename="configuration_minus_schemas") + self.add_cmd_output(ldap_search + "-b cn=schema,cn=config dn", + suggest_filename="loaded_schemas") + self.add_cmd_output(ldap_search + "-b cn=config '(olcAccess=*)' olcAccess olcSuffix", + suggest_filename="access_control_lists") + + def postproc(self): + self.do_cmd_output_sub( + "ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config '(!(objectClass=olcSchemaConfig))'", + r"(olcRootPW\: \s*)\S+", r"\1***") |