Config files and scripts for pulling ASUS router metrics into TIG stack via SNMP.
The implementation takes advantage of SNMP Extend to pull additional metrics (not covered by MIBs) through custom commands, as well as a shell script to pull wireless client metrics (second image) and push the data directly into InfluxDB.
Tested with ASUS RT-AX86U running Asuswrt-Merlin v386.1_2.
- Asuswrt-Merlin firmware installed on the router.
- SNMP enabled on router. (Menu: Administration -> SNMP)
- JFFS custom scripts and configs enabled on router. (Menu: Administration -> System -> Persistent JFFS2 partition -> Enable JFFS custom scripts and configs)
- Awareness of how to configure user scripts and scheduled tasks on router.
- TIG stack deployed.
- Router SNMP config append file to define SNMP Extend
- SNMP Extend shell scripts for pulling the following metrics on the router:
- Connection count
- Active connection count
- Admin web session - source IP of active/last session
- Admin web session - timestamp (returns a value when someone is logged in)
- Internet connection status
- JFFS partition usage (%)
- Number of active SSH sessions
- Number of processes running
- Temperature - CPU
- Temperature - 2.4 GHz Wireless Module
- Temperature - 5 GHz Wireless Module
- Wireless client count - 2.4 GHz
- Wireless client count - 5 GHz
- Shell script for pulling wireless client metrics and pushing the data directly into InfluxDB (in-memory processing on router)
- Grafana dashboard config files (use Flux to query InfluxDB)
- Telegraf router SNMP config
- Individual (per-metric) scripts are being used for SNMP Extend so as to avoid commands being run unnecessarily when the OIDs are being queried.
- The Telegraf config file I've based my config on is sourced from bretmlw. I've commented out everything that didn't return results for me, as well as things that I'm not planning on using near-term. I've also added comments to a number of OIDs from their respective MIBs for (hopefully) improved clarity.
- The shell script for gathering wireless client metrics is based on mod_wifi_clients.sh from corgan2222's excellent extstats add-on.