RFE to update sos to capture RHC information, as RHC is increasingly becoming more important to the RH ecosystem. I believe it would be better to create a `rhc` plugin based on the presence of the `rhc` package, but perhaps it would fit better in an already existing plugin. Files to include; /etc/rhc/config.toml all files inside /etc/rhc/workers/ but specifically ../foreman_rh_cloud.toml and ../rhc-package-manager.toml - for this if we want to avoid a catch-all we could perhaps capture any *.toml in this dir and that should help capture future additions here sos already captures /etc/systemd/system/rhcd.service/ as part of the systemd plugin and it would be good to ensure this is maintained Thanks!
to note; there are no log files associated with this capturing rhsm.log and syslog should be sufficient as rhc works currently and those are already consistently captured.
(In reply to Paul Dudley from comment #2) > to note; there are no log files associated with this capturing rhsm.log and > syslog should be sufficient as rhc works currently and those are already > consistently captured. I assume a new rhc plugin is the best fit here (to collect the rhc data only when (on RHEL distro and) rhc is installed). Then rhsm.log or syslogs or rhc.service stuff won't be captured by rhc plugin itself, but by the corresponding plugins "only" - until one disables those plugins explicitly, the data will be present in sosreport.
I'm working on this now. Would it be useful to have the output of 'rhc status' as well?
Hi Jose, This would be a good addition as well, thank you
OK, done - this is the result of the new plugin in a RHEL 8 machine where I tested it: [root@localhost sosreport-localhost-2023-05-10-iiboqfh]# ls etc sos_commands sos_logs sos_reports version.txt [root@localhost sosreport-localhost-2023-05-10-iiboqfh]# ls etc/ rhc [root@localhost sosreport-localhost-2023-05-10-iiboqfh]# ls etc/rhc/ config.toml workers [root@localhost sosreport-localhost-2023-05-10-iiboqfh]# ls etc/rhc/workers/ rhc-package-manager.toml [root@localhost sosreport-localhost-2023-05-10-iiboqfh]# ls sos_commands/rhc/ rhc_status [root@localhost sosreport-localhost-2023-05-10-iiboqfh]# cat sos_commands/rhc/rhc_status Connection status for localhost.localdomain: ● Connected to Red Hat Subscription Management ● Not connected to Red Hat Insights ● The Red Hat connector daemon is inactive Manage your Red Hat connector systems: https://red.ht/connector I'll send the PR upstream soon and will add the link here.
PR attached. Is there any password or secret we should mask in the files that live inside /etc/rhc/? I couldn't find any information in the documentation, but I may have missed something.
There should be no direct user passwords here but inside `workers/foreman_rh_cloud.toml` there is a `FORWARDER_PASSWORD` that should be obfuscated. At the moment I am not aware of any other files that would be created here with passwords to obfuscate. That file will be specific to Satellite instances and not for the typical rhc setup. Thanks Paul
Switch to Tested based on positive manual test: [root@ci-vm-10-0-137-222 sosreport-ci-vm-10-0-137-222-2023-06-15-isdmetr]# ls etc sos_commands sos_logs sos_reports version.txt [root@ci-vm-10-0-137-222 sosreport-ci-vm-10-0-137-222-2023-06-15-isdmetr]# ls etc/rhc config.toml workers [root@ci-vm-10-0-137-222 sosreport-ci-vm-10-0-137-222-2023-06-15-isdmetr]# ls etc/rhc/workers/ foreman_rh_cloud.toml rhc-package-manager.toml [root@ci-vm-10-0-137-222 sosreport-ci-vm-10-0-137-222-2023-06-15-isdmetr]# less etc/rhc/workers/foreman_rh_cloud.toml exec = "/usr/libexec/yggdrasil-worker-forwarder" protocol = "grpc" env = [ "FORWARDER_USER={{ foreman_cloud_connector_user }}", "FORWARDER_PASSWORD=********", "FORWARDER_URL={{ foreman_cloud_connector_url }}/api/v2/rh_cloud/cloud_request", "FORWARDER_HANDLER=foreman_rh_cloud" ] mocked from https://github.com/theforeman/foreman-operations-collection/blob/develop/roles/cloud_connector/templates/foreman_rh_cloud.toml.j2
Switch to Tested based on positive manual test: OLD rhel: RHEL-8.9 sos: sos-4.5.3-1.el8.noarch arch: x86_64 [root@ci-vm-10-0-138-224 sosreport-ci-vm-10-0-138-224-2023-06-16-shpthtd]# sos report -o rhc sosreport (version 4.5.3) a non-existing plugin (rhc) was specified in the command line. ``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````` NEW rhel: RHEL-8.9 sos: sos-4.5.4-1.el8.noarch arch: x86_64 [root@ci-vm-10-0-138-224 sosreport-ci-vm-10-0-138-224-2023-06-16-shpthtd]# ls etc sos_commands sos_logs sos_reports version.txt [root@ci-vm-10-0-138-224 sosreport-ci-vm-10-0-138-224-2023-06-16-shpthtd]# ls etc/rhc/ config.toml workers [root@ci-vm-10-0-138-224 sosreport-ci-vm-10-0-138-224-2023-06-16-shpthtd]# ls etc/rhc/workers/ foreman_rh_cloud.toml rhc-package-manager.toml [root@ci-vm-10-0-138-224 sosreport-ci-vm-10-0-138-224-2023-06-16-shpthtd]# less etc/rhc/workers/foreman_rh_cloud.toml exec = "/usr/libexec/yggdrasil-worker-forwarder" protocol = "grpc" env = [ "FORWARDER_USER={{ foreman_cloud_connector_user }}", "FORWARDER_PASSWORD=********", "FORWARDER_URL={{ foreman_cloud_connector_url }}/api/v2/rh_cloud/cloud_request", "FORWARDER_HANDLER=foreman_rh_cloud" ] mocked from https://github.com/theforeman/foreman-operations-collection/blob/develop/roles/cloud_connector/templates/foreman_rh_cloud.toml.j2
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (sos bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:3801