8.7.3. Configuring Reporting

  1. Install Subscription Asset Manager as described in Section 2.2, “Basic Installation and Setup for Subscription Asset Manager”, using the additional packages covered in Section 2.3, “Installing and Configuring Enhanced Reporting”.
    1. Register the host system. Use the --autoattach option to attach the required subscriptions for the operating system immediately.
      [root@server ~]# subscription-manager register --autoattach
      Username: jsmith@example.com
      Password:
    2. Wait several minutes for the updated content repositories to be added to the system configuration.
    3. Enable the [rhel-6-server-sam-rpms] repository.
      [root@server ~]# yum-config-manager --enable rhel-6-server-sam-rpms
      Loaded plugins: product-id, refresh-packagekit
      ========================= repo: rhel-6-server-sam-rpms =========================
      [rhel-6-server-sam-rpms]
      bandwidth = 0
      base_persistdir = /var/lib/yum/repos/x86_64/6Server
      baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/subscription-asset-manager/1/os
      cache = 0
      cachedir = /var/cache/yum/x86_64/6Server/rhel-6-server-sam-rpms
      cost = 1000
      enabled = 1
      enablegroups = True
      exclude =
      failovermethod = priority
      ...
    4. Install the katello-headpin-all package using yum install:
      [root@server ~]# yum install -y katello-headpin-all splice ruby193-rubygem-splice_reports spacewalk-splice-tool
    This can also be done when installing from an ISO image (Section 2.2.2, “Installing Through an ISO Image”) by using the --enhanced_reporting option.
    [root@server cdrom]# ./install_packages --enhanced_reporting
  2. The reporting database is a MongoDB database. Set up the Mongo service on the system to start automatically, and then start the service.
    [root@sam-server ~]# chkconfig mongod on
    [root@sam-server ~]# service mongod start
  3. Run the configuration script to set up the Subscription Asset Manager server, the default admin user, and the initial organization.
    [root@server ~]# katello-configure --deployment=sam --org=Example_Org --user-name=samadmin --user-pass=secret
    The Subscription Asset Manager admin user is not the same as the Satellite 5.6 admin user.
  4. Still on the Subscription Asset Manager machine, create an SSH key to use to authenticate to the Satellite 5.6 machine.
    [root@sam-server ~]# su - splice -s /bin/sh -c 'ssh-keygen -t rsa -f /var/lib/splice/id_rsa-sat -N ""'
    
    Generating public/private rsa key pair.
    Your identification has been saved in /var/lib/splice/id_rsa-sat.
    Your public key has been saved in /var/lib/splice/id_rsa-sat.pub.
    The key fingerprint is:
    78:fa:c9:68:71:a2:a7:c1:ec:35:e3:43:ce:27:b7:d8 splice@dhcp129-162.rdu.redhat.com
    
    The key's randomart image is:
    +--[ RSA 1024]----+
    |                 |
    |                 |
    |                 |
    |       .         |
    |      . S        |
    |   o  +o.        |
    |    +==+         |
    |   ..+BOo.       |
    |    o++=E.       |
    +-----------------+
  5. Switch to the Satellite 5.6 machine.
  6. Create a new user which can run the required Satellite reports to sent to the Subscription Asset Manager server.
    [root@sat-server ~]# useradd swreport
  7. Add the key file that was created on the Subscription Asset Manager machine to the authorized_keys file for the swreport user on the Satellite 5.6 machine. Include the command= option to restrict the swreport user to only running Satellite reports on the system.
    [root@sat-server ~]# vim /home/swreport/.ssh/authorized_keys
    
    command="/usr/bin/spacewalk-report $SSH_ORIGINAL_COMMAND" \
    	ssh-rsa key_hash swreport@sat-server
    The command directive should be all on one line in the keys file.
  8. Set the proper permissions on the .ssh directory and the authorized_keys file:
    [root@sat-server ~]# chown -R swreport:swreport /home/swreport/.ssh
    [root@sat-server ~]# chmod 700 /home/swreport/.ssh
    [root@sat-server ~]# chmod 600 /home/swreport/.ssh/authorized_keys
  9. Add the swreports user to the apache system group so that it can connect to the database.
    [root@sat-server ~]# gpasswd -a swreport apache
  10. Switch back to the Subscription Asset Manager machine.
  11. Switch to the reporting service user (splice), and test that the user can SSH into the Satellite machine using the swreport key.
    [root@sam-server ~]# su - splice -s /bin/bash
    [splice@sam-server ~]$ ssh -i /var/lib/splice/id_rsa-sat swreport@sat-server.example.com splice-export
    Accept the key fingerprint if prompted.
  12. Edit the reporting configuration to recognize the Satellite 5.6 server.
    [root@sam-server ~]# vim /etc/splice/checkin.conf
    
    [spacewalk]
    host=sat-server.example.com
    ssh_key_path=/var/lib/splice/id_rsa-sat
    login=swreport
  13. Edit the reporting configuration to use the Subscription Asset Manager administrator password that was set during the Subscription Asset Manager setup.
    admin-pass=secret
  14. On the Subscription Asset Manager server, run the sync utility to populate the Subscription Asset Manager database with the Satellite 5.6 data.
    [root@sam-server ~]# su - splice -s /bin/bash
    [splice@sam-server ~]$ spacewalk-splice-checkin

    Note

    This can a long time to run on the initial sync operation.
    To improve the tool performance, set the number of threads for the spacewalk-splice-tool process to use. This should be one thread for every two cores on a low-utilization system or one thread for every three cores on a high-utilization system.
    For example:
    [root@sam-server]# /etc/splice/checkin.conf
    
    num-threads=3
  15. Get the Satellite 5.6 manifest from the Customer Portal.
    1. Log into the Customer Portal.
    2. Expand the Subscriptions tab, and select the Subscription Management > Subscription Management Applications item.
    3. Open the Satellite tab.
    4. If the Portal entry does not already exist, create the Satellite 5.6 entry and attach the required subscriptions.
      1. In the Satellite tab, click the Register a Satellite link.
      2. Fill in the required information for the Satellite 5.6 instance:
        • The name for the Satellite server entry.
        • The version of the Satellite instance; this should be 5.6.
      3. Click the Register button.
      4. In the Satellite 5.6 server's Subscriptions tab, select the subscriptions to add in the Available Subscriptions area.
        Be sure to set the appropriate quantity of subscriptions for each product selected. The quantity is the total number of subscriptions of that type available to the child organization.
      5. Scroll down, and click the Attach at the bottom of the window.
        Attaching subscriptions automatically updates the child organization's manifest.
    5. In the Satellite 5.6 server's entry page, click the Download manifest button, and save the archive file.
  16. Log into the Subscription Asset Manager UI (https://sam-hostname/sam) as a Satellite administrator, and switch to the appropriate Satellite 5.6 organization.
  17. Open the Subscriptions > Subscriptions tab, and click the Import Manifest link.
  18. In the middle of the import tab, click browse to navigate to the saved manifest file.
  19. Click the Upload button.