|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/22697/task/22697/root/usr/lib/python2.4/site-packages/sos/plugins/ |
Upload File : |
## Copyright (C) 2007-2010 Red Hat, Inc., Kent Lamb <klamb@redhat.com>
## Marc Sauton <msauton@redhat.com>
## Pierre Carrier <pcarrier@redhat.com>
## Bryn M. Reeves <bmr@redhat.com>
### This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#############################################################
# This plugin assumes default location of Certificate System 7.x on RHEL4
# Certificate System 7.x is not supported on RHEL5.
# Any improvemts for this plugin are appreciated. Please send them to
# klamb@redhat.com
# thanks,
# kent lamb
#############################################################
import sos.plugintools
import os
import glob
class cs(sos.plugintools.PluginBase):
"""Certificate System 7.x Diagnostic Information
"""
# check for default location of pki services (/var/lib.rhpki-*).
# If default path exists, assume rhpki- glob and grap all installed
# subsystems. If customer has a custom install path, then ln -s the
# custom path to /var/lib/rhkpi-installed_subsystem (/var/lib/rhpki-ca,
# /var/lib/rhpki-kra ect).
def checkversion(self):
if self.cInfo["policy"].pkgByName("redhat-cs") or os.path.exists("/opt/redhat-cs"):
return 71
elif self.cInfo["policy"].pkgByName("rhpki-common") or len(glob.glob("/var/lib/rhpki-*")):
return 73
# 8 should cover dogtag
elif self.cInfo["policy"].pkgByName("pki-common") or os.path.exists("/usr/share/java/pki"):
return 8
return False
def checkenabled(self):
pkgList = [ "redhat-cs", "rhpki-common", "pki-common" ]
for pkgName in pkgList:
if self.cInfo["policy"].pkgByName(pkgName):
return True
pathList = [ "/opt/redhat-cs", "/usr/share/java/rhpki", "/usr/share/java/pki" ]
for pathName in pathList:
if os.path.exists(pathName):
return True
return False
def setup(self):
csversion = self.checkversion()
if not csversion:
self.addAlert("Red Hat Certificate System not found.")
return
if csversion == 71:
self.addCopySpec("/opt/redhat-cs/slapd-*/logs/access")
self.addCopySpec("/opt/redhat-cs/slapd-*/logs/errors")
self.addCopySpec("/opt/redhat-cs/slapd-*/config/dse.ldif")
self.addCopySpec("/opt/redhat-cs/cert-*/errors")
self.addCopySpec("/opt/redhat-cs/cert-*/config/CS.cfg")
self.addCopySpec("/opt/redhat-cs/cert-*/access")
self.addCopySpec("/opt/redhat-cs/cert-*/errors")
self.addCopySpec("/opt/redhat-cs/cert-*/system")
self.addCopySpec("/opt/redhat-cs/cert-*/transactions")
self.addCopySpec("/opt/redhat-cs/cert-*/debug")
self.addCopySpec("/opt/redhat-cs/cert-*/tps-debug.log")
if csversion == 73:
self.addCopySpec("/var/lib/rhpki-*/conf/*cfg*")
self.addCopySpec("/var/lib/rhpki-*/conf/*.ldif")
self.addCopySpec("/var/lib/rhpki-*/logs/debug")
self.addCopySpec("/var/lib/rhpki-*/logs/catalina.*")
self.addCopySpec("/var/lib/rhpki-*/logs/ra-debug.log")
self.addCopySpec("/var/lib/rhpki-*/logs/transactions")
self.addCopySpec("/var/lib/rhpki-*/logs/system")
if csversion in (73, 8):
self.addCopySpec("/etc/dirsrv/slapd-*/dse.ldif")
self.addCopySpec("/var/log/dirsrv/slapd-*/access")
self.addCopySpec("/var/log/dirsrv/slapd-*/errors")
if csversion == 8:
self.addCopySpec("/etc/pki-*/CS.cfg")
self.addCopySpec("/var/lib/pki-*/conf/*cfg*")
self.addCopySpec("/var/log/pki-*/debug")
self.addCopySpec("/var/log/pki-*/catalina.*")
self.addCopySpec("/var/log/pki-*/ra-debug.log")
self.addCopySpec("/var/log/pki-*/transactions")
self.addCopySpec("/var/log/pki-*/system")
return