=head1 NAME collectdctl - Control interface for collectd =head1 SYNOPSIS collectdctl I<[options]> IcommandE> I<[command options]> =head1 DESCRIPTION collectdctl provides a control interface for collectd, which may be used to interact with the daemon using the C. =head1 OPTIONS collectdctl supports the following options: =over 4 =item B<-s> I Path to the UNIX socket opened by collectd's C. Default: /var/run/collectd-unixsock =item B<-h> Display usage information and exit. =back =head1 AVAILABLE COMMANDS The following commands are supported: =over 4 =item B IidentifierE> Query the latest collected value identified by the specified IidentifierE> (see below). The value-list associated with that data-set is returned as a list of key-value-pairs, each on its own line. Keys and values are separated by the equal sign (C<=>). =item B [BIsecondsE>] [BInameE>] [BIidE>] Flush the daemon. This is useful, e.Eg., to make sure that the latest values have been written to the respective RRD file before graphing them or copying them to somewhere else. The following options are supported by the flush command: =over 4 =item BIsecondsE> Flush values older than the specified timeout (in seconds) only. =item BInameE> Flush the specified plugin only. I.Ee., data cached by the specified plugin is written to disk (or network or whatever), if the plugin supports that operation. Example: B. =item BIidE> If this option is present, only the data specified by the specified identifier (see below) will be flushed. Note that this option is not supported by all plugins (e.Eg., the C plugin does not support this). =back The B and B options may be specified more than once. In that case, all combinations of specified plugins and identifiers will be flushed only. =item B Returns a list of all values (by their identifier) available to the C plugin. Each value is printed on its own line. I.Ee., this command returns a list of valid identifiers that may be used with the other commands. =item B IidentifierE> [BIsecondsE>] Ivalue-list(s)E> Submit one or more values (identified by IidentifierE>, see below) to the daemon which will then dispatch them to the write plugins. B specifies the interval (in seconds) used to collect the values following that option. It defaults to the default of the running collectd instance receiving the data. Multiple Ivalue-list(s)E> (see below) may be specified. Each of them will be submitted to the daemon. The values have to match the data-set definition specified by the type as given in the identifier (see L for details). =item B [ISelectionE>] [IAggregationE> IGroupingE>] [IFormatE>] Show values or an aggregation of values. The I selects which values to show. The selection consists of the five options B, B, B, B and B which take a regular expression each. The regular expressions are passed on to the C command so they will behave exactly as documented in L. Example: Show CPU statistics only. collectdctl show plugin="^cpu$" type="^cpu$" If you're not interested in single values, but aggregations of values, you can use the I and I options to get an overview over your system(s) and such. The two options to this effect are: =over 4 =item BI[B<,>I[...]] List all the aggregation functions that shall be used to combine multiple values. Available aggregation functions are: =over 4 =item B Number of non-NAN values. This value may be zero if all individual values are NAN. =item B Minimum value. =item B Maximum value. =item B Average of all values. =item B Sum of all values. =item B Standard deviation of all non-NAN values. The standard deviation is NAN if there were no non-NAN values (B reportsE0) and zero if there was exactly one non-NAN value. =back =item BI[B<,>I[...]] Chose the fields of the I you want to group values by. Valid I are B, B, B, B and B. In 99E% of all cases, you want to make sure all values have the same I -- either by using a construct like C or by adding B to the B option (e.g. C). =back The output formatting may be specified using the BI option. The following formats are available: =over 4 =item B (default) Output an aligned table formatted using ASCII characters. =item B Output a table intended to be included in a LaTeX document. This is not a complete document. In order to compile the document, you have to have a complete document wrapper. =back Example: Print the minimum, average and maximum time spent in each CPU state for all your web servers: collectdctl show host="^www[0-9]\\." plugin="^cpu$" type="^cpu$" aggregate=min,avg,max group=type_instance =back =head1 IDENTIFIERS An identifier has the following format: [I/]I[-I]/I[-I] Examples: somehost/cpu-0/cpu-idle uptime/uptime otherhost/memory/memory-used Hostname defaults to the local (non-fully qualified) hostname if omitted. No error is returned if the specified identifier does not exist (this is a limitation in the C library). =head1 VALUE-LIST A value list describes one data-set as handled by collectd. It is a colon (C<:>) separated list of the time and the values. Each value is either given as an integer if the data-type is a counter, or as a double if the data-type is a gauge value. A literal C is interpreted as an undefined gauge value. The number of values and the data-types have to match the type specified in the identifier (see L for details). The time is specified as epoch (i.Ee., standard UNIX time) or as a literal C which will be interpreted as now. =head1 EXAMPLES =over 4 =item C Flushes all CPU wait RRD values of the first CPU of the local host. I.Ee., writes all pending RRD updates of that data-source to disk. =item C Query the latest number of logged in users on all hosts known to the local collectd instance. =back =head1 SEE ALSO L, L, L, L =head1 AUTHOR collectd has been written by Florian Forster Eocto at collectd.orgE and many contributors (see `AUTHORS'). collectdctl has been written by Håkon J Dugstad Johnsen Ehakon-dugstad.johnsenEatEtelenor.comE, Sebastian Harl Esh at tokkee.orgE and Florian Forster Eocto at collectd.orgE. =cut