Setting up SNMP on OpenWRT is both a patience and exasperating experience...
Half-time you don't know why everything has to be so hard to do...
This post is a base on which to build SNMP data.
First of all install the required packages
https://github.com/librenms/librenms-agent/tree/master/snmp/Openwrt
copy all files to the openwrt device in /etc/librenms
assign the executable property with:
chown +x ./*
create the following file /usr/bin/distro
Half-time you don't know why everything has to be so hard to do...
This post is a base on which to build SNMP data.
First of all install the required packages
- snmpd
- luci-app-snmpd
- iwinfo
https://github.com/librenms/librenms-agent/tree/master/snmp/Openwrt
copy all files to the openwrt device in /etc/librenms
assign the executable property with:
chown +x ./*
create the following file /usr/bin/distro
- #!/bin/ash
[ -f /etc/openwrt_release ] && source /etc/openwrt_release echo ${DISTRIB_ID} ${DISTRIB_RELEASE} ${DISTRIB_REVISION}
edit the file "/etc/librenms/wlInterfaces.txt"
NOTE: you need to get the interface name and SSID from "/etc/config/wireless", replace accordingly
- radio0,WirelessLAN
- radio1,WirelessLAN
- wifinetXX,WirelessLAN123
edit the file "/etc/config/snmpd"
NOTE: you need to replace "replace_wlan_int" withe the interface name from "/etc/librenms/wlInterfaces.txt", replace for each configured SSID.
config exec
option name distro
option prog /usr/bin/distro
option miboid .1.3.6.1.4.1.2021.7890.1
config extend
option name interfacesoption prog "/bin/cat /etc/librenms/wlInterfaces.txt"config extendoption name clients-"replace_wlan_int"option prog "/etc/librenms/wlClients.sh "replace_wlan_int""config extendoption name frequency-"replace_wlan_int"option prog "/etc/librenms/wlFrequency.sh "replace_wlan_int""config extendoption name rate-tx-"replace_wlan_int"-minoption prog "/etc/librenms/wlRate.sh "replace_wlan_int" tx min"config extendoption name rate-tx-"replace_wlan_int"-avgoption prog "/etc/librenms/wlRate.sh "replace_wlan_int" tx avg"config extendoption name rate-tx-"replace_wlan_int"-maxoption prog "/etc/librenms/wlRate.sh "replace_wlan_int" tx max"config extendoption name rate-rx-"replace_wlan_int"-minoption prog "/etc/librenms/wlRate.sh "replace_wlan_int" rx min"config extendoption name rate-rx-"replace_wlan_int"-avgoption prog "/etc/librenms/wlRate.sh "replace_wlan_int" rx avg"config extendoption name rate-rx-"replace_wlan_int"-maxoption prog "/etc/librenms/wlRate.sh "replace_wlan_int" rx max"config extendoption name noise-floor-"replace_wlan_int"option prog "/etc/librenms/wlNoiseFloor.sh "replace_wlan_int""config extendoption name snr-"replace_wlan_int"-minoption prog "/etc/librenms/wlSNR.sh "replace_wlan_int" min"config extendoption name snr-"replace_wlan_int"-avgoption prog "/etc/librenms/wlSNR.sh "replace_wlan_int" avg"config extendoption name snr-"replace_wlan_int"-maxoption prog "/etc/librenms/wlSNR.sh "replace_wlan_int" max"
There are other changes like the SNMP community, security, version but hopefully this gets you up and running...
Note: Don't forget to add the files to the backed up list, so you can download a working backup setup.
Source: Snmp “extend” to OpenWrt Meraki MR33
Comments
Post a Comment