RRDTOOL and custom data

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

RRDTOOL and custom data

franky
I'm trying to use rrdtool to make some graphs. But it's not working as i wanted...

Here is the situation:

I have a file with data that are collected every 30 seconds but i can access this file only the day after. For example if i want to graph Tuesday data, i have to wait Wednesday morning. So what i have done is to create a new database with these information:

rrdtool create filename.rrd --step '30' 'DS:t634:GAUGE:60:U:U' 'RRA:AVERAGE:0.5:1:1000'

collected data:

rrdtool update filename.rrd 1390231080:1
rrdtool update filename.rrd 1390231110:2
rrdtool update filename.rrd 1390231140:3
rrdtool update filename.rrd 1390231170:4
....

generated a graph:

rrdtool graph 'graph.png' --width '400' --height '100' 'DEF:T634=filename.rrd:t634:AVERAGE' 'LINE1:T634#0000FF:T634'

I have a graph with no line on it...

Is my rrd file creation false?

Thanks in advance for your help!
Reply | Threaded
Open this post in threaded view
|

Re: RRDTOOL and custom data

Simon Hobson
franky <[hidden email]> wrote:

> I'm trying to use rrdtool to make some graphs. But it's not working as i
> wanted...
>
> Here is the situation:
>
> I have a file with data that are collected every 30 seconds but i can access
> this file only the day after. For example if i want to graph Tuesday data, i
> have to wait Wednesday morning. So what i have done is to create a new
> database with these information:
>
>
>
> collected data:
>
>
>
> generated a graph:
>
>
>
> I have a graph with no line on it...
>
> Is my rrd file creation false?

So you created an unspecified rrd file, did something unspecified, and the unspecified results don't look like the unspecified results you expected - and we're supposed to know what went wrong !


In general, there is no problem handling this sort of data collection - but there are some catches to be aware of. RRD doesn't actually care when teh data was collected, only the timestamp you give it when you update it. So there's no problem collecting data for a day, then inserting it into the RRD the next day - provided you have timestamps with the data. Basically the workflow goes something like this :

when a new file arrives : for each data entry, update the RRD using the timestamp that goes with the data

After this is done, any tools that access the data (graph, export, etc) will see the new data. So if you plot graphs, then during a day you'd see a bigger and bigger gap at the end due to missing data. Then once the next file has been inserted, the graphs will catch up. You don't ned to do anything special for plotting the graphs - other than allowing for the fact that you can expect missing data for some of the time.

If the data files themselves don't timestamp the data then you'll need to synthesise it somehow. Eg, you might work on the basis that the first record is at midnight and increase a counter by 30 for each subsequent record. In general this isn't reliable - what happens if the collection service is down for a short time ? You'll have gaps in the data but wouldn't know about it later and would time shift the following data to leave a gap at the end of the day.

The scripts for collecting, storing, and inserting the data are your responsibility.

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: RRDTOOL and custom data

franky
In reply to this post by franky
Hello Simon,

Thank you for your response.
I see that the raw lines inserted don't appear in the text...

So there we are:

creation:
rrdtool create filename.rrd --step '30' 'DS:t634:GAUGE:60:U:U' 'RRA:AVERAGE:0.5:1:1000'

updating:
rrdtool update filename.rrd 1390231080:1
rrdtool update filename.rrd 1390231110:2
rrdtool update filename.rrd 1390231140:3
rrdtool update filename.rrd 1390231170:4
...

graph:
rrdtool graph 'graph.png' --width '400' --height '100' 'DEF:T634=filename.rrd:t634:AVERAGE' 'LINE1:T634#0000FF:T634'

I have a bash script that reads line by line my data file and for each line create an rrdtool update with timestamp and value
Reply | Threaded
Open this post in threaded view
|

Re: RRDTOOL and custom data

Simon Hobson
franky <[hidden email]> wrote:

> graph:
> rrdtool graph 'graph.png' --width '400' --height '100'
> 'DEF:T634=filename.rrd:t634:AVERAGE' 'LINE1:T634#0000FF:T634'

You could try specifying start and end times.

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: RRDTOOL and custom data

David OBrien
You could also "tail" the file while it's being created and generate the data insertions in real timeĀ 


On Wed, Jan 22, 2014 at 9:08 AM, Simon Hobson <[hidden email]> wrote:
franky <[hidden email]> wrote:

> graph:
> rrdtool graph 'graph.png' --width '400' --height '100'
> 'DEF:T634=filename.rrd:t634:AVERAGE' 'LINE1:T634#0000FF:T634'

You could try specifying start and end times.

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: RRDTOOL and custom data

franky
This post was updated on .
In reply to this post by franky
Unfortunately i can't tail the file because it is on another computer and available only the day after.

Setting start and end time give's me the same result, a png with the right legend with y axis starting from 4.0 to 6.0 with a step of 0.5 and no line drawn.
Reply | Threaded
Open this post in threaded view
|

Re: RRDTOOL and custom data

Simon Hobson-2
> Setting start and end time give's me the same result, a png with the right
> legend with y axis starting from 4.0 to 6.0 with a step of 0.5 and no line
> drawn.

What start and end times did you use ? Do they fully encompass the time range of the data you entered ?
The fact that you get a Y axis that doesn't start at 0 does suggest that there is some data - but to start at 4 would mean that you possibly only include the last sample and not the earlier lower values.

_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: RRDTOOL and custom data

franky
In reply to this post by franky
I figured out the problem... There was too few data in the file and the graph offset time was too high...

Thanks a lot for your help!