Rrdtool create: Difference between revisions

From I Will Fear No Evil
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
Line 2: Line 2:
* http://rrdtool.vandenbogaerdt.nl/tutorial/rrdcreate.php
* http://rrdtool.vandenbogaerdt.nl/tutorial/rrdcreate.php
* https://apfelboymchen.net/gnu/rrd/create/
* https://apfelboymchen.net/gnu/rrd/create/
* https://lpar2rrd.com/max_vrs_average.php


DST when to use (Data Storage Type)
DST when to use (Data Storage Type)

Latest revision as of 11:10, 29 May 2023

Rrdtool create commands and details

DST when to use (Data Storage Type)

  • GAUGE
           The input is a rate, e.g. m/s, or should be treated as a rate, e.g. temperature
  • COUNTER
           The input is an ever increasing number, e.g. an octet counter in a router. RRDtool should compute the difference between the last update and the current one, and divide it by the amount of time lapsed.
  • DERIVE
           This is similar to COUNTER, except that the input can decrease. This is useful for instance in a kWh meter when you produce more solar power than you use. In that case you actually do get a negative rate.
  • ABSOLUTE
           This is to be used when the counter is reset every time it is read, when people start counting from zero, and so on. The main difference between ABSOLUTE and GAUGE is that the input is not yet a rate, it
           should first be divided by time to get a rate. The main difference between ABSOLUTE and COUNTER is that RRDtool should not use the previous input value to compute its delta.
ds-name	ds0	one of the counters
DST	COUNTER	Data Source Type
heartbeat	600	Those 10 minutes
min	0	Rate no less than 0
max	12500000	Rate no more than 12,500,000 bytes per second, which is 100,000,000 bits per second

The other counter is just the same, except for its name. Give the following to rrdtool create:
DS:ds0:COUNTER:600:0:12500000
DS:ds1:COUNTER:600:0:12500000 

Legit shell command to create above:

rrdtool create database.rrd    \
DS:ds0:COUNTER:600:0:12500000  \
DS:ds1:COUNTER:600:0:12500000  \
RRA:MIN:0:360:576              \
RRA:MIN:0:30:576               \
RRA:MIN:0:7:576                \
RRA:AVERAGE:0:360:576          \
RRA:AVERAGE:0:30:576           \
RRA:AVERAGE:0:7:576            \
RRA:AVERAGE:0:1:576            \
RRA:MAX:0:360:576              \
RRA:MAX:0:30:576               \
RRA:MAX:0:7:576

Another breakdown of create

rrdtool create download.rrd \
        --step 300 \
        DS:inet_down_total:DERIVE:600:0:U \
        DS:inet_down_comp1:DERIVE:600:0:U \
        DS:inet_down_comp2:DERIVE:600:0:U \
        DS:inet_down_other:DERIVE:600:0:U \
        RRA:AVERAGE:0.5:1:288 \
        RRA:AVERAGE:0.5:3:672 \
        RRA:AVERAGE:0.5:12:744 \
        RRA:AVERAGE:0.5:72:1460
		

creates a database that

    is updated every 5 minutes
    has for data sources that that can save values from 0 to unlimited
    saves 1 day in 5-minute resolution (288 * (300*1/60) / 60/24)
    saves 1 week in in 15-minute resolution (672 * (300*3/60) / 60/24)
    saves 1 month in 1-hour resolution (744 * (300*12/60) / 60/24)
    saves 1 year in 6-hour resolution (1460 * (300*72/60) / 60/24)

Drive is cheap. Something to think about:

  • A database with one data source holding three years in 5-minute resolution is only 2.5 MB
  • HOWEVER, rendering many of these can get ugly!