diff options
author | astokes_rhn <astokes_rhn@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-08-03 17:47:07 +0000 |
---|---|---|
committer | astokes_rhn <astokes_rhn@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2007-08-03 17:47:07 +0000 |
commit | 7e2ecbcc5a7ecb8ae3a2b91331fe6521c90d4dce (patch) | |
tree | f8d5704e00e785f38c7b429cebe1ea8b4f90f7df | |
parent | efd3bf11141bdcdc43a0bd7d9855ee969d86ebc5 (diff) | |
download | sos-7e2ecbcc5a7ecb8ae3a2b91331fe6521c90d4dce.tar.gz |
merging stokes-branch to trunk, autofs,libraries,networking,nfsserver,ldap plugins updated
typo's fixed in kernel plugin
fix indentation problems in initrd plugin
utilize filegrep functions for most of my file queries
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@333 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rw-r--r-- | src/lib/sos/plugins/autofs.py | 2 | ||||
-rw-r--r-- | src/lib/sos/plugins/general.py | 1 | ||||
-rw-r--r-- | src/lib/sos/plugins/initrd.py | 4 | ||||
-rw-r--r-- | src/lib/sos/plugins/kernel.py | 2 | ||||
-rw-r--r-- | src/lib/sos/plugins/ldap.py | 24 | ||||
-rw-r--r-- | src/lib/sos/plugins/libraries.py | 2 | ||||
-rw-r--r-- | src/lib/sos/plugins/networking.py | 10 | ||||
-rw-r--r-- | src/lib/sos/plugins/nfsserver.py | 5 | ||||
-rw-r--r-- | src/lib/sos/plugins/startup.py | 1 | ||||
-rwxr-xr-x | src/lib/sos/policyredhat.py | 7 |
10 files changed, 39 insertions, 19 deletions
diff --git a/src/lib/sos/plugins/autofs.py b/src/lib/sos/plugins/autofs.py index 48dd57b4..cbf3b299 100644 --- a/src/lib/sos/plugins/autofs.py +++ b/src/lib/sos/plugins/autofs.py @@ -15,7 +15,7 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import sos.plugintools -import os, re +import os class autofs(sos.plugintools.PluginBase): """autofs server-related information diff --git a/src/lib/sos/plugins/general.py b/src/lib/sos/plugins/general.py index 2e142013..44d9da05 100644 --- a/src/lib/sos/plugins/general.py +++ b/src/lib/sos/plugins/general.py @@ -33,7 +33,6 @@ class general(sos.plugintools.PluginBase): self.addCopySpecLimit("/var/log/secure.*", sizelimit = self.isOptionEnabled("syslogsize")) self.addCopySpec("/var/log/sa") self.addCopySpec("/var/log/up2date") - self.addCopySpec("/etc/exports") self.collectExtOutput("/bin/hostname", root_symlink = "hostname") self.collectExtOutput("/bin/date", root_symlink = "date") self.collectExtOutput("/usr/bin/uptime", root_symlink = "uptime") diff --git a/src/lib/sos/plugins/initrd.py b/src/lib/sos/plugins/initrd.py index 83356548..7bd7e1f3 100644 --- a/src/lib/sos/plugins/initrd.py +++ b/src/lib/sos/plugins/initrd.py @@ -20,9 +20,9 @@ class initrd(sos.plugintools.PluginBase): """ def setup(self): for initrd in glob.glob('/boot/initrd-*.img'): - self.collectExtOutput("/bin/zcat "+initrd+" | /bin/cpio "+ + self.collectExtOutput("/bin/zcat "+initrd+" | /bin/cpio "+ "--extract --to-stdout init" ) return def defaultenabled(self): - return False + return False diff --git a/src/lib/sos/plugins/kernel.py b/src/lib/sos/plugins/kernel.py index 8ca53b66..3640f3fa 100644 --- a/src/lib/sos/plugins/kernel.py +++ b/src/lib/sos/plugins/kernel.py @@ -28,7 +28,7 @@ class kernel(sos.plugintools.PluginBase): {'regex':'vxportal*', 'description':'Veritas module'}, {'regex':'vxdmp*', 'description':'Veritas dynamic multipathing module'}, {'regex':'vxio*', 'description':'Veritas module'}, - {'regex':'vxspec*"', 'description':'Veritas module'}, + {'regex':'vxspec*', 'description':'Veritas module'}, {'regex':'dcd*', 'description':'Dell OpenManage Server Administrator module'}, {'regex':'ocfs', 'description':'Oracle cluster filesystem module'}, {'regex':'oracle*', 'description':'Oracle module'}, diff --git a/src/lib/sos/plugins/ldap.py b/src/lib/sos/plugins/ldap.py index 318a3ba9..ee50acde 100644 --- a/src/lib/sos/plugins/ldap.py +++ b/src/lib/sos/plugins/ldap.py @@ -13,10 +13,34 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import sos.plugintools +import os class ldap(sos.plugintools.PluginBase): """LDAP related information """ + def get_ldap_opts(self): + # capture /etc/openldap/ldap.conf options in dict + # FIXME: possibly not hardcode these options in? + ldapopts=["URI","BASE","TLS_CACERTDIR"] + results={} + tmplist=[] + for i in ldapopts: + t=fileGrep(r"^%s*" % i,"/etc/openldap/ldap.conf") + for x in t: + tmplist.append(x.split(" ")) + for i in tmplist: + results[i[0]]=i[1].rstrip("\n") + return results + + def diagnose(self): + # Validate ldap client options + ldapopts=self.get_ldap_opts() + try: + os.stat(ldapopts["TLS_CACERTDIR"]) + except: + self.addDiagnose("%s does not exist and can cause connection issues "+ + "involving TLS" % ldapopts["TLS_CACERTDIR"]) + def setup(self): self.addCopySpec("/etc/ldap.conf") self.addCopySpec("/etc/openldap") diff --git a/src/lib/sos/plugins/libraries.py b/src/lib/sos/plugins/libraries.py index 70b63dba..80108869 100644 --- a/src/lib/sos/plugins/libraries.py +++ b/src/lib/sos/plugins/libraries.py @@ -20,5 +20,7 @@ class libraries(sos.plugintools.PluginBase): def setup(self): self.addCopySpec("/etc/ld.so.conf") self.addCopySpec("/etc/ld.so.conf.d") + self.collectExtOutput("/sbin/ldconfig -v") + self.collectExtOutput("/sbin/ldconfig -p") return diff --git a/src/lib/sos/plugins/networking.py b/src/lib/sos/plugins/networking.py index 080ae694..e578f830 100644 --- a/src/lib/sos/plugins/networking.py +++ b/src/lib/sos/plugins/networking.py @@ -25,13 +25,9 @@ class networking(sos.plugintools.PluginBase): output of ifconifg-a stored in ifconfigFile. """ out={} - if(os.path.isfile(ifconfigFile)): - f=open(ifconfigFile,'r') - content=f.read() - f.close() - reg=re.compile(r"^(eth\d+)\D",re.MULTILINE) - for name in reg.findall(content): - out[name]=1 + reg=self.fileGrep(r"^(eth\d+)\D", ifconfigFile) + for name in reg: + out[name]=1 return out def collectIPTable(self,tablename): diff --git a/src/lib/sos/plugins/nfsserver.py b/src/lib/sos/plugins/nfsserver.py index 9564aa22..1e352032 100644 --- a/src/lib/sos/plugins/nfsserver.py +++ b/src/lib/sos/plugins/nfsserver.py @@ -35,7 +35,10 @@ class nfsserver(sos.plugintools.PluginBase): def setup(self): self.addCopySpec("/etc/exports") + self.addCopySpec("/var/lib/nfs/etab") + self.addCopySpec("/var/lib/nfs/xtab") + self.addCopySpec("/var/lib/nfs/rmtab") self.collectExtOutput("/usr/sbin/rpcinfo -p localhost") - self.collectExtOutput("/usr/sbin/nfsstat") + self.collectExtOutput("/usr/sbin/nfsstat -a") return diff --git a/src/lib/sos/plugins/startup.py b/src/lib/sos/plugins/startup.py index 59014aaa..a0d3e400 100644 --- a/src/lib/sos/plugins/startup.py +++ b/src/lib/sos/plugins/startup.py @@ -19,7 +19,6 @@ class startup(sos.plugintools.PluginBase): """ def setup(self): self.addCopySpec("/etc/rc.d") - self.collectExtOutput("/sbin/chkconfig --list", root_symlink = "chkconfig") self.collectExtOutput("/sbin/runlevel") return diff --git a/src/lib/sos/policyredhat.py b/src/lib/sos/policyredhat.py index 6aae9321..aed36434 100755 --- a/src/lib/sos/policyredhat.py +++ b/src/lib/sos/policyredhat.py @@ -96,11 +96,8 @@ class SosPolicy: def runlevelDefault(self): try: - f=open("/etc/inittab",'r') - content=f.read() - f.close() - reg=re.compile(r"^id:(\d{1}):initdefault:\D",re.MULTILINE) - for initlevel in reg.findall(content): + reg=self.fileGrep(r"^id:(\d{1}):initdefault:", "/etc/inittab") + for initlevel in reg: return initlevel except: return 3 |