rrdtool学习系列-3

今天这讲非常简单,就是如何更新(图)库文件!!虽然功能很简单,但这是出图很重要的一步,这步有问题,图根本就出不来。

rrdtool update demo1.rrd N:3.44:3.15:U:23
Update the database file demo1.rrd with 3 known and one UNKNOWN value. Use the current time as the update time.

rrdtool update demo2.rrd 887457267:U 887457521:22 887457903:2.7
Update the database file demo2.rrd which expects data from a single data-source, three times. First with an UNKNOWN value then with two regular readings. The update interval seems to be around 300 seconds

就这四句话,第1、3句是例子,2,4句是解释

N代表当前时间,U代表unknown数据;在第二个例子中,你要知道
887457267:U 887457521:22 887457903:2.7
标记为红色字体的这些数值都是时间,后面是插入的数据,就够了,很简单,而我们一般写shell的时候都用N来更新数据源,方便。大家消化消化,有什么问题可以在评论上写。

原创文章,转载请注明: 转载自混沌

本文链接地址: rrdtool学习系列-3