System information

System Monitoring Utilities 47
rrdtool create free_mem.rrd --start 1272974834 --step=4 \
DS:memory:GAUGE:600:U:U RRA:AVERAGE:0.5:1:24
Points to Notice
This command creates a file called free_mem.rrd for storing our measured val-
ues in a Round Robin type database.
The --start option specifies the time (in Unix time) when the first value will be
added to the database. In this example, it is one less than the first time value of the
free_mem.sh output (1272974835).
The --step specifies the time interval in seconds with which the measured data
will be supplied to the database.
The DS:memory:GAUGE:600:U:U part introduces a new data source for the
database. It is called memory, its type is gauge, the maximum number between two
updates is 600 seconds, and the minimal and maximal value in the measured range
are unknown (U).
RRA:AVERAGE:0.5:1:24 creates Round Robin archive (RRA) whose stored
data are processed with the consolidation functions (CF) that calculates the average
of data points. 3 arguments of the consolidation function are appended to the end of
the line .
If no error message is displayed, then free_mem.rrd database is created in the
current directory:
tux@mercury:~> ls -l free_mem.rrd
-rw-r--r-- 1 tux users 776 May 5 12:50 free_mem.rrd
2.11.2.3 Updating Database Values
After the database is created, you need to fill it with the measured data. In Sec-
tion2.11.2.1, “Collecting Data” (page45), we already prepared the file
free_mem_updates.log which consists of rrdtool update commands.
These commands do the update of database values for us.
tux@mercury:~> sh free_mem_updates.log; ls -l free_mem.rrd
-rw-r--r-- 1 tux users 776 May 5 13:29 free_mem.rrd
As you can see, the size of free_mem.rrd remained the same even after updating
its data.