diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2019-10-31 08:29:01 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-11-13 16:03:05 +0000 |
commit | 80f9bd092012fc5522bf811e5fa9df9399b0b23e (patch) | |
tree | 93717336d9278269bfab0b81ee8822c816ddacb2 | |
parent | f36200d8d6c4d5f07e58338df4dccfee71ae507b (diff) | |
download | sos-80f9bd092012fc5522bf811e5fa9df9399b0b23e.tar.gz |
[foreman,katello] move relicts of katello plugin to foreman
Katello plugin does not further collect any katello-related data.
qpid-stat was moved to pulp, (foreman) table sizes to foreman and
/var/log/httpd/katello-reverse-proxy* belong to foreman-proxy.
Move the latest bit to foreman and drop katello plugin.
Resolves: #1843
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r-- | sos/plugins/foreman.py | 4 | ||||
-rw-r--r-- | sos/plugins/katello.py | 66 |
2 files changed, 4 insertions, 66 deletions
diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py index e7b71f72..c8ed2850 100644 --- a/sos/plugins/foreman.py +++ b/sos/plugins/foreman.py @@ -114,6 +114,10 @@ class Foreman(Plugin): "/etc/puppetlabs/puppet/ssl/certs/{}.pem".format(_hostname), "/var/lib/puppet/ssl/certs/{}.pem".format(_hostname), "/var/log/{}*/foreman-ssl_*_ssl*log[.-]*".format(self.apachepkg), + "/var/log/{}*/katello-reverse-proxy_access_ssl.log*".format( + self.apachepkg), + "/var/log/{}*/katello-reverse-proxy_error_ssl.log*".format( + self.apachepkg), "/var/log/{}*/error_log*".format(self.apachepkg), "/etc/{}*/conf/".format(self.apachepkg), "/etc/{}*/conf.d/".format(self.apachepkg) diff --git a/sos/plugins/katello.py b/sos/plugins/katello.py deleted file mode 100644 index 873e06b9..00000000 --- a/sos/plugins/katello.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (C) 2018 Red Hat, Inc., Jake Hunsaker <jhunsake@redhat.com> - -# This file is part of the sos project: https://github.com/sosreport/sos -# -# This copyrighted material is made available to anyone wishing to use, -# modify, copy, or redistribute it subject to the terms and conditions of -# version 2 of the GNU General Public License. -# -# See the LICENSE file in the source distribution for further information. - -from sos.plugins import Plugin, RedHatPlugin -from pipes import quote - - -class Katello(Plugin, RedHatPlugin): - """Katello application life-cycle management""" - - plugin_name = 'katello' - packages = ('katello',) - - def setup(self): - self.add_copy_spec([ - "/var/log/httpd/katello-reverse-proxy_access_ssl.log*", - "/var/log/httpd/katello-reverse-proxy_error_ssl.log*" - ]) - - # certificate file location relies on katello version, it can be either - # /etc/pki/katello/qpid_client_striped.crt (for older versions) or - # /etc/pki/pulp/qpid/client.crt (for newer versions) - cert = "/etc/pki/pulp/qpid/client.crt" - if not os.path.isfile(cert): - cert = "/etc/pki/katello/qpid_client_striped.crt" - self.add_cmd_output([ - "qpid-stat -%s --ssl-certificate=%s -b amqps://localhost:5671" % - (opt, cert) for opt in "quc" - ]) - - kat_db = self.build_query_cmd( - "select id,name,checksum_type,updated_at from katello_repositories" - ) - self.add_cmd_output(kat_db, suggest_filename="katello_repositories") - - db_size = self.build_query_cmd( - "SELECT table_name, pg_size_pretty(total_bytes) AS total, " - "pg_size_pretty(index_bytes) AS INDEX , " - "pg_size_pretty(toast_bytes) AS toast, pg_size_pretty(table_bytes)" - " AS TABLE FROM ( SELECT *, " - "total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes " - "FROM (SELECT c.oid,nspname AS table_schema, relname AS " - "TABLE_NAME, c.reltuples AS row_estimate, " - "pg_total_relation_size(c.oid) AS total_bytes, " - "pg_indexes_size(c.oid) AS index_bytes, " - "pg_total_relation_size(reltoastrelid) AS toast_bytes " - "FROM pg_class c LEFT JOIN pg_namespace n ON " - "n.oid = c.relnamespace WHERE relkind = 'r') a) a order by " - "total_bytes DESC" - ) - self.add_cmd_output(db_size, suggest_filename="db_table_size") - - def build_query_cmd(self, query): - _cmd = "su postgres -c %s" - _dbcmd = "psql foreman -c %s" - dbq = _dbcmd % quote(query) - return _cmd % quote(dbq) - -# vim: set et ts=4 sw=4 : |