Code

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