Registering a Management Station

Register a management station with OS Management Hub by using the profile for the management station and installing the Management Agent.

Install Required Packages

The management station runs as an Apache server application in its role as a network proxy and local yum mirror for the OS Management Hub service. You must install the required Apache web server and start and enable the httpd service.

If your management station is using SELinux, you must also install the policycoreutils-python-utils package, which provides the necessary utilities for managing SELinux.

  1. Connect to the instance by using SSH.
  2. Install the required Apache packages.
    sudo dnf install -y httpd mod_ssl openssl
  3. Start and enable the httpd service.
    sudo systemctl start httpd
    sudo systemctl enable httpd
  4. Install the required SELinux package and any dependencies.
    sudo dnf install -y policycoreutils-python-utils
    

Add the Management Station Profile to the Instance

Add the management station profile to the instance. The profile identifies the instance as a management station. The profile can be used to register only a single management station. You can't reuse management station profiles.
  1. in the Console, copy the contents of the management station profile.
    1. Open the navigation menu and click Observability & Management. Under OS Management Hub, click Management stations.
    2. Click the name of the management station whose profile you want to use.
    3. Click View Profile.
    4. Copy the contents of the profile.
  2. Connect to the instance by using SSH.
  3. Create the /etc/osmh-profile file (with no file extension on the filename) using a text editor. For example:
    sudo vi /etc/osmh-profile
  4. Paste the profile contents into the /etc/osmh-profile file and save the file.

Install the Management Agent

Install the Management Agent software on the management station instance. OS Management Hub requires that a Management Agent be installed on the instance and provides a service plugin to the Management Agent service.
Note

For more detailed steps about installing the Management Agent software, see Installing Management Agents.
  1. Install the latest version of JDK8 or JRE8 (version 1.8u281 or later).

    Java Development Kit (JDK) or Java Runtime Environment (JRE) must be installed on the instance before you install the Management Agent software. The Management Agent requires JDK8 only.

    Oracle Linux 8
    sudo dnf install -y java-1.8.0-openjdk
  2. Navigate to the directory that contains the downloaded Management Agent software RPM file and run the following command to install the RPM file:
    Oracle Linux 8
    sudo dnf install -y <rpm_file_name>.rpm

Set Up the Management Agent

Create the Management Agent response file on the management station instance and configure the response file to use the Management Agent with the OS Management Hub service plugin to register the instance with OS Management Hub service

Note

For more detailed steps about installing the Management Agent software, see Installing Management Agents.
  1. Configure the Management Agent plugin to run as root. The OS Management Hub plugin needs to run as root to patch the instance. For example:
    sudo tee /etc/sudoers.d/mgmt_agent <<EOF
    ## Allows Management Agent to change ownership of deployed External Plugin
    mgmt_agent ALL=(ALL) NOPASSWD:/opt/oracle/mgmt_agent/agent_inst/bin/chown_recursive_ep.sh
    ## Allows Management Agent to run External Plugin under root user
    mgmt_agent ALL=(root) NOPASSWD:SETENV: /opt/oracle/mgmt_agent/plugins/osmh/*/osmh
    EOF
  2. Set the permissions of the file to 440.
    sudo chmod 440 /etc/sudoers.d/mgmt_agent
  3. Ensure that you have created the Management Agent install key.
  4. In the Console, copy the Management Agent install key to use to register the instance.
    1. Open the navigation menu and click Observability & Management. Under Management Agent, click Downloads and Keys.
    2. Under Install keys, find the key that you want to use to register the instance.
    3. Click the Actions menu for the key and select Copy key to clipboard.
  5. Create a response (input.rsp) file manually with a text editor and replace <MACS_KEY> with the install key that you copied in the previous step.

    For example:

    cat >/tmp/input.rsp <<EOF
    ManagementAgentInstallKey = <MACS_KEY>
    Service.plugin.osmh.download = true
    EOF

    The input.rsp file requires the following mandatory parameters.

    • ManagementAgentInstallKey: Install key required to validate the identity of the domain and the authenticity of the installation.
    • Service.plugin.osmh.download = true: Deploys the OS Management Hub (osmh) plugin during the agent installation.
  6. Configure the Management Agent by running the setup.sh script using the response file.
    sudo /opt/oracle/mgmt_agent/agent_inst/bin/setup.sh opts=/tmp/input.rsp

    A successful setup returns the following message: Agent setup completed and the agent is running. The setup of the OS Management Hub plugin can take another few minutes in the background.

  7. Configure the firewall and SELinux settings to permit traffic and access.

    The management station uses the ports defined during setup for synchronizing the yum mirror and managing proxy traffic to OCI.

    You can manually update the firewall rules and SELinux settings or use the station-setup.sh script.

    The station-setup.sh script configures the firewall and SELinux settings to permit traffic on the ports that you have specified in the proxy configuration on the management station and the Apache HTTP web server to serve packages from the path in the mirror configuration. The script handles firewall and SELinux configuration for mirrors using the xfs, ext4, btrfs, or nfs file system.

    Important

    For your convenience, the station-setup.sh script is available to configure the firewall and SELinux settings. Before running the script in your production environment, be sure to review the script and understand the changes that the script makes to your firewall and SELinux settings.
    sudo /opt/oracle/mgmt_agent/plugins/osmh/stateDir/station-setup.sh
    Note

    If you receive a command not found or No such file error message, wait a few minutes for the setup of the OS Management Hub plugin to complete and the station-setup.sh script to become available. If the issue persists, the registration might have failed. See Registration Failed for Instance or Management Station.
  8. If you didn't run the station-setup.sh script, restart the Apache HTTP web server.
    sudo systemctl restart httpd

Verify Management Station Registration and Details

Verify that the management station is registered with OS Management Hub as an instance and is available to mirror and distribute content to instances in the data center.
  1. Open the navigation menu and click Observability & Management. Under OS Management Hub, click Management stations.
  2. Under List scope, select the compartment that contains the management station.
  3. Verify that the management station is listed in the table and that its status is Active.
  4. Click the name of the management station to view its details.
    The management station details page opens with information about the management station. After the first sync occurs, the page will update with mirror sync status, mirror volume capacity, and a list of all mirrored software sources displayed in tabular format.