Description:
The program-collector
runs a configuration-specified program to get the
values for its RRD. The program must print its output in one of two forms.
The simple form is just simple values, one per line. The collector will
invent names for each value, based on the RRD name. For the first value,
the name for the value will be the name of the RRD. Any subsequent values
will be named the RRD name followed by a hyphen and a number, giving names
like rrdname-2
, rrdname-3
, ...
In the other form, the program must provide names itself, so each line is
the name of the value followed by white-space and the value itself. If the
values produced by the program contain white-space, the program must
use this form.
In either case, the collector will materialize values for the response-time
in named the same as the value, with "-response
" appended. The
response-time is how long the program took to produce that value, cumulative
since the beginning of the running of the program.
There is supplied an RRD definition, program-*
, to make this easier to
use for simple cases. All it needs is a "program" which prints a single value.
The "program" could be anything, including a pipeline. The RRD has two
variables, response
and response-time
, the former being the value
supplied by the program, and the latter the run-time of the program. E.G.
to get a count of th enumber of processes running, you could include an
RRD directive like:
rrd program-processes /usr/bin/ps -e | wc -l
or, if you've got a BSD version of ps:
rrd program-processes /usr/bin/ps ax | wc -l
[