RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2196649 - [RFE] enhance sos to capture rhc configuration information
Summary: [RFE] enhance sos to capture rhc configuration information
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sos
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Pavel Moravec
QA Contact: Daniel Záležák
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-09 17:45 UTC by Paul Dudley
Modified: 2023-06-26 13:56 UTC (History)
8 users (show)

Fixed In Version: sos-4.5.4-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-26 13:55:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github sosreport sos pull 3228 0 None open [rhc] New plugin for RHC 2023-05-10 17:33:30 UTC
Red Hat Issue Tracker RHELPLAN-156812 0 None None None 2023-05-09 17:46:32 UTC

Description Paul Dudley 2023-05-09 17:45:39 UTC
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!

Comment 2 Paul Dudley 2023-05-09 17:46:47 UTC
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.

Comment 3 Pavel Moravec 2023-05-10 07:03:00 UTC
(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.

Comment 4 Jose Castillo 2023-05-10 11:54:24 UTC
I'm working on this now. 
Would it be useful to have the output of 'rhc status' as well?

Comment 5 Paul Dudley 2023-05-10 12:39:52 UTC
Hi Jose,

This would be a good addition as well, thank you

Comment 6 Jose Castillo 2023-05-10 13:25:20 UTC
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.

Comment 7 Jose Castillo 2023-05-10 18:26:33 UTC
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.

Comment 8 Paul Dudley 2023-05-10 21:09:28 UTC
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

Comment 10 Daniel Záležák 2023-06-15 09:47:00 UTC
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

Comment 13 Daniel Záležák 2023-06-16 08:22:12 UTC
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

Comment 16 errata-xmlrpc 2023-06-26 13:55:53 UTC
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


Note You need to log in before you can comment on or make changes to this bug.