RRDTool存档仅存储NaN

时间:2015-08-15 07:08:53

标签: raspberry-pi2 rrdtool iot rrd

我在raspberry Pi上有一个RRDB。 rrdb是使用

创建的
//RRA1: Archive point is saved every 5min, archive is kept for 1hour back. 
//RRA2-4: Archive point is saved every 1hour, archive is kept for 30day back.
//RRA5: Archive point is saved every 3hour, archive is kept for 1year back.
//RRA6-8: Archive point is saved every 1day, archive is kept for 5year back. 

 rrdtool create %s%s \
--step '300' \
--start '1438387200' \
'DS:temp:GAUGE:600:0:100' \
'DS:humidity:GAUGE:600:10:100' \
'DS:dewpoint:GAUGE:600:-60:100' \
'RRA:LAST:0.5:1:1' \
'RRA:AVERAGE:0.5:1:12' \
'RRA:MIN:0.5:12:720' \
'RRA:MAX:0.5:12:720' \
'RRA:MIN:0.5:12:720' \
'RRA:AVERAGE:0.5:36:2920' \
'RRA:MIN:0.5:288:1825' \
'RRA:MAX:0.5:288:1825' \
'RRA:AVERAGE:0.5:288:1825'

rrdb每5分钟更新一次,由c program更新,由cronjob触发。

rrdtool updatev dht11.rrd 1439622104:27.000000:44.000000:13.692617

rrdb将其最后设置的值设置为

验证
rrdtool lastupdate dht11.rrd
 temp humidity dewpoint

1439622104: 27.000000 44.000000 13.692617

但RRA(档案)都没有得到更新。他们都还有NaN。

 rrdtool xport -s now-1h -e now DEF:a=/dht11.rrd:temp:AVERAGE XPORT:a:"Livingroom"
<?xml version="1.0" encoding="ISO-8859-1"?>

<xport>
  <meta>
    <start>1439619000</start>
    <step>300</step>
    <end>1439619000</end>
    <rows>13</rows>
    <columns>1</columns>
    <legend>
      <entry>Livingroom</entry>
    </legend>
  </meta>
  <data>
    <row><t>1439619000</t><v>NaN</v></row>
    <row><t>1439619300</t><v>NaN</v></row>
    <row><t>1439619600</t><v>NaN</v></row>
    <row><t>1439619900</t><v>NaN</v></row>
    <row><t>1439620200</t><v>NaN</v></row>
    <row><t>1439620500</t><v>NaN</v></row>
    <row><t>1439620800</t><v>NaN</v></row>
    <row><t>1439621100</t><v>NaN</v></row>
    <row><t>1439621400</t><v>NaN</v></row>
    <row><t>1439621700</t><v>NaN</v></row>
    <row><t>1439622000</t><v>NaN</v></row>
    <row><t>1439622300</t><v>NaN</v></row>
    <row><t>1439622600</t><v>NaN</v></row>
  </data>
</xport>

任何想法,我做错了,以及有关更新RRA的任何提示?

0 个答案:

没有答案