Monitor CPU

Complete these tasks to monitor the CPU usage of the Session Border Controller (SBC).

Table - Prerequisites

Prerequisite More Information
Authenticate Authenticate

This example assumes you have exported the access token to the variable $TOKEN.

  1. Retrieve the list of key performance indicators (KPIs) for the SBC.
    curl -X GET \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/statistics/kpiTypes"

    The response contains links to the available KPI types.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <response>
      <data/>
      <messages/>
      <links>
        <link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=globalSessions</link>
        <link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sessCapacityUtil</link>
        <link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sipRegistrations</link>
        <link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sysCPUUtil</link>
        <link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sysMemoryUtil</link>
      </links>
    </response>
  2. For information about sysCPUUtil KPI type (for example, the data type, units, and URL), make a GET request to /statistics/kpiTypes?type=sysCPUUtil.
    curl -X GET \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sysCPUUtil"

    The response contains a description of the data returned by a request to the URL in the <link> tag.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <response>
      <data>
        <httpMethod>GET</httpMethod>
        <name>Get Total CPU Utilization</name>
        <kpis>
          <containerName>sysCPUUtilPercent</containerName>
          <kpi>
            <name>percentUsed</name>
            <description>The percentage of total CPU utilization measured in 1 second</description>
            <dataType>integer</dataType>
            <metricType>gauge</metricType>
            <units>percent</units>
          </kpi>
        </kpis>
      </data>
      <messages/>
      <links>
        <link>https://10.0.0.2/rest/v1.1/statistics/kpis?type=sysCPUUtil</link>
      </links>
    </response>
  3. Poll the endpoint in the <link> tag to retrieve the CPU usage.
    curl -X GET \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/statistics/kpis?type=sysCPUUtil"

    The CPU usage is returned.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <response>
      <data>
        <sysCPUUtilPercent>
          <percentUsed>0</percentUsed>
        </sysCPUUtilPercent>
      </data>
      <messages/>
      <links>
        <link>https://10.0.0.2/rest/v1.1/statistics/kpiTypes?type=sysCPUUtil</link>
      </links>
    </response>