When performing the SNMPGet, Cacti retrieves a wrong value : 21088 whereas the right one we get though an external snmpget command is 5260 (this is a 802.11an frequency (MHz) on a device running OpenWrt).
A workaround I found is to make the snmp exec called script on host provide a negative value, it is then correctly retrieved by Cacti.
- Here are Cacti detailed logs :
Wrong :
Code: Select all
POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/host_wl_ap_freq_1545.rrd --template wl_ap_freq 1281357006:21088
SPINE: Poller[0] Host[72] TH[1] DS[1545] SNMP: v2: 192.168.0.245, dsname: wl_ap_freq, oid: 1.3.6.1.3.1981.80.91.101.1, value: 21088
Code: Select all
POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/host_wl_ap_freq_1537.rrd --template wl_ap_freq 1281357006:-5260
SPINE: Poller[0] Host[72] TH[1] DS[1537] SNMP: v2: 192.168.0.245, dsname: wl_ap_freq, oid: 1.3.6.1.3.1981.80.7.101.1, value: -5260
Code: Select all
1.3.6.1.3.1981.80.91.1.1 = INTEGER: 1
1.3.6.1.3.1981.80.91.2.1 = STRING: "get-test-ap-freq-0"
1.3.6.1.3.1981.80.91.3.1 = STRING: "/usr/local/bin/get-test-ap-freq.sh wlan0"
1.3.6.1.3.1981.80.91.100.1 = INTEGER: 0
1.3.6.1.3.1981.80.91.101.1 = STRING: "5260"
1.3.6.1.3.1981.80.91.102.1 = INTEGER: 0
1.3.6.1.3.1981.80.91.103.1 = ""
Code: Select all
# cat get-test-ap-freq.sh
#!/bin/sh
# $1 = wlan interface name
val=$(iw dev $1 survey dump | grep frequency | cut -d':' -f2 | cut -d' '
-f1)
printf "%d\n" $val