创建数据库文件命令如下:
sudo rrdtool create eth0.rrd \ ~/rrdtool-1.7.2/xxx@bmc
--start $(date -d "now" +%s) \
--step 300 \
DS:eth0_in:GAUGE:600:0:5000 \
DS:eth0_out:GAUGE:600:0:5000 \
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:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:444:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:444:797
更新数据库,脚本test.sh内容如下:
starttime=`date +%s`
endtime=`echo "$starttime+3153"|bc`
while true
do
sleep 3
rrdtool update eth0.rrd starttime:$RANDOM $endtime:$RANDOM
done
执行结果:
> sudo ./test.sh ~/rrdtool-1.7.2/xxx@bmc
ERROR: eth0.rrd: expected 2 data source readings (got 1) from 1602294963
ERROR: eth0.rrd: expected 2 data source readings (got 1) from 1602294963
ERROR: eth0.rrd: expected 2 data source readings (got 1) from 1602294963
ERROR: eth0.rrd: expected 2 data source readings (got 1) from 1602294963
^C
>
网上查资料:
测试结果:
> sudo rrdtool update eth0.rrd 1381467942:60723022 ~/rrdtool-1.7.2/xxx@bmc
ERROR: eth0.rrd: expected 2 data source readings (got 1) from 1381467942
>
请问这种问题如何解决?