Description:
The dbi-collector
uses perl's DBI interface to access remote databases to
collect data. If you have a DBD driver for your database, and can write
an SQL select statement to select the data you're interested in, the
dbi-collector
can import the data into rrdtool and remstats.
The dbi-collector
adds three new directives to RRD definitions which use it:
-
connect CONNECTNAME - specifies the connection to use, documented
under the dbi-connects config-dir.
-
select SELECTNAME - specifies the select statement to use, by name
as documented in dbi-selects config-dir.
-
multirowid COL# - specifies the column number to use to construct
the variable name for variables from this row. This permits the use of
select statements which return more than one row.
The connect
directive tells how to connect to the appropriate server
and database; the select
tells how to select the data.
For an RRD collected by the dbi-collector
, the data
directive will
require the column number in the select that will provide its data. This
will be appended to the data
directive like:
data xxx=yyy GAUGE:600:0:U COL=12
There are also pseudo-columns called STATUS
and RESPONSE
to enable the
rrd definition to reference the connection-status and response-time.
There are also some possible additions to the rrd
directive in the host
file. The rrd directive can look like:
rrd rrdname CONNECT="cc" SELECT="ss" USER="uu" PASSWORD="pp" DATABASE="dd"
All of the extras on the end are optional, and are provided in order to
be able to use a single connect file with multiple databases, users, ...
If the multirowid
is specified, then the variable returned is named
RRDNAME:DATANAME:ROWNAME
. Otherwise, it is named RRDNAME:DATANAME
.