Enabling Instance Metrics Collection

You can view instance-level metrics from the Monitoring page in the web console. This page shows statistics about I/O operations, CPU utilization, network traffic, and memory utilization on your instance. The opc-init package also includes an agent to collect metrics. This agent runs on the instance and provides highly accurate memory utilization statistics, based on data that is collected every minute.

  • On instances created using Oracle-provided Oracle Linux images with release version 16.4.6 or later, the agent is installed and enabled by default.

  • On instances created using Oracle-provided Oracle Linux images with release version 16.4.4, the agent is installed and disabled by default. To enable the agent, see Enabling and Disabling the OPC Agent.

  • On Oracle Linux instances created using older images, or on Oracle Linux instances created using private images where opc-init is not installed, the agent isn’t installed. To install the agent, download and install opc-init. See Downloading and Installing the OPC Agent on an Oracle Linux Instance.

Note:

You can use the OPC agent only on Oracle Linux 6.x and Oracle Linux 7.x instances. This agent isn’t supported on Windows or Solaris instances.

Downloading and Installing the OPC Agent on an Oracle Linux Instance

If your instance was created using an Oracle-provided image with release version 16.3.6 or older, or if your instance uses a private machine image on which opc-init isn’t installed, then to use the agent you must download and install opc-init.
  1. Determine the version of Python on your instance.

    python --version
  2. Download the opc-init package from http://www.oracle.com/technetwork/topics/cloud/downloads/opc-init-3096035.html.

  3. Extract the files in the package.

  4. Copy the appropriate file to your instance.

    • opc-init-py2.6-version.noarch.rpm — for Linux with Python 2.6

    • opc-init-py2.7-version.noarch.rpm — for Linux with Python 2.7

    Here, version indicates the release version of the opc-init package.

    Note:

    The opc-init package includes a .exe file for installing opc-init on Windows. While you can use this file to install opc-init on a Windows instance, the OPC agent isn’t supported on Windows and it won’t be installed on a Windows instance.

  5. Log in to your instance and check if opc-init is installed.

    rpm -qa | grep opc-init

    If this command doesn’t return any output, it indicates that opc-init isn’t installed on your instance.

  6. Install the appropriate file.

    • If opc-init isn’t installed on your instance, then, to install opc-init on an instance with Python 2.6:

      sudo rpm -i opc-init-py2.6-version.noarch.rpm
    • If an earlier version of opc-init is already installed on your instance, then use the upgrade option. For example, on an instance with Python 2.6:

      sudo rpm -Uvh opc-init-py2.6-version.noarch.rpm
  7. Verify the installation:

    rpm -qa | grep opc-init

    The output of this command should show the opc-init file that you just installed.

Enabling and Disabling the OPC Agent

If you’ve downloaded and installed opc-init on your Oracle Linux instance, or if you’ve created an instance using an Oracle-provided Oracle Linux image with release version 16.4.6 or later, the OPC agent is installed on your instance and enabled by default. If you’ve created an instance using an Oracle-provided Oracle Linux image with release version 16.4.4, the OPC agent is installed and disabled by default.

  • On Oracle Linux 7.x

    • To enable the agent:

      systemctl start opc-guest-agent.service
    • To disable the agent:

      systemctl stop opc-guest-agent.service
    • To check the status of the agent:

      systemctl status opc-guest-agent.service
  • On Oracle Linux 6.x

    • To enable the agent:

      sudo start opc-guest-agent-service

      To check the status of the agent:

      sudo status opc-guest-agent-service

      When the agent is running, this command gives the following sample output:

      opc-guest-agent-service start/running, process 1578
      
    • To disable the agent:

      sudo stop opc-guest-agent-service

      To check the status of the agent:

      sudo status opc-guest-agent-service

      When the agent is stopped, this command gives the following output:

      opc-guest-agent-service stop/waiting
  • If you stop and restart, or delete and re-create, an instance that uses a persistent boot disk, you don’t need to install opc-init again.

  • If you delete and re-create an instance that uses a nonpersistent boot disk, and if opc-init wasn’t installed by default on that instance, you must download and install opc-init again.

Viewing the Metrics Reported by the OPC Agent

The following memory utilization metrics are reported by the OPC agent:

  • Memory Utilization Percentage (agent): Indicates the actual memory utilization on the instance, in percentage.

  • Memory Utilization (agent): Indicates the actual memory utilization on the instance, in kilobytes.

Note:

When the OPC agent is disabled, no value is displayed for these metrics.

To view instance metrics, see Viewing Instance Metrics.