Write a data every 10 seconds, but read it out and write it in a different way, solve
The following libraries are created:
./bin/rrdtool Create data/test.rrd--start 1365756520--step ds:myds:gauge:100:0:u rra:last:0.5:1:100000
Write Data
./bin/rrdtool Updatev data/test.rrd-t myds n:1028
Read data
./bin/rrdtool Fetch DATA/TEST.RRD last-s 1365756520
return [1365766390]rra[average][1]ds[myds] = 1.0256558852e+03
What is the situation, as if the average is being averaged??
Reply to discussion (solution)
Who's going to answer that?
[1365766390] rra[Average][1]ds[myds] = 1.0256558852e+03
AVERAGE Average
That's what you want, isn't it?
But I/bin/rrdtool fetch DATA/TEST.RRD last-s 1365756520
Fetch is last.
[Root@localhost shm]#/usr/local/rrdtool/bin/rrdtool Create Test.rrd--step ds:myds:gauge:100:0:u. 5:1:100000[root@localhost shm]#/usr/local/rrdtool/bin/rrdtool Updatev test.rrd-t myds N:1028return_value = 0[ 1365991710]rra[last][1]ds[myds] = 1.0280000000e+03[root@localhost shm]#/usr/local/rrdtool/bin/rrdtool Fetch TEST.RRD Last | Grep-v nan myds1365991710:1.0280000000e+03[root@localhost shm]#/usr/local/rrdtool/bin/rrdtool-vrrdtool 1.4.7 Copyright 1997-2012 by Tobias Oetiker
Compiled Jul 5 15:34:45
I test here ... There is no such problem ...
And very strange, according to your create statement, is not supposed to exist average this CF, is not you on this test.rrd and other parts of the operation?
[Root@localhost shm]#/usr/local/rrdtool/bin/rrdtool Create Test.rrd--step ds:myds:gauge:100:0:u. 5:1:100000[root@localhost shm]#/usr/local/rrdtool/bin/rrdtool info test.rrd filename = "test.rrd" rrd_version = "0003" Step = 10last_update = 1365991934header_size = 584ds[myds].index = 0ds[myds].type = "GAUGE" ds[myds].minimal_heartbeat = 10 0ds[myds].min = 0.0000000000e+00ds[myds].max = Nands[myds].last_ds = "U" Ds[myds].value = 0.0000000000e+00ds[myds]. Unknown_sec = 4RRA[0].CF = "last" rra[0].rows = 100000rra[0].cur_row = 82401rra[0].pdp_per_row = 1rra[0].xff = 5.0000000000 E-01rra[0].cdp_prep[0].value = nanrra[0].cdp_prep[0].unknown_datapoints = 0
In addition, there is a situation, about the historical data will be how to deal with this to test the next look ... But I don't think it's right for you to create a combined average.
This, the previous data update is normal, but the latter is a mess,
And very strange, according to your create statement, is not supposed to exist average this CF, is not you on this test.rrd and other parts of the operation?
PHP code?12345678910111213141516171819202122[root@localhost shm]#/usr/local/rrdtool/bin/rrdtool Create Test.rrd-- St......
Actually I want to use it as a database, what data to deposit, and what data to take out
[Root@localhost rrdtool]#./bin/rrdtool Updatev data/test.rrd-t myds n:1028
Return_value = 0
[ 1366011870] Rra[last][1]ds[myds] = 1.0011771028e+03
[ 1366011890] Rra[last][1]ds[myds] = 1.0011771028e+03
[Root@localhost rrdtool]#
The more depressing is, why return two lines, two time cut?
Try again, the situation is still
./bin/rrdtool Create data/test.rrd--start 1365768603--step ds:myds:gauge:100:0:u rra:last:0.5:1:100000
./bin/rrdtool Updatev data/test.rrd-t myds n:1028
./bin/rrdtool Updatev data/test.rrd-t myds n:102
[Root@localhost rrdtool]#./bin/rrdtool Updatev data/test.rrd-t myds n:76
Return_value = 0
[1366095920] Rra[last][1]ds[myds] = 7.3762737333e+01
[1366095940] Rra[last][1]ds[myds] = 7.3762737333e+01
------Below are info content----
[Root@localhost rrdtool]#./bin/rrdtool Info DATA/TEST.RRD
filename = "DATA/TEST.RRD"
Rrd_version = "0003"
Step = 10
Last_update = 1366095930
Header_size = 584
Ds[myds].index = 0
Ds[myds].type = "GAUGE"
Ds[myds].minimal_heartbeat = 100
Ds[myds].min = 0.0000000000e+00
Ds[myds].max = NaN
Ds[myds].last_ds = "76"
Ds[myds].value = 5.9394532000e+01
ds[myds].unknown_sec = 0
RRA[0].CF = "Last"
Rra[0].rows = 100000
Rra[0].cur_row = 79575
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
Someone answered no ...
Solving........