In my effort to monitor all the things, I found that i needed better reporting from my OpenWRT-based devices. It’s a pretty painless process.
How To
First, hit up ya device using SSH and login.
kurth@wrks:~$ ssh root@192.168.XXX.XXX
root@192.168.XXX.XXX's password:
BusyBox v1.30.1 () built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 19.07.4, r11208-ce6496d796
-----------------------------------------------------
root@CTTWAP1:~#
Once logged in, update ensure the package manager is updated
root@CTTWAP1:~# opkg update
Downloading http://downloads.openwrt.org/releases/19.07.4/targets/ath79/generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/releases/19.07.4/targets/ath79/generic/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.4/targets/ath79/generic/kmods/4.14.195-1-b84a5a29b1d5ae1dc33ccf9ba292ca1d/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_kmods
Downloading http://downloads.openwrt.org/releases/19.07.4/targets/ath79/generic/kmods/4.14.195-1-b84a5a29b1d5ae1dc33ccf9ba292ca1d/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/base/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/luci/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/routing/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/telephony/Packages.sig
Signature check passed.
root@CTTWAP1:~#
Install mini_snmpd
root@CTTWAP1:~# opkg install mini_snmpd
Installing mini_snmpd (1.4-rc1-4) to root...
Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/packages/mini_snmpd_1.4-rc1-4_mips_24kc.ipk
Configuring mini_snmpd.
root@CTTWAP1:~#
Now we edit the /etc/config/mini_snmpd
config file. My completed file looks like this
config mini_snmpd 'default'
option enabled 1
option ipv6 0
option debug 0
option auth 0
option community 'public'
option contact 'Kurth Bemis <kurth@XXXXXXXX.com>'
option location 'LOCATION NAME HERE'
option listen_interface 'lan'
#option udp_port '161'
#option tcp_port '161'
#option vendor_oid ''
option mib_timeout 1
list disks '/overlay'
list disks '/tmp'
list interfaces 'lan'
list interfaces 'wan'
As you can see, it’s mostly ready to go out of the box. (To exit vi use :wq)
Now we just need to ensure the service is enabled
root@CTTWAP1:~# /etc/init.d/mini_snmpd enable
…and to make sure the daemon is running.
root@CTTWAP1:~# /etc/init.d/mini_snmpd start
To setup monitoring, I pointed LibreNMS to the IP address of the AP. Within a few minutes I had graphs rolling.
Notes
I would normally use snmpd for my snmp needs on Linux/BSD systems and devices, however I had heard good things about mini_snmpd relating to size and speed and it being designed and build for embedded systems. We’ll see how it compares to the standard snmpd.
Resources
https://wiki.kurthbemis.com/index.php?title=Monitoring_Wireless_Access_Points_running_OpenWRT