html tool

2017年11月16日星期四

从 RRD 文件中提取数据

http://blog.sina.com.cn/s/blog_4853c94e010008lk.html


RRD 是 Round Robin Database 的意思,那么是否可以象普通的数据库进行查询操作呢?
[popexizhi: 之前一直用log,csv ,sqlite ,看来rrd才是正解:) ]
答案是可以的。fetch 就是用来做这种事情的工具。当然 fetch 不能和 select 语句相比,它只是根据用户指定的时间



实例一 :默认情况

[root@dns1 bob]# rrdtool fetch eth0.rrd AVERAGE |more 
                        eth0_in            eth0_out 

1164467700: 1.1337243905e+01 9.6323712631e-02 
1164468000: 1.7896453039e+01 0.0000000000e+00 
1164468300: 1.8469136234e+01 1.2215723119e+00 
。。。。(中间省略) 
1164553800: 6.9634610564e+01 4.9644415243e+01 
1164554100: nan nan 

没有评论:

发表评论