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 1214980 - [RFE] RHEL 7 subscription-manager: log exact registration commands used and their error outputs if any
Summary: [RFE] RHEL 7 subscription-manager: log exact registration commands used and t...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: 1215824
TreeView+ depends on / blocked
 
Reported: 2015-04-24 02:44 UTC by Xixi
Modified: 2020-04-06 16:09 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
: 1215824 (view as bug list)
Environment:
Last Closed: 2020-04-06 16:09:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xixi 2015-04-24 02:44:08 UTC
Description of problem:
RFE to improve supportability by having subscription-manager write to log the exact command run by the user, followed by error code and output (if any errors). 

For example:
[date/timestamp] <exact command run by the user> <error code and message>

This can then be parsed for diagnosis purposes (manually or automatically).

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Xixi 2015-04-27 20:42:32 UTC
cloned for RHEL 6:

Bug 1215824 - [RFE] RHEL 6 subscription-manager: log exact registration commands used and their error outputs if an

Comment 3 Adrian Likins 2015-09-23 14:34:42 UTC
The main holdup with this is verifying we scrub passwords from the log messages, which is complicated a bit by the arg parsing module we use (optparse).

Comment 4 Adrian Likins 2015-09-23 15:15:39 UTC
You can do most of this with recent versions, however it is not turned on by default. And it alter every log entry instead of just one at start up.

If you change the 'formatter_rhsm_log' section in /etc/rhsm/logging.conf
from:

[formatter_rhsm_log]
format=%(asctime)s [%(levelname)s] %(cmd_name)s:%(process)d @%(filename)s:%(lineno)d - %(message)s
datefmt=
class=logging.Formatter

to:

[formatter_rhsm_log]
format=%(asctime)s [%(levelname)s] "%(cmd_line)s" %(cmd_name)s:%(process)d @%(filename)s:%(lineno)d - %(message)s
datefmt=
class=logging.Formatter


(ie, add the %(cmd_line)s to the formatter specifier, it will log the cli line (sys.argv). to each log entry.

Sample output:

2015-09-23 11:09:38,688 [INFO] "bin/subscription-manager register --username duey --password password --org donaldduck --force" subscription-manager:24955 @cache.py:382 - Server does not support packages, skipping profile upload.
2015-09-23 11:09:38,689 [DEBUG] "bin/subscription-manager register --username duey --password password --org donaldduck --force" subscription-manager:24955 @cache.py:110 - Wrote cache: /var/lib/rhsm/facts/facts.json
2015-09-23 11:09:38,689 [DEBUG] "bin/subscription-manager register --username duey --password password --org donaldduck --force" subscription-manager:24955 @cache.py:138 - Checking current system info against cache: /var/lib/rhsm/cache/installed_products.json
2015-09-23 11:09:38,981 [INFO] "/usr/libexec/rhsmd" rhsmd:24993 @rhsmd:230 - rhsmd started
2015-09-23 11:09:38,991 [DEBUG] "/usr/libexec/rhsmd" rhsmd:24993 @rhsmd:185 - D-Bus interface com.redhat.SubscriptionManager.EntitlementStatus.update_status called with status = 1
2015-09-23 11:09:39,060 [DEBUG] "/usr/libexec/rhsmd" rhsmd:24993 @identity.py:131 - Loading consumer info from identity certificates.
2015-09-23 11:09:39,065 [DEBUG] "/usr/libexec/rhsmd" rhsmd:24993 @rhsmd:153 - D-Bus signal com.redhat.SubscriptionManager.EntitlementStatus.entitlement_status_changed emitted
2015-09-23 11:09:39,374 [DEBUG] "bin/subscription-manager subscribe --auto" subscription-manager:24996 @ga_loader.py:89 - ga_loader GaImporterGtk3
2015-09-23 11:09:39,382 [DEBUG] "bin/subscription-manager subscribe --auto" subscription-manager:24996 @plugins.py:569 - loaded plugin modules: [<module 'container_content' from '/usr/share/rhsm-plugins/container_content.pyc'>, <module 'ostree_content' from '/usr/share/rhsm-plugins/ostree_content.pyc'>]
2015-09-23 11:09:39,383 [DEBUG] "bin/subscription-manager subscribe --auto" subscription-manager:24996 @plugins.py:570 - loaded plugins: {'container_content.ContainerContentPlugin': <container_content.ContainerContentPlugin object at 0x3363910>, 'ostree_content.OstreeContentPlugin': <ostree_content.OstreeContentPlugin object at 0x3363ed0>}
2015-09-23 11:09:39,383 [DEBUG] "bin/subscription-manager subscribe --auto" subscription-manager:24996 @identity.py:131 - Loading consumer info from identity certificates.


(exit status and output aren't captured though)

Comment 5 Rehana 2020-04-06 16:09:19 UTC
Thank you for opening the bug. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, Please reach out to us 

Thank you.


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