29
29
connections. Once a connection is established the client can send commands to
30
30
the daemon which it will answer, if it understand them.
32
In general the plugin answers with a status line of the following form:
36
If I<Status> is greater than or equal to zero the message indicates success,
37
if I<Status> is less than zero the message indicates failure. I<Message> is a
38
human-readable string that further describes the return value.
40
On success, I<Status> furthermore indicates the number of subsequent lines of
41
output (not including the status line). Each such lines usually contains a
42
single return value. See the description of each command for details.
32
44
The following commands are implemented:
36
48
=item B<GETVAL> I<Identifier>
38
50
If the value identified by I<Identifier> (see below) is found the complete
39
value-list is returned. The response is a space separated list of
42
I<num> I<name>B<=>I<value>[ I<name>B<=>I<value>[ ...]]
44
If I<num> is less then zero, an error occurred. Otherwise it contains the
45
number of values that follow. Each value is of the form I<name>B<=>I<value>.
51
value-list is returned. The response is a list of name-value-pairs, each pair
52
on its own line (the number of lines is indicated by the status line - see
53
above). Each name-value-pair is of the form I<name>B<=>I<value>.
46
54
Counter-values are converted to a rate, e.E<nbsp>g. bytes per second.
47
55
Undefined values are returned as B<NaN>.
50
58
-> | GETVAL myhost/cpu-0/cpu-user
51
<- | 1 value=1.260000e+00
60
<- | value=1.260000e+00
55
64
Returns a list of the values available in the value cache together with the
56
65
time of the last update, so that querying applications can issue a B<GETVAL>
57
command for the values that have changed.
59
The first line's status number is the number of identifiers returned or less
60
than zero if an error occurred. Each of the following lines contains the
61
update time as an epoch value and the identifier, separated by a space.
66
command for the values that have changed. Each return value consists of the
67
update time as an epoch value and the identifier, separated by a space. The
68
update time is the time of the last value, as provided by the collecting
69
instance and may be very different from the time the server considers to be
65
74
<- | 69 Values found
66
<- | 1182204284 leeloo/cpu-0/cpu-idle
67
<- | 1182204284 leeloo/cpu-0/cpu-nice
68
<- | 1182204284 leeloo/cpu-0/cpu-system
69
<- | 1182204284 leeloo/cpu-0/cpu-user
75
<- | 1182204284 myhost/cpu-0/cpu-idle
76
<- | 1182204284 myhost/cpu-0/cpu-nice
77
<- | 1182204284 myhost/cpu-0/cpu-system
78
<- | 1182204284 myhost/cpu-0/cpu-user
72
81
=item B<PUTVAL> I<Identifier> [I<OptionList>] I<Valuelist>
174
183
-> | PUTNOTIF type=temperature severity=warning time=1201094702 message=The roof is on fire!
186
=item B<FLUSH> [B<timeout=>I<Timeout>] [B<plugin=>I<Plugin> [...]]
188
Flushes all cached data older than I<Timeout> seconds. If no timeout has been
189
specified, it defaults to -1 which causes all data to be flushed. B<timeout>
190
may be specified multiple times - each occurrence applies to plugins listed
193
If specified, only specific plugins are flushed. Otherwise all plugins
194
providing a flush callback are flushed.
179
202
=head2 Identifiers
191
214
myhost/memory/memory-used
192
215
myhost/disk-sda/disk_octets
196
Unless otherwise noted the plugin answers with a line of the following form:
200
If I<Num> is zero the message indicates success, if I<Num> is non-zero the
201
message indicates failure. I<Message> is a human-readable string that describes
202
the return value further.
204
Commands that return values may use I<Num> to return the number of values that
205
follow, such as the B<GETVAL> command. These commands usually return a negative
206
value on failure and never return zero.
208
217
=head1 ABSTRACTION LAYER
210
219
B<collectd> ships the Perl-Module L<Collectd::Unixsock> which