RRDTool

From vwiki
Revision as of 16:34, 20 January 2010 by Sstrutt (talk | contribs) (Formatted "Create a database")
Jump to navigation Jump to search

http://oss.oetiker.ch/rrdtool/index.en.html - RRDTool homepage

Getting Started

Create a Database

The following example creates a RRD database to hold an ESX's aggregated (average of all cores) CPU data with;

  • Raw data held for 12 hrs (realtime)
  • 5 min average (with max and min values) for 24 hrs (daily)
  • 20 min average (with max and min values) for 7 days (weekly)
  • 60 min average (with max and min values) for 31 days (monthly)
  • 1 day average (with max and min values) for 365 days (yearly)

In order to achieve the rolled-up averages, its necessary to calculate;

  • The number of raw data points required for that average (eg to be able to calculate a 5 min average)
  • The number of those averages to store (eg to be able to have a day's worth of 5 min average data)

Its also necessary to calculate how much raw data you want to store (if any)

  • Raw
    • Data is available every 20 secs
    • Therefore 3 intervals per min
    • Therefore 3 x 60 = 180 raw data points per hour
    • Therefore 12 x 180 = 2160 raw data points (to provide 12 hrs of data)
  • Daily
    • 5 min average = 5 x 60 / 20 = 15 raw data points in each average
    • 24 hr coverage = 24 x 60 = 1440 mins => 1440 / 5 = 288 averaged data points
  • Weekly
    • 20 min average = 20 x 60 / 20 = 60 raw data points in each average
    • 7 days coverage = 7 x 24 x 60 = 10,080 mins => 10,080 / 20 = 504 averaged data points
  • Monthly
    • 1 hr average = 60 x 60 / 20 = 180 raw data points in each average
    • 31 day coverage = 31 x 24 x 60 = 44,640 mins => 44,640 / 60 = 744 averaged data points
  • Yearly
    • 1 day average = 24 x 60 x 60 / 20 = 4,320 raw data points in each average
    • 366 day coverage = 366 x 24 x 60 = 527,040 mins = 527,040 / 24 x 60 = 366 averaged data points

rrdtool create esx1-cpu.rrd --step 20 \ DS:CPU-Aggregate:GAUGE:40:0:100 \ RRA:AVERAGE:0.5:1:2160 \ RRA:AVERAGE:0.25:15:1440 \ RRA:MIN:0.25:15:1440 \ RRA:MAX:0.25:15:1440 \ RRA:AVERAGE:0.25:60:504 \ RRA:MIN:0.25:60:504 \ RRA:MAX:0.25:60:504 \ RRA:AVERAGE:0.25:180:744 \ RRA:MIN:0.25:180:744 \ RRA:MAX:0.25:180:744 \ RRA:AVERAGE:0.25:4320:366 \ RRA:MIN:0.25:4320:366 \ RRA:MAX:0.25:4320:366