diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2012-12-06 11:58:51 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2012-12-06 11:58:51 +0000 |
commit | ca944d706e7ca0e86cd04dd14f3fc2c320dc5b53 (patch) | |
tree | d2b6c45a7042834175fada5f4ad4e8e2a7b07239 | |
parent | 7c1b9ce4307ba7dcf0db07f9b8d824263a7a936d (diff) | |
download | sos-ca944d706e7ca0e86cd04dd14f3fc2c320dc5b53.tar.gz |
Update RHN module and add spacewalk-debug collection
Update the RHN module to match current RHEL6 where relevant and
add collection of spacewalk-debug on appropriate systems.
-rw-r--r-- | sos/plugins/rhn.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sos/plugins/rhn.py b/sos/plugins/rhn.py index 424fc1d9..27223fbf 100644 --- a/sos/plugins/rhn.py +++ b/sos/plugins/rhn.py @@ -13,6 +13,7 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. from sos.plugins import Plugin, RedHatPlugin +import os class rhn(Plugin, RedHatPlugin): """RHN Satellite related information @@ -25,17 +26,21 @@ class rhn(Plugin, RedHatPlugin): def defaultenabled(self): return False - def checkenabled(self): + def rhn_package_check(self): self.satellite = self.isInstalled("rhns-satellite-tools") \ or self.isInstalled("spacewalk-java") \ or self.isInstalled("rhn-base") self.proxy = self.isInstalled("rhns-proxy-tools") \ - or self.isInstalled("spacewalk-proxy-management") \ - or self.isInstalled("rhn-proxy-management") - + or self.isInstalled("spacewalk-proxy-management") \ + or self.isInstalled("rhn-proxy-management") return self.satellite or self.proxy + def checkenabled(self): + # enable if any related package is installed + return self.rhn_package_check() + def setup(self): + self.rhn_package_check() self.addCopySpecs([ "/etc/httpd/conf*", "/etc/rhn", @@ -65,14 +70,11 @@ class rhn(Plugin, RedHatPlugin): self.collectExtOutput("/usr/bin/rhn-charsets", root_symlink = "database-character-sets") if self.satellite: - self.addCopySpecs(["/etc/tnsnames.ora", "/etc/jabberd"]) - - self.addCopySpec("/etc/tomcat6/") - self.addCopySpec("/var/log/tomcat6/") + self.addCopySpecs(["/etc/tnsnames.ora", "/etc/jabberd", + "/etc/tomcat6/", "/var/log/tomcat6/"]) + if os.path.exists("/usr/bin/spacewalk-debug"): + self.collectExtOutput("/usr/bin/spacewalk-debug --dir %s" + % os.path.join(self.cInfo['dstroot'], "sos_commands/rhn")) if self.proxy: self.addCopySpecs(["/etc/squid", "/var/log/squid"]) - -# def diagnose(self): - # RHN Proxy: - # * /etc/g/rhn/systemid is owned by root.apache with the permissions 0640 |