System Metrics

Get system metrics: CPU

Description

Get system metrics: CPU

URI

GET /api/agents/[agent_id]/system/cpu

Please refer to Agents to see how to obtain agent_id.

URI parameter

  • _timestamp_gt

    type: integer

    required: no

    description: the starting unix timestamp of the data, in seconds.

  • _pagesize

    type: integer

    required: no

    description: number of data points.

  • time_interval

    type: string

    required: no

    description: time interval of data points, the minimum is one minute.

    The format is [number]+[unit], such as 1+minute, 15+minute, 30+minute, 1+hour, 3+hour.

Example Request

Shell

curl \
 -H "API-Token: efa45ec2de7dfc34271aabbbbdd7266b"
 "https://{console-host}/api/agents/1/system/cpu?_pagesize=10000&_timestamp_gt=1623163723&time_interval=2+hour"

Example Response

Status: 200 OK
{
    "status": 0,
    "data": [
        {
            "loadavg_15m": 0,
            "user": 0.22,
            "loadavg_1m": 0.02,
            "timestamp": 1623247200,
            "system": 0.2,
            "idle": 99.35,
            "loadavg_5m": 0.01,
            "iowait": 0
        },
        {
            "loadavg_15m": 0,
            "user": 0.23,
            "loadavg_1m": 0.02,
            "timestamp": 1623240000,
            "system": 0.22,
            "idle": 99.33,
            "loadavg_5m": 0.01,
            "iowait": 0
        },
        {
            "loadavg_15m": 0,
            "user": 0.23,
            "loadavg_1m": 0.03,
            "timestamp": 1623232800,
            "system": 0.21,
            "idle": 99.35,
            "loadavg_5m": 0.02,
            "iowait": 0
        },
        {
            "user": 0.23,
            "softirq": 0,
            "loadavg_1m": 0.02,
            "timestamp": 1623225600,
            "system": 0.2,
            "idle": 99.34,
            "loadavg_5m": 0.02,
            "loadavg_15m": 0
        },
        {
            "loadavg_15m": 0,
            "user": 0.23,
            "loadavg_1m": 0.02,
            "timestamp": 1623218400,
            "system": 0.21,
            "idle": 99.33,
            "loadavg_5m": 0.01,
            "iowait": 0
        }
    ]
}

Get system metrics: memory

Description

Get system metrics: memory

URI

GET /api/agents/[agent_id]/system/memory

URI parameter

  • _timestamp_gt

    type: integer

    required: no

    description: the starting unix timestamp of the data, in seconds.

  • _pagesize

    type: integer

    required: no

    description: number of data points.

  • time_interval

    type: string

    required: no

    description: time interval of data points, the minimum is one minute.

    The format is [number]+[unit], such as 1+minute, 15+minute, 30+minute, 1+hour, 3+hour.

Example Request

Shell

curl \
 -H "API-Token: efa45ec2de7dfc34271aabbbbdd7266b"
 "https://{console-host}/api/agents/1/system/memory?_pagesize=10000&_timestamp_gt=1623163723&time_interval=2+hour"

Example Response

Status: 200 OK
{
    "status": 0,
    "data": [
        {
            "cached": 1385008760.77, // unit: Byte
            "available": 1533821159.23, // unit: Byte
            "swap_used": 2895872, // unit: Byte
            "timestamp": 1623247200,
            "free": 252457908.65, // unit: Byte
            "slab": 175316860.9, // unit: Byte
            "used": 342084977.55, // unit: Byte
            "buffers": 109015137.03 // unit: Byte
        },
        {
            "cached": 1381552712.98,
            "available": 1533155945.73,
            "swap_used": 2895872,
            "timestamp": 1623240000,
            "free": 255287594.47,
            "slab": 176064609.69,
            "used": 342719526.02,
            "buffers": 109006950.53
        },
        {
            "cached": 1385366166.43,
            "available": 1535174923.08,
            "swap_used": 2895872,
            "timestamp": 1623232800,
            "free": 253470484.84,
            "slab": 176215592.83,
            "used": 340731476.73,
            "buffers": 108998656
        },
        {
            "cached": 1385835638.78,
            "available": 1534638095.95,
            "swap_used": 2895872,
            "timestamp": 1623225600,
            "free": 252472380.67,
            "slab": 176572958.91,
            "used": 341268261.24,
            "buffers": 108990503.31
        },
        {
            "cached": 1386322227.24,
            "available": 1535735551.54,
            "swap_used": 2895872,
            "timestamp": 1623218400,
            "free": 253092456.2,
            "slab": 176900279.43,
            "used": 340170679.83,
            "buffers": 108981420.73
        }
    ]
}

