postgresql plugin: Added a plugin to collect PostgreSQL database statistics.
This plugin collects active server connections, transaction numbers, block IO
and table row manipulations of PostgreSQL databases. For this purpose it keeps
persistent connections to all configured databases. The statistics are
collected from PostgreSQL's "statistics collector" subsystem.
Currently, statistics are collected from the pg_stat_database,
pg_stat_user_tables and pg_statio_user_tables views. The following new types
have been introduced: pg_blks, pg_n_tup_c, pg_n_tup_g, pg_numbackends, pg_scan
and pg_xact. The type names are basically the same as the column names in the
queried views to keep things consistent. For the number of tuples, counter and
gauge values exist, so the type names have been prefixed with "_c" and "_g"
respectively.
Sample plugin configuration:
<Plugin postgresql>
<Database foo>
Host "hostname"
Port "5432"
User "username"
Password "secret"
SSLMode "prefer"
KRBSrvName "kerberos_service_name"
</Database>
<Database bar>
Service "service_name"
</Database>
</Plugin>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>