On Tue, Mar 06, 2007 at 04:27:57PM -0600, James Wade wrote:
Henrik, Can you point me in the direction of a "How To" on this, So, I need to recreate the vmstat.rrd, but where or how do I change the RRD "step" setting?
You need to use the "rrdtool create" command to create a new RRD file for your vmstat data. The "step" setting is one of the options for this command.
Start by running "rrdtool info "~hobbit/data/rrd/SOMEHOST/vmstat.rrd", this will dump all a long stream of data about how this rrd file is setup. It goes like this:
filename = "/var/lib/hobbit/rrd/localhost/vmstat.rrd" rrd_version = "0003" step = 300 last_update = 1173248932 ds[cpu_r].type = "GAUGE" ds[cpu_r].minimal_heartbeat = 600 ds[cpu_r].min = 0.0000000000e+00 ds[cpu_r].max = NaN ds[cpu_r].last_ds = "UNKN" ds[cpu_r].value = 0.0000000000e+00 <snip lots more "ds" lines> rra[0].cf = "AVERAGE" rra[0].rows = 576 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 <snip lots more "rra" lines>
The "step" value is the interval between updates - this is the one you want to change from "300" to "15".
The "ds" lines are the various data sets stored in the RRD file; some RRD files only have one dataset, but vmstat has a lot.
The "rra" lines define how the data is "consolidated", i.e. how granular you want your data as you go further back in time.
To create the RRD file, you must run a command like this:
rrdtool create vmstat.rrd
--step 15
DS:cpu_r:GAUGE:60:0:U
<more DS lines, one for each dataset>
RRA:AVERAGE:0.5:1:11520
RRA:AVERAGE:0.5:20:2016
<more RRA lines>
You build the "DS" lines from the rrdtool info "ds" data. "cpu_r" is the dataset name, from the"ds[cpu_r]". "GAUGE" is the "type" of the dataset. "60" is the "minimal_heartbeat", which is usually a multiple of the "step" setting. It means that you must feed data into the RRD file at this interval for RRD to regard the data as valid. "0" and "U" are the "min" and "max" values for the dataset.
The "RRA" lines - "AVERAGE" is the "cf" value from the rrdtool info. "0.5" you shouldn't change. "1" and "11520" are the "pdp_per_row" and "rows" settings, and these must change. These two basically mean that you will be storing "rows" data values, with a resolution of (pdp_per_rows x step) granularity. So if the RRA is RRA:AVERAGE:0.5:1:11520 then you will use 1 reading (pdp) per dataitem you store - so this RRA holds data with your 15 second interval - and you will store 11520 data values - which is equivalent to 15x11520 = 2 days of data. When you go further back than the first 2 days, you will be seeing data from the other RRA's, e.g. the next one RRA:AVERAGE:0.5:20:2016 uses 20 pdp's per value stored in the RRA, so each value from this RRA is an average over 20 readings of data = (20 x 15) = 5 minute average value. Here I've chosen to store 2016 of these 5-minute averages, which is enough for 2016 x 5 minutes = 7 days.
You can build these RRA definitions any way you like, rrdtool will automatically update all of them with the data that is fed into the RRD file, and the graphs will automatically use the best RRA when you view them.
Is there a way to keep the old data?
Not automatically.
Regards, Henrik