Adding Monitoring to the Asus AX86U Router

Using Node Exporter + Prometheus + Grafana to add monitoring to the Asus AX86U. There are two reasons for setting this up: first, to understand how Prometheus works; second, to try monitoring the network devices at home.

Node Exporter: A tool for collecting Linux/UNIX hardware and OS metrics, exposing them via HTTP.
Prometheus: An open-source system monitoring and alerting toolkit.
Grafana: Query, visualize metrics, and manage alerts.

Installing Node Exporter

The Asus AX86U uses an ARMv8 architecture. Tested and confirmed: the ARMv7 binary works fine.

1
2
3
4
5
6
7
8
wget https://github.com/prometheus/node_exporter/releases/download/v1.1.2/node_exporter-1.1.2.linux-armv7.tar.gz
tar xzvf node_exporter-1.1.2.linux-armv7.tar.gz
mkdir -p /jffs/bin/
cp node_exporter-1.1.2.linux-armv7/node_exporter /jffs/bin/

echo "cru a \"node_exporter\" \"*/1 * * * * ps | grep node_exporter | grep -v -q grep || /jffs/bin/node_exporter\"" >> /jffs/scripts/services-start

reboot

Once Node Exporter is successfully installed, access port 9100 on the router. If your router’s IP is 192.168.1.1, visit http://192.168.1.1:9100/metrics and you should see output similar to the following.

Node Exporter

Seeing this output means Node Exporter has been installed successfully.

A few notes:

  1. The binary used here is a direct Linux binary package, so it is relatively large — around 16 MB. This may be a problem for anyone with limited JFFS storage space.
  2. The data collected is Linux OS data, so a lot of the metrics are unnecessary for a router, while some router-specific metrics are missing. I may find time later to DIY a custom version.

Installing Prometheus

Initially I planned to spin up a dedicated VM to run Prometheus, but decided that was overkill. My final solution was to run it in a container on a Synology DS216+II.

The configuration file is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
- scheme: http
timeout: 10s
api_version: v1
static_configs:
- targets: []
scrape_configs:
- job_name: prometheus
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- localhost:9090
- job_name: asuswrt
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
- targets:
- 192.168.1.1:9100

Prometheus

Installing Grafana

I used an existing Grafana instance to display the router information.

Below is a custom dashboard I built.

Grafana

If you prefer not to build your own, you can use these ready-made dashboards:

https://grafana.com/grafana/dashboards/13978

https://grafana.com/grafana/dashboards/1860