rrdtool fetch命令总是返回-nan值

时间:2017-06-16 16:01:47

标签: rrdtool

我有一个rrd文件, rrdtool info 的输出如下:

$rrdtool info ifInOctets.rrd 
filename = "ifInOctets.rrd"
rrd_version = "0003"
step = 300
last_update = 1497312000
header_size = 1416
ds[ifInOctets].index = 0
ds[ifInOctets].type = "COUNTER"
ds[ifInOctets].minimal_heartbeat = 900
ds[ifInOctets].min = 0.0000000000e+00
ds[ifInOctets].max = 9.9999999990e+09
ds[ifInOctets].last_ds = "3.4019552910E+09"
ds[ifInOctets].value = 8.1322780295e+08
ds[ifInOctets].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 2016
rra[0].cur_row = 1544
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 1488
rra[1].cur_row = 754
rra[1].pdp_per_row = 12
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 1.0418342945e+08
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[2].cf = "AVERAGE"
rra[2].rows = 366
rra[2].cur_row = 84
rra[2].pdp_per_row = 288
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 1.1808838469e+09
rra[2].cdp_prep[0].unknown_datapoints = 0
rra[3].cf = "MAX"
rra[3].rows = 366
rra[3].cur_row = 29
rra[3].pdp_per_row = 288
rra[3].xff = 5.0000000000e-01
rra[3].cdp_prep[0].value = 1.3983258476e+07
rra[3].cdp_prep[0].unknown_datapoints = 0
rra[4].cf = "MIN"
rra[4].rows = 366
rra[4].cur_row = 101
rra[4].pdp_per_row = 288
rra[4].xff = 5.0000000000e-01
rra[4].cdp_prep[0].value = 5.7478020724e+05
rra[4].cdp_prep[0].unknown_datapoints = 0 

数据的XML导出看起来(部分)如:

 <!-- Tue Jun 06 10:00:00 EDT 2017 / 1496757600 -->
 <row>
 <v>+6.3341370319E06</v>
 </row>
 <!-- Tue Jun 06 10:05:00 EDT 2017 / 1496757900 -->
 <row>
 <v>+3.0319877350E06</v>
 </row>
 <!-- Tue Jun 06 10:10:00 EDT 2017 / 1496758200 -->
 <row>
 <v>+9.8097124846E06</v>
 </row>
 <!-- Tue Jun 06 10:15:00 EDT 2017 / 1496758500 -->
 <row>
 <v>+1.0005290356E07</v>
 </row>
 <!-- Tue Jun 06 10:20:00 EDT 2017 / 1496758800 -->
 <row>

但由于某些原因,rrdtool将输出的所有内容都是

$rrdtool fetch ifInOctets.rrd AVERAGE
                     ifInOctets

1497541500: -nan
1497541800: -nan
1497542100: -nan
1497542400: -nan
1497542700: -nan

到目前为止,我已经尝试调整最小值,最大值和步数,但到目前为止我没有运气。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

这是因为您尚未定义resolutionstartend的值。

来自rrdtool用法,

Usage: rrdtool [options] command command_options
* fetch - fetch data out of an RRD

    rrdtool fetch filename.rrd CF
        [-r|--resolution resolution]
        [-s|--start start] [-e|--end end]
        [-a|--align-start]
        [-d|--daemon <address>]

这将有效,

rrdtool fetch ifInOctets.rrd AVERAGE -r 300 -s 1496757600 -e 1496758800