4.3.13. AppState

Description

The method returns information about a probe: a description, a current state, system resources utilization.

Request

{
  "user_id":(number),
  "methods":[
    {
      "method":"AppState",
      "params":{
        "project_id":(number),
        "app_ids":' id1 | [id1,id2] | "*" '
      }
    }
  ]
}

where:

  • user_id — an integer value, a user identifier;

  • project_id — an integer value, a user project identifier;

  • app_ids — probe identifiers, the field can be set in one of the following formats:

    • id1 — an integer value, a probe identifier,

    • [id1,id2] — an array of integer values, probe identifiers,

    • "*" — a string, the “asterisk” symbol, information request for all running probes.

Reply

{
  "reply":[
    {
      "method":"AppState",
      "result":[
        {
          "app_id":(number),
          "name":(string),
          "version":(string),
          "status":(string),
          "hostname":(string),
          "hostOS": (string),
          "cpu":[
            {
              "number":(string),
              "usedPercent":(number)
            }
          ],
          "memoryUsage":{
            "totalPhys":(number),
            "usedPhys":(number),
            "usedPercent":(number),
            "availPhys":(number)
          },
          "disk":{
            "total":(number),
            "available":(number)
          }
          "interfaces":[
            {
              "loopback":(boolean),
              "iface_name":(string),
              "MAC":(string),
              "iface_description":(string),
              "iface_friendly_name":(string),
              "iface_index":(number),
              "speed":(number),
              "ip":[
                {
                  "addr":(string),
                  "mask":(number)
                }
              ]
              "ipv6":[
                {
                  "addr":(string),
                  "mask":(number)
                }
              ]
            }
          ]
          "net_usage":[
            {
              "name":(string),
              "RX": (number),
              "TX": (number)
            }
          ]
        }
      ]
    }
  ]
}

where:

  • app_id — an integer value, a probe identifier;

  • name — a string, a probe name;

  • version — a string, a probe version;

  • status — a string, probe status:

    • active — a probe is running,

    • not started — a probe has not started.

  • hostname — a string, a host name, a device label in a network;

  • hostOS — a string, information about the operating system on which a probe is running;

  • cpu — an object, a load on each logical CPU core and load average for all cores. A probe requests from the operating system for CPU load data. The object contains the following fields:

    • number — a string, a logical CPU core identifier or the value Total for load average for all cores,

    • usedPercent — a real number, a logical core load or load average (in percent).

  • memoryUsage — an object, the RAM state. The object contains the following fields:

    • totalPhys — an integer value, the RAM size available on the server, in megabytes,

    • usedPhys — an integer value, memory utilization by all applications and the operating system, in megabytes,

    • usedPercent — a real number, size of used memory (in percent),

    • availPhys — an integer value, estimation of how much memory is available for starting new applications, without swapping.

  • disk — an object, state of the HDD partition on which a probe is installed. The object contains the following fields:

    • total — an integer value, a disk partition capacity on which a probe is installed, in megabytes,

    • available — an integer value, amount of free space of the partition on which a probe is installed, in megabytes.

  • interfaces — an object, description of the network interfaces available in the OS. The object contains the following fields:

    • loopback — a logical type indicating that it is local network. Packets sent through such an interface are returned back to the system without leaving the device.

    • iface_name — a string, a network interface name,

    • MAC — a string, unique hardware identifier of a network controller or network interface,

    • iface_description — a string, a network interface which is used in Windows,

    • iface_friendly_name — a string, a network interface friendly name which is used in Windows,

    • iface_index — an integer value, a network interface index for IPv4 protocol,

    • iface_v6_index — an integer value, a network interface index for IPv6 protocol,

    • speed — an integer value, speed of a network interface adapter in Mbps,

    • ip — an array of IPv4 address, includes:

      • addr — a string, IPv4 address of a network interface,

      • mask — an integer value, subnet mask in CIDR notation.

    • ipv6 — an array of IPv4 address, includes:

      • addr — a string, IPv6 address of a network interface,

      • mask — an integer value, subnet mask in CIDR notation.

  • interfaces — an object, utilization of the network interfaces available in the OS. The object contains the following fields:

    • name — a string, a network interface name,

    • RX — a real number, receive data rate in Kbps,

    • TX — a real number, transmit data rate in Kbps.

