5 collectdctl - Control interface for collectd
9 collectdctl I<[options]> I<E<lt>commandE<gt>> I<[command options]>
13 collectdctl provides a control interface for collectd, which may be used to
14 interact with the daemon using the C<unixsock plugin>.
18 collectdctl supports the following options:
24 Path to the UNIX socket opened by collectd's C<unixsock plugin>.
25 Default: /var/run/collectd-unixsock
29 Display usage information and exit.
33 =head1 AVAILABLE COMMANDS
35 The following commands are supported:
39 =item B<getval> I<E<lt>identifierE<gt>>
41 Query the latest collected value identified by the specified
42 I<E<lt>identifierE<gt>> (see below). The value-list associated with that
43 data-set is returned as a list of key-value-pairs, each on its own line. Keys
44 and values are separated by the equal sign (C<=>).
46 =item B<flush> [B<timeout=>I<E<lt>secondsE<gt>>] [B<plugin=>I<E<lt>nameE<gt>>]
47 [B<identifier=>I<E<lt>idE<gt>>]
49 Flush the daemon. This is useful, e.E<nbsp>g., to make sure that the latest
50 values have been written to the respective RRD file before graphing them or
51 copying them to somewhere else.
53 The following options are supported by the flush command:
57 =item B<timeout=>I<E<lt>secondsE<gt>>
59 Flush values older than the specified timeout (in seconds) only.
61 =item B<plugin=>I<E<lt>nameE<gt>>
63 Flush the specified plugin only. I.E<nbsp>e., data cached by the specified
64 plugin is written to disk (or network or whatever), if the plugin supports
69 =item B<identifier=>I<E<lt>idE<gt>>
71 If this option is present, only the data specified by the specified identifier
72 (see below) will be flushed. Note that this option is not supported by all
73 plugins (e.E<nbsp>g., the C<network> plugin does not support this).
77 The B<plugin> and B<identifier> options may be specified more than once. In
78 that case, all combinations of specified plugins and identifiers will be
83 Returns a list of all values (by their identifier) available to the
84 C<unixsock> plugin. Each value is printed on its own line. I.E<nbsp>e., this
85 command returns a list of valid identifiers that may be used with the other
88 =item B<putval> I<E<lt>identifierE<gt>> [B<interval=>I<E<lt>secondsE<gt>>]
89 I<E<lt>value-list(s)E<gt>>
91 Submit one or more values (identified by I<E<lt>identifierE<gt>>, see below)
92 to the daemon which will then dispatch them to the write plugins. B<interval>
93 specifies the interval (in seconds) used to collect the values following that
94 option. It defaults to the default of the running collectd instance receiving
95 the data. Multiple I<E<lt>value-list(s)E<gt>> (see below) may be specified.
96 Each of them will be submitted to the daemon. The values have to match the
97 data-set definition specified by the type as given in the identifier (see
98 L<types.db(5)> for details).
100 =item B<show> I<E<lt>selectorE<gt>> I<E<lt>aggregationE<gt>> [I<E<lt>aggregationE<gt>> ...]
102 Show values or an aggregation of values. The I<selector> selects which values
103 to show. It is basically an I<identifier> with special meaning for C<+> and
104 C<*>. If a hostname, plugin, type or one of the two instances is C<+> or C<*>,
105 any string will match the selector. The difference between the two is that all
106 identifiers with the same substitution for C<+> are grouped and aggregated by
107 the specified aggregation function(s). For example, the selector
111 will return the CPU states of each host, aggregated over all CPUs of each
112 system. Please see L</"IDENTIFIERS"> for a description of identifiers.
114 The I<aggregation> setting defines how multiple values are combined into one
115 value. Valid values are:
121 Number of non-NAN values. This value may be zero if all individual values are
134 Average of all values.
142 Standard deviation of all non-NAN values. The standard deviation is NAN if
143 there were no non-NAN values (B<count> reportsE<nbsp>0) and zero if there was
144 exactly one non-NAN value.
152 An identifier has the following format:
154 [I<hostname>/]I<plugin>[-I<plugin_instance>]/I<type>[-I<type_instance>]
157 somehost/cpu-0/cpu-idle
159 otherhost/memory/memory-used
161 Hostname defaults to the local (non-fully qualified) hostname if omitted. No
162 error is returned if the specified identifier does not exist (this is a
163 limitation in the C<libcollectdclient> library).
167 A value list describes one data-set as handled by collectd. It is a colon
168 (C<:>) separated list of the time and the values. Each value is either given
169 as an integer if the data-type is a counter, or as a double if the data-type
170 is a gauge value. A literal C<U> is interpreted as an undefined gauge value.
171 The number of values and the data-types have to match the type specified in
172 the identifier (see L<types.db(5)> for details). The time is specified as
173 epoch (i.E<nbsp>e., standard UNIX time) or as a literal C<N> which will be
180 =item C<collectdctl flush plugin=rrdtool identifier=somehost/cpu-0/cpu-wait>
182 Flushes all CPU wait RRD values of the first CPU of the local host.
183 I.E<nbsp>e., writes all pending RRD updates of that data-source to disk.
185 =item C<for ident in `collectdctl listval | grep users/users`; do
186 collectdctl getval $ident;
189 Query the latest number of logged in users on all hosts known to the local
198 L<collectd-unixsock(5)>,
203 collectd has been written by Florian Forster E<lt>octo at verplant.orgE<gt>
204 and many contributors (see `AUTHORS').
206 collectdctl has been written by
207 HÃ¥kon J Dugstad Johnsen E<lt>hakon-dugstad.johnsenE<nbsp>atE<nbsp>telenor.comE<gt>
208 and Sebastian Harl E<lt>sh at tokkee.orgE<gt>.