How to fetch the last check-in time for the content host registered with Red Hat Satellite server using Report Template ?

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.8

Issue

  • How to add last check-in option to the existing report template on the Red Hat Satellite Server ?

Resolution

  • Create a clone of the existing report template on the Red Hat Satellite Server.

       Satellite WEBUI --> Monitor --> Report Templates --> Click on "Clone" from the drop down for specific template
    
  • Edit the the cloned template as follows:

  • In the report_headers macro add 'Last Checkin,'

  • In the report_row() code block add

      'Last Checkin': last_checkin(host),
    
  • If you cloned the Host - Registered Content Hosts template, the relevant part of the template code should look like this:

      <%- report_headers 'Name', 'Ip', 'Last Checkin', 'Operating System', 'Subscriptions', 'Applicable Errata', 'Owner', 'Kernel', 'Latest kernel available' -%>
      <%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :subscriptions, :interfaces, :applicable_errata], preload: [:kernel_release, :owner]).each_record do |host| -%>
      <%-   report_row(
              'Name': host.name,
              'Ip': host.ip,
              'Last Checkin': last_checkin(host),
              'Operating System': host.operatingsystem,
              'Subscriptions': host_subscriptions_names(host),
              'Applicable Errata': host_applicable_errata_ids(host),
              'Owner': host.owner,
              'Kernel': host_kernel_release(host),
              'Latest kernel available': host_latest_applicable_rpm_version(host, 'kernel')
            ) -%>
      <%- end -%>
    

Root Cause

The Report Template provided by the Red Hat Satellite server does not fetch the last check-in details for the content host.

SBR
Product(s)
Components
Category

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.