Monitoring Wireless Access Points running OpenWRT

From Wiki of H. Kurth Bemis
Jump to navigation Jump to search

It's nice to see what kind of resources your OpenWRT devices are using. This document outlines how to setup both mini_snmpd and snmpd on OpenWRT for monitoring purposes.

Using mini_snmpd

  1. Login to device using SSH
  2. Update opkg source
    root@WAP1:~# 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
    -----8<-------8<-------8<------
    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@WAP1:~#
    
  3. Install mini_snmpd package
    opkg install mini_snmpd
  4. Configure by editing the config file
    vi /etc/config/mini_snmpd
  5. Change the (sys)contact and (sys)location
  6. Ensure that mini_snmpd is enabled and running
    root@WAP1:~# /etc/init.d/mini_snmpd enable; /etc/init.d/mini_snmpd start
    

Notes

  • It looks like mini_snmpd doesn't output CPU info and some other info about memory usage and such. Not sure if it can be configured to do such. I was going to delve into it further but ran out of time and opted to go with the standard SNMP daemon below in place of mini_snmpd.

Using stock snmpd

  1. Login to device using SSH
  2. Remove mini_snmpd (if present)
    root@WAP1:~# opkg remove mini_snmpd
    Removing package mini_snmpd from root...
    Not deleting modified conffile /etc/config/mini_snmpd.
    root@WAP1:~#
    
  3. Update opkg sources
    root@WAP1:~# 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
    -----8<-------8<-------8<------
    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@WAP1:~#
    
  4. Install snmpd package
    root@WAP1:~# opkg install snmpd
    Installing snmpd (5.8-1) to root...
    Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/packages/snmpd_5.8-1_mips_24kc.ipk
    Installing libpci (3.6.2-3) to root...
    Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/packages/libpci_3.6.2-3_mips_24kc.ipk
    Installing libnetsnmp (5.8-1) to root...
    Downloading http://downloads.openwrt.org/releases/19.07.4/packages/mips_24kc/packages/libnetsnmp_5.8-1_mips_24kc.ipk
    Configuring libpci.
    Configuring libnetsnmp.
    Configuring snmpd.
    root@WAP1:~#
    
  5. Configure by editing the config file
    vi /etc/config/snmpd
    The file is mostly stock, except for the sysLocation, sysContact and sysName fields.
    agentaddress UDP:161,UDP6:161
    master agentx
    agentXSocket /var/run/agentx.sock
    sysLocation YOUR LOCATION NAME HERE     
    sysContact YOUR EMAIL ADDRESS
    sysName wap1
    com2sec ro default public
    com2sec rw localhost private
    com2sec6 ro default public
    com2sec6 rw localhost private
    group public v1 ro
    group public v2c ro
    group public usm ro
    group private v1 rw
    group private v2c rw
    group private usm rw
    view all included .1
    access public "" any noauth exact all none none
    access private "" any noauth exact all all all
    exec  filedescriptors /bin/cat /proc/sys/fs/file-nr
    engineIDType 3
    engineIDNic eth0
    
  6. Ensure that snmpd is enabled and running
    root@WAP1:~# /etc/init.d/snmpd enable; /etc/init.d/snmpd start
    

Notes