Get system metrics: network

Description

Get system metrics: network

URI

GET /api/agents/[agent_id]/system/net

URI parameter

  • _timestamp_gt

    type: integer

    required: no

    description: the starting unix timestamp of the data, in seconds.

  • _pagesize

    type: integer

    required: no

    description: number of data points.

  • time_interval

    type: string

    required: no

    description: time interval of data points, the minimum is one minute.

    The format is [number]+[unit], such as 1+minute, 15+minute, 30+minute, 1+hour, 3+hour.

Example Request

Shell

curl \
 -H "API-Token: efa45ec2de7dfc34271aabbbbdd7266b"
 "https://{console-host}/api/agents/1/system/net?_pagesize=10000&_timestamp_gt=1623163723&time_interval=2+hour"

Example Response

Status: 200 OK
{
    "status": 0,
    "data": [
        {
            "drop_in": 0.46,
            "bytes_sent": 4142.31,
            "packets_sent": 16.62,
            "err_out": 0,
            "timestamp": 1623251400,
            "drop_out": 0,
            "bytes_recv": 1714.54,
            "packets_recv": 18.54,
            "err_in": 0
        },
        {
            "drop_in": 0.51,
            "bytes_sent": 3425.59,
            "packets_sent": 15.12,
            "err_out": 0,
            "timestamp": 1623251340,
            "drop_out": 0,
            "bytes_recv": 1529.15,
            "packets_recv": 16.93,
            "err_in": 0
        },
        {
            "drop_in": 0.5,
            "bytes_sent": 3411.4,
            "packets_sent": 15,
            "err_out": 0,
            "timestamp": 1623251280,
            "drop_out": 0,
            "bytes_recv": 1528.47,
            "packets_recv": 16.95,
            "err_in": 0
        },
        {
            "drop_in": 0.5,
            "bytes_sent": 3494,
            "packets_sent": 15.85,
            "err_out": 0,
            "timestamp": 1623251220,
            "drop_out": 0,
            "bytes_recv": 1632.78,
            "packets_recv": 17.22,
            "err_in": 0
        },
        {
            "drop_in": 0.5,
            "bytes_sent": 4834.32,
            "packets_sent": 18.5,
            "err_out": 0,
            "timestamp": 1623251160,
            "drop_out": 0,
            "bytes_recv": 1865.88,
            "packets_recv": 19.97,
            "err_in": 0
        }
    ]
}

Get system metrics: TCP

Description

Get system metrics: TCP

URI

GET /api/agents/[agent_id]/system/tcp

URI parameter

  • _timestamp_gt

    type: integer

    required: no

    description: the starting unix timestamp of the data, in seconds.

  • _pagesize

    type: integer

    required: no

    description: number of data points.

  • time_interval

    type: string

    required: no

    description: time interval of data points, the minimum is one minute.

    The format is [number]+[unit], such as 1+minute, 15+minute, 30+minute, 1+hour, 3+hour.

Example Request

Shell

curl \
 -H "API-Token: efa45ec2de7dfc34271aabbbbdd7266b"
 "https://{console-host}/api/agents/1/system/tcp?_pagesize=10000&_timestamp_gt=1623163723&time_interval=2+hour"

Example Response

Status: 200 OK
{
    "status": 0,
    "data": [
        {
            "closed": 0,
            "timestamp": 1623251400,
            "orphaned": 0,
            "estab": 2,
            "total": 7,
            "timewait": 0
        },
        {
            "closed": 0,
            "timestamp": 1623251340,
            "orphaned": 0,
            "estab": 2,
            "total": 7,
            "timewait": 0
        },
        {
            "closed": 0.14,
            "timestamp": 1623251280,
            "orphaned": 0,
            "estab": 2,
            "total": 7.14,
            "timewait": 0.14
        },
        {
            "closed": 0.86,
            "timestamp": 1623251220,
            "orphaned": 0,
            "estab": 2,
            "total": 7.86,
            "timewait": 0.86
        },
        {
            "closed": 0,
            "timestamp": 1623251160,
            "orphaned": 0,
            "estab": 2,
            "total": 7,
            "timewait": 0
        }
    ]
}