Example

Request by the cURL utility
#1. Information request for one probe
curl http://172.16.1.41/ctrl_api/v1/json \
   -H "Content-Type: application/json" \
   --data '{"user_id":1,"methods":[{"method":"AppState","params":{"project_id":2,"app_ids":1}}]}'

#2. Information request for several probes
curl http://172.16.1.41/ctrl_api/v1/json \
   -H "Content-Type: application/json" \
   --data '{"user_id":1,"methods":[{"method":"AppState","params":{"project_id":2,"app_ids":[1,2]}}]}'

#3. Information request for all running probes
curl http://172.16.1.41/ctrl_api/v1/json \
   -H "Content-Type: application/json" \
   --data '{"user_id":1,"methods":[{"method":"AppState","params":{"project_id":2,"app_ids":"*"}}]}'
Example of a reply to a request #1 (the information request for one probe)
 {
   "reply": [
     {
       "method": "AppState",
       "result": [
         {
           "app_id": 1,
           "name": "Probe Ubuntu 20",
           "version": "1.1.0-dev (2025.08.05 06:07:13 UTC)",
           "status": "active",
           "hostname": "Test-P55-UD3L",
           "hostOS": "Linux 5.4.0-198-generic (x86_64), #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024",
           "cpu": [
             {
               "number": "0",
               "usedPercent": 3.92
             },
             {
               "number": "1",
               "usedPercent": 2.02
             },
             {
               "number": "2",
               "usedPercent": 0
             },
             {
               "number": "3",
               "usedPercent": 0
             },
             {
               "number": "4",
               "usedPercent": 0
             },
             {
               "number": "5",
               "usedPercent": 2
             },
             {
               "number": "6",
               "usedPercent": 1.98
             },
             {
               "number": "7",
               "usedPercent": 6.67
             },
             {
               "number": "Total",
               "usedPercent": 2.12
             }
           ],
           "memoryUsage": {
             "totalPhys": 7936,
             "usedPhys": 1473,
             "usedPercent": 19,
             "availPhys": 6463
         },
           "disk": {
             "total": 226487,
             "available": 73805
           },
           "interfaces": [
             {
               "loopback": false,
               "iface_name": "enp4s0",
               "MAC": "1c:6f:65:8c:d7:85",
               "iface_index": 2,
               "speed": 1000,
               "ipv6": [
                 {
                   "addr": "fe80::1e6f:65ff:fe8c:d785%enp4s0",
                   "mask": 64
                 }
              ]
             },
             {
               "loopback": false,
               "iface_name": "enp4s0.100",
               "MAC": "0e:1b:65:8c:d7:85",
               "iface_index": 2,
               "speed": 1000,
               "ip": [
                 {
                   "addr": "172.16.1.198",
                   "mask": 20
                 }
               ],
               "ipv6": [
                 {
                   "addr": "fe80::c1d:65ff:fe8c:d785%enp4s0.100",
                   "mask": 64
                 }
               ]
             },
             {
               "loopback": false,
               "iface_name": "enp4s0.101",
               "MAC": "1c:6d:65:8c:d7:85",
               "iface_index": 4,
               "speed": 1000,
               "ip": [
                 {
                   "addr": "10.10.30.150",
                   "mask": 24
                 }
               ],
               "ipv6": [
                 {
                   "addr": "fe80::1e6c:65ff:fe8c:d785%enp4s0.101",
                   "mask": 64
                 }
               ]
             },
             {
               "loopback": true,
               "iface_name": "lo",
               "MAC": "00:00:00:00:00:00",
               "iface_index": 1,
               "ip": [
                 {
                   "addr": "127.0.0.1",
                   "mask": 8
                 }
               ],
               "ipv6": [
                 {
                   "addr": "::1",
                   "mask": 128
                 }
               ]
             }
           ]
         }
       ]
     }
   ]
 }