Websocket Samples

Site Devices Stats

Subscribe to Devices Stats Stream

Websocket Endpoint

WS /api-ws/v1/stream

Subscribe Command

{
    "subscribe": "/sites/{site_id}/stats/devices"
}

Streamed Data Sample

{
    "event": "data",
    "channel": "/sites/67970e46-xxxx-xxxx-xxxx-xxxxxxxxxxxx/stats/devices",
    "data": {
        "mac": "5c5b350e1300",
        "version": "0.1.11681",
        "ip": "10.2.10.193",
        "ext_ip": "73.92.124.103",
        "power_src": "PoE 802.3af",
        "uptime": 706659,
        "last_seen": 1504917238,
        "num_clients": 1,
        "ip_stat": {
            "ip": "10.2.10.193",
            "netmask": "255.255.192.0",
            "gateway": "10.2.1.1",
            "ip6": "2607:f8b0:4005:808::2004",
            "netmask6": "/32",
            "gateway6": "2607:f8b0:4005:808::1",
            "dns": [
                "8.8.8.8",
                "8.8.4.4"
            ],
            "ips": {
                "vlan1": "10.2.1.1/24,2607:f8b0:4005:808::1/32"
            }
        },
        "radio_stat": {
            "band_5": {
                "mac": "5c5b3500bc50",
                "tx_pkts": 29790678,
                "bandwidth": 40,
                "channel": 149,
                "power": 15,
                "tx_bytes": 642844306,
                "rx_pkts": 214935,
                "rx_bytes": 28557893,
                "num_clients": 1
            },
            "band_24": {
                "mac": "5c5b3500bc40",
                "tx_pkts": 19831714,
                "bandwidth": 20,
                "channel": 11,
                "power": 11,
                "tx_bytes": 3118012867,
                "rx_pkts": 3,
                "rx_bytes": 298,
                "num_clients": 0
            },
            "band_6": {
                "mac": "5c5b3500bc60",
                "tx_pkts": 29790678,
                "bandwidth": 40,
                "channel": 53,
                "power": 15,
                "tx_bytes": 642844306,
                "rx_pkts": 214935,
                "rx_bytes": 28557893,
                "num_clients": 1
            },            
        },
        "port_stat": {
            "module": {
                "tx_pkts": 6413453,
                "rx_pkts": 951238,
                "rx_bytes": 877498272,
                "tx_bytes": 1009414543,
                "rx_peak_bps": 31116,
                "tx_peak_bps": 42165,
                "full_duplex": true,
                "speed": 1000,
                "up": true,
                "rx_errors": 0
            },
            "eth3": {
                "tx_pkts": 0,
                "rx_pkts": 0,
                "rx_bytes": 0,
                "tx_bytes": 0,
                "rx_peak_bps": 0,
                "tx_peak_bps": 0,
                "full_duplex": false,
                "speed": 0,
                "up": false,
                "rx_errors": 0
            },
            "eth2": {
                "tx_pkts": 0,
                "rx_pkts": 0,
                "rx_bytes": 0,
                "tx_bytes": 0,
                "rx_peak_bps": 0,
                "tx_peak_bps": 0,
                "full_duplex": false,
                "speed": 0,
                "up": false,
                "rx_errors": 0
            },
            "eth1": {
                "tx_pkts": 0,
                "rx_pkts": 0,
                "rx_bytes": 0,
                "tx_bytes": 0,
                "rx_peak_bps": 0,
                "tx_peak_bps": 0,
                "full_duplex": false,
                "speed": 0,
                "up": false,
                "rx_errors": 0
            },
            "eth0": {
                "tx_pkts": 2731519,
                "rx_pkts": 8325448,
                "rx_bytes": 3224888514,
                "tx_bytes": 2116882740,
                "rx_peak_bps": 482729,
                "tx_peak_bps": 293857,
                "full_duplex": true,
                "speed": 1000,
                "up": true,
                "rx_errors": 0
            }
        },
        "lldp_stat": {
            "system_name": "TC2-OWL-Stack-01",
            "system_desc": "HP J9729A 2920-48G-POE+ Switch",
            "mgmt_addr": "10.1.5.2",
            "lldp_med_supported": false,
            "port_desc": "",
            "port_id": "",
            "power_request_count": 0,
            "power_allocated": 0,
            "power_draw": 0,
            "power_requested": 0
        },
        "l2tp_stat": {
        },
        "rx_bytes": 28558191,
        "rx_pkts": 214938,
        "tx_pkts": 49622392,
        "tx_bytes": 3760857173,
        "tx_bps": 0,
        "rx_bps": 0,
        "cpu_stat": {
            "system": 5,
            "idle": 81,
            "interrupt": 0,
            "user": 14,
            "load_avg": [
                0.14,
                0.23,
                0.24
            ]
        },
        "memory_stat": {
            "usage": 33
        },
    }
}

On this page