Code

Imported upstream version 1.4~rc2.
[pkg-rrdtool.git] / doc / rrdupdate.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <title>rrdupdate</title>
5 <link rev="made" href="mailto:root@localhost" />
6 </head>
8 <body style="background-color: white">
10 <p><a name="__index__"></a></p>
11 <!-- INDEX BEGIN -->
12 <!--
14 <ul>
16         <li><a href="#name">NAME</a></li>
17         <li><a href="#synopsis">SYNOPSIS</a></li>
18         <li><a href="#description">DESCRIPTION</a></li>
19         <li><a href="#environment_variables">ENVIRONMENT VARIABLES</a></li>
20         <li><a href="#examples">EXAMPLES</a></li>
21         <li><a href="#authors">AUTHORS</a></li>
22 </ul>
23 -->
24 <!-- INDEX END -->
26 <p>
27 </p>
28 <h1><a name="name">NAME</a></h1>
29 <p>rrdupdate - Store a new set of values into the RRD</p>
30 <p>
31 </p>
32 <hr />
33 <h1><a name="synopsis">SYNOPSIS</a></h1>
34 <p><strong>rrdtool</strong> {<strong>update</strong> | <strong>updatev</strong>} <em>filename</em>
35 [<strong>--template</strong>|<strong>-t</strong>&nbsp;<em>ds-name</em>[<strong>:</strong><em>ds-name</em>]...]
36 [<strong>--daemon</strong>&nbsp;<em>address</em>] [<strong>--</strong>]
37 <strong>N</strong>|<em>timestamp</em><strong>:</strong><em>value</em>[<strong>:</strong><em>value</em>...]
38 <em>at-timestamp</em><strong>@</strong><em>value</em>[<strong>:</strong><em>value</em>...]
39 [<em>timestamp</em><strong>:</strong><em>value</em>[<strong>:</strong><em>value</em>...]&nbsp;...]</p>
40 <p>
41 </p>
42 <hr />
43 <h1><a name="description">DESCRIPTION</a></h1>
44 <p>The <strong>update</strong> function feeds new data values into an <strong>RRD</strong>. The data
45 is time aligned (interpolated) according to the properties of the
46 <strong>RRD</strong> to which the data is written.</p>
47 <dl>
48 <dt><strong><a name="item_updatev"><strong>updatev</strong></a></strong><br />
49 </dt>
50 <dd>
51 This alternate version of <strong>update</strong> takes the same arguments and
52 performs the same function. The <em>v</em> stands for <em>verbose</em>, which
53 describes the output returned. <strong>updatev</strong> returns a list of any and all
54 consolidated data points (CDPs) written to disk as a result of the
55 invocation of update. The values are indexed by timestamp (time_t),
56 RRA (consolidation function and PDPs per CDP), and data source (name).
57 Note that depending on the arguments of the current and previous call to
58 update, the list may have no entries or a large number of entries.
59 </dd>
60 <dd>
61 <p>Since <strong>updatev</strong> requires direct disk access, the <strong>--daemon</strong> option cannot be
62 used with this command.</p>
63 </dd>
64 <p></p>
65 <dt><strong><a name="item_filename"><em>filename</em></a></strong><br />
66 </dt>
67 <dd>
68 The name of the <strong>RRD</strong> you want to update.
69 </dd>
70 <p></p>
71 <dt><strong><a name="item__2d_2dtemplate_7c_2dt_ds_2dname_5b_3ads_2dname_5d_"><strong>--template</strong>|<strong>-t</strong> <em>ds-name</em>[<strong>:</strong><em>ds-name</em>]...</a></strong><br />
72 </dt>
73 <dd>
74 By default, the <strong>update</strong> function expects its data input in the order
75 the data sources are defined in the RRD, excluding any COMPUTE data
76 sources (i.e. if the third data source <strong>DST</strong> is COMPUTE, the third
77 input value will be mapped to the fourth data source in the <strong>RRD</strong> and
78 so on). This is not very error resistant, as you might be sending the
79 wrong data into an RRD.
80 </dd>
81 <dd>
82 <p>The template switch allows you to specify which data sources you are
83 going to update and in which order. If the data sources specified in
84 the template are not available in the RRD file, the update process
85 will abort with an error message.</p>
86 </dd>
87 <dd>
88 <p>While it appears possible with the template switch to update data sources
89 asynchronously, <strong>RRDtool</strong> implicitly assigns non-COMPUTE data sources missing
90 from the template the <em>*UNKNOWN*</em> value.</p>
91 </dd>
92 <dd>
93 <p>Do not specify a value for a COMPUTE <strong>DST</strong> in the <strong>update</strong>
94 function. If this is done accidentally (and this can only be done
95 using the template switch), <strong>RRDtool</strong> will ignore the value specified
96 for the COMPUTE <strong>DST</strong>.</p>
97 </dd>
98 <p></p>
99 <dt><strong><a name="item__2d_2ddaemon_address"><strong>--daemon</strong> <em>address</em></a></strong><br />
100 </dt>
101 <dd>
102 If given, <strong>RRDTool</strong> will try to connect to the caching daemon <a href="././rrdcached.html">the rrdcached manpage</a>
103 at <em>address</em> and will fail if the connection cannot be established. If the
104 connection is successfully established the values will be sent to the daemon
105 instead of accessing the files directly.
106 </dd>
107 <dd>
108 <p>For a list of accepted formats, see the <strong>-l</strong> option in the <a href="././rrdcached.html">the rrdcached manpage</a> manual.</p>
109 </dd>
110 <p></p>
111 <dt><strong><a name="item_n_7ctimestamp_3avalue_5b_3avalue_2e_2e_2e_5d"><strong>N</strong>|<em>timestamp</em><strong>:</strong><em>value</em>[<strong>:</strong><em>value</em>...]</a></strong><br />
112 </dt>
113 <dd>
114 The data used for updating the RRD was acquired at a certain
115 time. This time can either be defined in seconds since 1970-01-01 or
116 by using the letter 'N', in which case the update time is set to be
117 the current time. Negative time values are subtracted from the current
118 time. An AT_STYLE TIME SPECIFICATION (see the <em>rrdfetch</em>
119 documentation) may also be used by delimiting the end of the time
120 specification with the '@' character instead of a ':'. Getting the
121 timing right to the second is especially important when you are
122 working with data-sources of type <strong>COUNTER</strong>, <strong>DERIVE</strong> or
123 <strong>ABSOLUTE</strong>.
124 </dd>
125 <dd>
126 <p>When using negative time values, options and data have to be separated
127 by two dashes (<strong>--</strong>), else the time value would be parsed as an option.
128 See below for an example.</p>
129 </dd>
130 <dd>
131 <p>When using negative time values, options and data have to be separated
132 by two dashes (<strong>--</strong>), else the time value would be parsed as an option.
133 See below for an example.</p>
134 </dd>
135 <dd>
136 <p>The remaining elements of the argument are DS updates. The order of
137 this list is the same as the order the data sources were defined in
138 the RRA. If there is no data for a certain data-source, the letter
139 <strong>U</strong> (e.g., N:0.1:U:1) can be specified.</p>
140 </dd>
141 <dd>
142 <p>The format of the value acquired from the data source is dependent on
143 the data source type chosen. Normally it will be numeric, but the data
144 acquisition modules may impose their very own parsing of this
145 parameter as long as the colon (<strong>:</strong>) remains the data source value
146 separator.</p>
147 </dd>
148 <p></p></dl>
149 <p>
150 </p>
151 <hr />
152 <h1><a name="environment_variables">ENVIRONMENT VARIABLES</a></h1>
153 <p>The following environment variables may be used to change the behavior of
154 <code>rrdtoolupdate</code>:</p>
155 <dl>
156 <dt><strong><a name="item_rrdcached_address"><strong>RRDCACHED_ADDRESS</strong></a></strong><br />
157 </dt>
158 <dd>
159 If this environment variable is set it will have the same effect as specifying
160 the <code>--daemon</code> option on the command line. If both are present, the command
161 line argument takes precedence.
162 </dd>
163 <p></p></dl>
164 <p>
165 </p>
166 <hr />
167 <h1><a name="examples">EXAMPLES</a></h1>
168 <ul>
169 <li></li>
170 <code>rrdtool update demo1.rrd N:3.44:3.15:U:23</code>
171 <p>Update the database file demo1.rrd with 3 known and one <em>*UNKNOWN*</em>
172 value. Use the current time as the update time.</p>
173 <p></p>
174 <li></li>
175 <code>rrdtool update demo2.rrd 887457267:U 887457521:22 887457903:2.7</code>
176 <p>Update the database file demo2.rrd which expects data from a single
177 data-source, three times. First with an <em>*UNKNOWN*</em> value then with two
178 regular readings. The update interval seems to be around 300 seconds.</p>
179 <p></p>
180 <li></li>
181 <code>rrdtool update demo3.rrd -- -5:21 N:42</code>
182 <p>Update the database file demo3.rrd two times, using five seconds in the
183 past and the current time as the update times.</p>
184 <p></p>
185 <li></li>
186 <code>rrdtool update --cache /var/lib/rrd/demo3.rrd N:42</code>
187 <p>Update the file <code>/var/lib/rrd/demo3.rrd</code> with a single data source, using the
188 current time. If the caching daemon cannot be reached, do <strong>not</strong> fall back to
189 direct file access.</p>
190 <p></p>
191 <li></li>
192 <code>rrdtool update --daemon unix:/tmp/rrdd.sock demo4.rrd N:23</code>
193 <p>Use the UNIX domain socket <code>/tmp/rrdd.sock</code> to contact the caching daemon. If
194 the caching daemon is not available, update the file <code>demo4.rrd</code> directly.
195 <strong>WARNING:</strong> Since a relative path is specified, the following disturbing effect
196 may occur: If the daemon is available, the file relative to the working
197 directory <strong>of the daemon</strong> is used. If the daemon is not available, the file
198 relative to the current working directory of the invoking process is used.
199 <strong>This may update two different files depending on whether the daemon could be
200 reached or not.</strong> Don't do relative paths, kids!</p>
201 <p></p></ul>
202 <p>
203 </p>
204 <hr />
205 <h1><a name="authors">AUTHORS</a></h1>
206 <p>Tobias Oetiker &lt;<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>&gt;,
207 Florian Forster &lt;octo&nbsp;at&nbsp;verplant.org&gt;</p>
209 </body>
211 </html>