0

I wrote a simple rrdtool database to graph Wi-Fi signal strength and modulation. The signal strength works, but when I try to update the db with MCS information, I get:

ERROR: ./somefile.rrd: expected 2 data source readings (got 1) from mcsul15

Here's my update code:

rssi=`snmpget -v 2c -c communityname 1.2.3.4 .1.3.6.1.4.1.17713.21.1.2.3.0 | awk -v x=4 '{print $x}' | tr -d -`
noisefloor=`snmpget -v 2c -c communityname 1.2.3.4 .1.3.6.1.4.1.17713.21.1.2.20.1.9.1 | awk -v x=4 '{print $x}' | tr -d -`
ulmcs14=`snmpget -v 2c -c communityname 1.2.3.4 CAMBIUM-PMP80211-MIB::ulWLanMCS14Packets.0 | awk -v x=4 '{print $x}'`
ulmcs15=`snmpget -v 2c -c communityname 1.2.3.4 CAMBIUM-PMP80211-MIB::ulWLanMCS15Packets.0 | awk -v x=4 '{print $x}'`
echo $rssi
echo $noisefloor
echo $ulmcs14
echo $ulmcs15
rrdtool update ./somefile.rrd --template \
    rssi:noisefloor N:$rssi:$noisefloor \
    mcsul15:mcsul14 N:$ulmcs15:$ulmcs14

Which gives me:

68
94
143679
17602658
ERROR: ./somefile.rrd: expected 2 data source readings (got 1) from mcsul15

What am I missing?

batflaps
  • 261
  • 3
  • 12

1 Answers1

1

Assuming that somefile.rrd has 4 DS defined in it with those 4 names, you should give all four together when updating. You can only specify one template for the update, and the other parameters should be in that format.

Also, check the names of your DS are correct as your variable is called $ulmcs15 but the DS is being named mcsul15.

rrdtool update ./somefile.rrd --template \
  rssi:noisefloor:mcsul15:mcsul14 \
  N:$rssi:$noisefloor:$ulmcs15:$ulmcs14

The error message is because in your original commandline, mcsul15:mcsul14 is being taken as an update vector, not a template. Thus it is one timestamp and one value, where two were expected. It would have been a better error message to say something like "timestamp not recognised in 'mcsul15'" but that's a different issue...

Steve Shipway
  • 3,754
  • 3
  • 22
  • 39