5d6044ac5ba1dd7005d32092228bdcb072cdfe65
[rrdtool.git] / doc / rrdupdate.pod
1 =head1 NAME
2
3 rrdupdate - Store a new set of values into the RRD
4
5 =head1 SYNOPSIS
6
7 B<rrdtool> {B<update> | B<updatev>} I<filename>
8 S<[B<--template>|B<-t> I<ds-name>[B<:>I<ds-name>]...]>
9 S<[B<--cache> | B<--nocache>]>
10 S<[B<--daemon> I<address>]>
11 S<B<N>|I<timestamp>B<:>I<value>[B<:>I<value>...]>
12 S<I<at-timestamp>B<@>I<value>[B<:>I<value>...]>
13 S<[I<timestamp>B<:>I<value>[B<:>I<value>...] ...]>
14
15 =head1 DESCRIPTION
16
17 The B<update> function feeds new data values into an B<RRD>. The data
18 is time aligned (interpolated) according to the properties of the
19 B<RRD> to which the data is written.
20
21 =over 8
22
23 =item B<updatev>
24
25 This alternate version of B<update> takes the same arguments and
26 performs the same function. The I<v> stands for I<verbose>, which
27 describes the output returned. B<updatev> returns a list of any and all
28 consolidated data points (CDPs) written to disk as a result of the
29 invocation of update. The values are indexed by timestamp (time_t),
30 RRA (consolidation function and PDPs per CDP), and data source (name).
31 Note that depending on the arguments of the current and previous call to
32 update, the list may have no entries or a large number of entries.
33
34 =item I<filename>
35
36 The name of the B<RRD> you want to update.
37
38 =item B<--template>|B<-t> I<ds-name>[B<:>I<ds-name>]...
39
40 By default, the B<update> function expects its data input in the order
41 the data sources are defined in the RRD, excluding any COMPUTE data
42 sources (i.e. if the third data source B<DST> is COMPUTE, the third
43 input value will be mapped to the fourth data source in the B<RRD> and
44 so on). This is not very error resistant, as you might be sending the
45 wrong data into an RRD.
46
47 The template switch allows you to specify which data sources you are
48 going to update and in which order. If the data sources specified in
49 the template are not available in the RRD file, the update process
50 will abort with an error message.
51
52 While it appears possible with the template switch to update data sources
53 asynchronously, B<RRDtool> implicitly assigns non-COMPUTE data sources missing
54 from the template the I<*UNKNOWN*> value.
55
56 Do not specify a value for a COMPUTE B<DST> in the B<update>
57 function. If this is done accidentally (and this can only be done
58 using the template switch), B<RRDtool> will ignore the value specified
59 for the COMPUTE B<DST>.
60
61 =item B<--cache> | B<--nocache>
62
63 Force the use of the caching daemon or force direct file access. If B<--cache>
64 is given, B<RRDTool> will try to contact the caching daemon B<RRDd> and will
65 fail if it cannot connect to the daemon. If the connection is successfully
66 established the values will be sent to the daemon instead of accessing the
67 files directly. If B<--nocache> is given no connection attempt is made. If
68 neither option is specified B<RRDTool> will try to contact the daemon and, if
69 no connection may be established, will fall back to direct file access.
70
71 Examples:
72
73   rrdtool update --cache /var/lib/rrd/foo.rrd N:123
74   rrdtool update --nocache /var/lib/rrd/bar.rrd N:234
75
76 =item B<--daemon> I<address>
77
78 Specifies the address of the caching daemon. If I<address> begins with C<unix:>
79 the everything after this prefix will be considered to be a UNIX domain socket.
80 Otherwise the address is interpreted as network address or node name as
81 understood by L<getaddrinfo(3)>. One practical consequence is that both, IPv4
82 and IPv6, may be used if the system supports it.
83
84 Examples:
85
86   rrdtool update --daemon unix:/tmp/rrdd.sock /var/lib/rrd/foo.rrd N:123
87   rrdtool update --daemon ::1 /var/lib/rrd/bar.rrd N:234
88   rrdtool update --daemon 10.0.0.2 /var/lib/rrd/baz.rrd N:345
89   rrdtool update --daemon rrdtool.example.com /var/lib/rrd/qux.rrd N:456
90
91 =item B<N>|I<timestamp>B<:>I<value>[B<:>I<value>...]
92
93 The data used for updating the RRD was acquired at a certain
94 time. This time can either be defined in seconds since 1970-01-01 or
95 by using the letter 'N', in which case the update time is set to be
96 the current time. Negative time values are subtracted from the current
97 time. An AT_STYLE TIME SPECIFICATION (see the I<rrdfetch>
98 documentation) may also be used by delimiting the end of the time
99 specification with the '@' character instead of a ':'. Getting the
100 timing right to the second is especially important when you are
101 working with data-sources of type B<COUNTER>, B<DERIVE> or
102 B<ABSOLUTE>.
103
104 The remaining elements of the argument are DS updates. The order of
105 this list is the same as the order the data sources were defined in
106 the RRA. If there is no data for a certain data-source, the letter
107 B<U> (e.g., N:0.1:U:1) can be specified.
108
109 The format of the value acquired from the data source is dependent on
110 the data source type chosen. Normally it will be numeric, but the data
111 acquisition modules may impose their very own parsing of this
112 parameter as long as the colon (B<:>) remains the data source value
113 separator.
114
115 =back
116
117 =head1 EXAMPLE
118
119 C<rrdtool update demo1.rrd N:3.44:3.15:U:23>
120
121 Update the database file demo1.rrd with 3 known and one I<*UNKNOWN*>
122 value. Use the current time as the update time.
123
124 C<rrdtool update demo2.rrd 887457267:U 887457521:22 887457903:2.7>
125
126 Update the database file demo2.rrd which expects data from a single
127 data-source, three times. First with an I<*UNKNOWN*> value then with two
128 regular readings. The update interval seems to be around 300 seconds.
129
130 =head1 AUTHORS
131
132 Tobias Oetiker <tobi@oetiker.ch>,
133 Florian Forster <octoE<nbsp>atE<nbsp>verplant.org>
134