How to check "Last Checkin" time of content hosts using hammer command on Red Hat Satellite 6
Environment
- Red Hat Satellite 6.2 to 6.8
Issue
- How to check Last Checkin time of content hosts using hammer command on Red Hat Satellite?
Resolution
If using a Red Hat Satellite version 6.2 to 6.6
-
Create backup of
/etc/hammer/cli.modules.d/csv.yml:# cp /etc/hammer/cli.modules.d/csv.yml /etc/hammer/cli.modules.d/csv.yml.backup -
Then edit
/etc/hammer/cli.modules.d/csv.ymlfile and add below lines in this file.columns: :content-hosts: :define: - :name: Last Checkin :json: - subscription_facet_attributes - last_checkin -
If the file is having default settings then after adding the above lines the file should look like below.
# cat /etc/hammer/cli.modules.d/csv.yml :csv: :enable_module: true :columns: :content-hosts: :define: - :name: Last Checkin :json: - subscription_facet_attributes - last_checkin -
Now use below command in order to see the Last Checkin time.
# hammer csv content-hosts --export --columns "Name,Last Checkin"
If using Red Hat Satellite 6.6 and higher
-
Create a Report Template using the Web interface of the satellite server, and add the Last Checkin field to it, as explained in this Solution Resource.
-
Verify that your Report Template is visible using the
hammercommand line tool:$ hammer report-template list ... 183 | ekasprzy - hosts with last checking ... -
Display the report in CSV format:
$ hammer report-template generate --id 183 Name,Last checkin a.redhat.com, 2021-03-10 16:57:21 UTC ...
For more KB articles/solutions related to Red Hat Satellite 6.x hammer Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x hammer-related Issues
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.