GL.iNet routers run OpenWRT, which has native Prometheus exporter packages and remote syslog support. This guide covers installing the Lua-based node exporter for metrics and forwarding syslog to Loki via Grafana Alloy — giving you full observability of your GL.iNet router.
Note: This guide is written for GL.iNet routers, but the same steps apply to any router running standard OpenWRT.
Prerequisites
- Grafana, Alloy, Prometheus, and Loki already running. See the Log Monitoring with Grafana Alloy and Loki post for the observability stack setup.
- A GL.iNet router set up as per the GL.iNet Travel Router Setup guide.
Metrics
Install the Prometheus Exporter
Connect to your router via SSH and install the exporter packages:
opkg update
opkg install prometheus-node-exporter-lua \
prometheus-node-exporter-lua-openwrt \
prometheus-node-exporter-lua-wifi \
prometheus-node-exporter-lua-wifi_stations \
prometheus-node-exporter-lua-netstat \
prometheus-node-exporter-lua-nat_traffic \
prometheus-node-exporter-lua-thermal \
prometheus-node-exporter-lua-hwmon \
prometheus-node-exporter-lua-uci_dhcp_hostAlternatively, install packages through Admin Panel → Applications → Plug-ins.
| Package | Description |
|---|---|
prometheus-node-exporter-lua | Core exporter — CPU, memory, disk, network |
prometheus-node-exporter-lua-openwrt | OpenWRT-specific metrics |
prometheus-node-exporter-lua-wifi | Wi-Fi interface statistics |
prometheus-node-exporter-lua-wifi_stations | Connected Wi-Fi client metrics |
prometheus-node-exporter-lua-netstat | TCP/UDP connection statistics |
prometheus-node-exporter-lua-nat_traffic | NAT traffic counters |
prometheus-node-exporter-lua-thermal | Thermal zone temperatures |
prometheus-node-exporter-lua-hwmon | Hardware sensor readings |
prometheus-node-exporter-lua-uci_dhcp_host | DHCP host information |
Enable the Exporter
By default the exporter only listens on localhost. Expose it on the LAN interface:
uci set prometheus-node-exporter-lua.main.listen_interface='lan'
uci set prometheus-node-exporter-lua.main.listen_port='9100'
uci commit prometheus-node-exporter-lua
/etc/init.d/prometheus-node-exporter-lua enable
/etc/init.d/prometheus-node-exporter-lua restartVerify from another machine on the same network:
curl http://192.168.8.1:9100/metricsAdd Prometheus Scrape Job
Add the following to your prometheus.yml, then restart Prometheus:
- job_name: 'glinet'
scrape_interval: 15s
static_configs:
- targets: ['192.168.8.1:9100']
labels:
router: glinetdocker restart prometheusUse the pre-built GL.iNet / OpenWRT Dashboard to visualize the metrics in Grafana.
Logs via Syslog
Configure GL.iNet
Via SSH
Replace 192.168.8.101 with the IP of your Alloy instance:
uci set system.@system[0].log_ip='192.168.8.101'
uci set system.@system[0].log_port='514'
uci set system.@system[0].log_proto='udp'
uci set system.@system[0].conloglevel='7'
uci commit system
/etc/init.d/log restartThe conloglevel controls verbosity: 7 = debug, 6 = info, 4 = warning, 3 = error.
Via LuCI
Tip: LuCI is not installed by default on GL.iNet routers. Enable it under Admin Panel → System → Advanced Settings.
- Navigate to System → System → Logging
- Set External system log server to your Alloy instance IP
- Set port to
514, protocol to UDP, log level to Info - Click Save & Apply
Configure Grafana Alloy
Create a new Alloy config file for GL.iNet syslog collection:
nano alloy/config/glinet-syslog.alloy/* GL.iNet Syslog (BSD/RFC3164) */
loki.relabel "glinet_syslog" {
forward_to = []
rule {
source_labels = ["__syslog_message_hostname"]
target_label = "host"
}
rule {
source_labels = ["__syslog_message_app_name"]
target_label = "service_name"
}
rule {
source_labels = ["__syslog_message_severity"]
target_label = "detected_level"
}
}
loki.source.syslog "glinet" {
listener {
address = "0.0.0.0:514"
protocol = "udp"
syslog_format = "rfc3164"
use_incoming_timestamp = false
labels = {
job = "glinet",
}
}
relabel_rules = loki.relabel.glinet_syslog.rules
forward_to = [loki.write.default.receiver]
}Restart Alloy to load the new configuration:
docker restart alloyVerification
Metrics — Query in Grafana to confirm data is flowing:
node_cpu_seconds_total{router="glinet"}Logs — Query in Grafana’s Explore view:
{job="glinet"}
