What is the monitoring stack for GLiNet Routers?

I would like to monitor my router for general metrics (CPU and RAM usage, I/O reads/writes, temperature, … etc.). The dashboards at the router UI and Goodcloud offer an excellent view, and also the alerting feature in GoodCloud is handy.

I would like to grab these metrics and route them to my monitoring solution. Currently, I do not know from where does the router UI or Goodcloud get the metrics. Do you use SNMP ? Prometheus ? Is this documented anywhere ?

If there is no document or an open-source solution you use, Is there an SDK I can use to access these programatically ?

Regards.
Relevant posts I viewed:

Will it work if call API locally like this:

curl -H 'glinet: 1' -s -k http://127.0.0.1/rpc -d '{"jsonrpc":"2.0","method":"call","params":["","ovpn-client","get_status",{}],"id":1}'

Hello,

The API call succeeds. Here is a sample output:

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "rx_bytes": 463648031,
    "log": "",
    "tx_bytes": 42043922,
    "domain": "xxxx",
    "group_id": 5178,
    "port": 1234,
    "name": "NordVPN",
    "status": 1,
    "client_id": 1,
    "ipv4": "10.xxx.xxx.xxx"
  }
}

But I want device metrics (CPU and RAM usage, temperature, I/O, … etc.), not openVPN status

No. No. API doc is not yet publically available. Most API use lua, you check /usr/lib/oui-httpd/rpc/

This API will return CPU and RAM. And you can use F12 to find your wanted info.

curl -H 'glinet: 1' -s -k http://127.0.0.1/rpc -d  '{"jsonrpc":"2.0","id":41,"method":"call","params":["NsPHdkXtENoaotxVZWLqJorU52O7J0OI","system","get_status",{}]}'
2 Likes

Thanks Han, I will give this a try and report back with what I found (so that others may find this useful)

Hi @hob
I noticed you tagged one of my question posts on here.

Just wanted to let you know that I found a workaround to my original post although it isn’t a perfect solution.

The two that I found useful were LibreNMS/Observium & NtopNG custom community edition. Both running in docker containers.

Observium is SNMP, and Ntop is Softflowd.

You may also have some luck with something like Netdata.

Good luck on your journey! Let me know if you want more info?

1 Like

Interesting discussions.
I tried various solutions, like

Grafana + Prometheus (installed on PI4) + Lua scripts on OpenWRT
Zabbix
Checkmk
Collectd

but actually I'm using LibreNMS + SNMP and I'm good with that.
There are also other services useful for monitoring WAN connection: kuma, uptimerobot etc.etc.

NAturally it depends what you want to monitors: metrics or hardware issue, sla etc etc.

What do you use?

1 Like

Thank you for pointing me in the right direction.
This worked on my XE300-EP06-E (v 4.3.18):

root@GL-XE300:~# curl -H 'glinet: 1' -s  http://127.0.0.1/rpc -d  '{"method":"call","params":["","system","get_status",{}]}' | jq '.result.system.mcu.charging_status'
0
root@GL-XE300:~# curl -H 'glinet: 1' -s  http://127.0.0.1/rpc -d  '{"method":"call","params":["","system","get_status",{}]}' | jq '.result.system.mcu.charge_percent'
51


This also worked, without the need to fetch it from the rpc endpoint:

root@GL-XE300:~# ubus call mcu status
{
        "charge_cnt": "0",
        "temperature": "37.3",
        "charge_percent": "33",
        "charging_status": "0"
}

ref: [OpenWrt Wiki] ubus (OpenWrt micro bus architecture)

2 Likes