[rrd-users] Is it possible to create the rrd database by reading from a file?

Simon Hobson linux at thehobsons.co.uk
Sat May 19 09:57:18 CEST 2007

betamaz wrote:

>Q1:  Tor the time attribute that rrdtool needs--for now-- i've added 
>an arbitrary value to represent time ticks. The second column is not 
>of a number format--though the pc which is in hex can easily be 
>coverted to a number format. This brings me to my first question: Is 
>it possible to plot time versus a non integer value using rrdtool?

ALL values stored are floating points in an RRD. Even if you supply 
integer values, they are normalised and aggregated according to the 
rules defined in the database and the timestamps of the data - which 
will normally lead to floating point values which are not the same as 
the values entered.

>Q2.a: In the below script--which i've written up based on Simon's 
>pseudocode--are the "rrdtool create" parameters correct? 
>Specifically, since i'm reading from a file, what should the 
>increment option --step be (currently it's set to 60, because else 
>i'd get an error saying "ERROR: step size should b no less than one 
>second"). In the rrdtool create documentation, i did not see a 
>option for the create command to specify that the intervals should 
>be right after each other with no wait time in between (since i'd 
>like to read from a file and stop adding to the database afterwards).

The step size is the time interval for the stored data. Whatever you 
feed in is normalised to fit these time stamps and uses the timestamp 
of the update, not the system time it is performed. So if for example 
your data has timestamps one hour apart (3600s) then you could feed 
it in using multiple updates in one go and this might only take a 
second or two, but rrd uses the timestamps of the data to fit it over 
the many hours it covers.

>Q2.b: Also, when specifying the Round Robin Arhive, what is the 
>format for specifying data source is from a file?  I've tried 
>variation of the line "DS:input:ABSOLUTE:$INPUT_FILE, all without 

There isn't one. RRD isn't like some service that runs in the 
background and constantly does 'something'. 'something' only ever 
happens in response to you running a command.

To input values from a file you need something outside of rrd that 
reads the values and performs multiple updates to insert those values 
- ie the 'while ...' loop in your script.

For the format of the create command, see 
http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html and scroll down 
to the section headed DS:ds-name:DST:dst arguments where it gives teh 
format for an ABSOLUTE of "DS:ds-name:GAUGE | COUNTER | DERIVE | 

More information about the rrd-users mailing list