Ticket #273 (closed defect: for support check mailinglist)
Value integrated from a numerical string is wrong
| Reported by: | human | Owned by: | oetiker |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | rrd_update | Version: | 1.4.3 |
| Keywords: | exec snmp ucd string | Cc: | glr@… |
Description
In Cacti, I have a data retrieved through SNMP from a Net-SNMP/UCD exec command. This data which is actually a number is retrieved as a string (see OID .1.3.6.1.4.1.2021.8.1.101 - extOutput - in UCD-MIB extTable branch, its data type is string).
For any reason I don't understand, when I retrieve a value such as 5260 (this is a 802.11an frequency (MHz) on an device running OpenWrt?), I don't get it right in the RRA file but get instead the value 21088.
The workaround I found is to provide a negative value which is then integrated correctly as such in the RRA file.
- snmpwalk output (OIDs truncated) :
91.1.1 = INTEGER: 1
91.2.1 = STRING: "get-test-ap-freq-0"
91.3.1 = STRING: "/usr/local/bin/get-test-ap-freq.sh wlan0"
91.100.1 = INTEGER: 0
91.101.1 = STRING: "5260"
91.102.1 = INTEGER: 0
91.103.1 = ""
- Script called by exec in the polled device :
# 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
Change History
comment:1 Changed 18 months ago by oetiker
- Status changed from new to closed
- Resolution set to for support check mailinglist
comment:2 Changed 18 months ago by human
Yes, it is GAUGE
rrdtool create freq.rrd --step 300 DS:wl_ap_freq:GAUGE:600:-100000:100000 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797 RRA:LAST:0.5:1:600 RRA:LAST:0.5:6:700 RRA:LAST:0.5:24:775 RRA:LAST:0.5:288:797
Cacti poller detailed logs provide :
POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /usr/share/cacti/rra/host_wl_ap_freq_1537.rrd --template wl_ap_freq 1281357006:-5260
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
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
As the entry value is already wrong, this is indeed certainly not related to RRDtool.
Sorry for the disturb.



ok, make sure to use a GAUGE type RRA for such a type of data ... if you think rrdtool is doing anything wrong, please provide a commandline example of what you put in and how you configured the datasources.