pgbouncer_ is a plugin to get the pool and stat values for a single pgbouncer pool name
perl and DBD::Pg is required, and pgbouncer must been installed with a correct setup access for a stat account
the plugin that will be run needs to have the pool name after the plugin base name. alternatively, pool name can be specified in config file as env.pgbouncer_pool option, separating plugin name from pool name.
eg: pgbouncer_foo will run for the pool named foo.
see SHOW POOLS database list for the pool name
in the plugin config file under the [pgbouncer] name the access information ca be set.
eg: [pgbouncer*] env.pgbouncer_pass barfoo
more extended would be: [pgbouncer*] env.pgbouncer_pass barfoo env.pgbouncer_user bar env.pgbouncer_port 6542 env.pgbouncer_host localhost
another example, where different pgbouncers (and so munin plugins) connecting to same db: [pgbouncer_weblogin] env.pgbouncer_pass barfoo env.pgbouncer_user bar env.pgbouncer_port 6542 env.pgbouncer_host localhost env.pgbouncer_pool dbname
[pgbouncer_webmain] env.pgbouncer_pass barfoo env.pgbouncer_user bar env.pgbouncer_port 6543 env.pgbouncer_host localhost env.pgbouncer_pool dbname
The database name is always pgbouncer
The plugin will output 5 graphs in the group pgbouncer
This graph will show the average bytes sent and received by the pgbouncer for this pool
This graph will show the average amount of connections to the pgbouncer for this pool
This graph shows the average query time as processed by the pgbouncer for this pool in microseconds. The data will be shorted by standard SI. eg, m = milli, k = kilo.
So 4.61K is 4610 milliseconds
This graph shows the active and waiting client connections to pgbouncer for this pool
This graph shows the server connections to pgbouncer for this pool. The following data sets are shown: active, idle, used, tested, login
how long the oldest client the queue has waited, should be always 0
Original idea derived from a simple python script by Dimitri Fontaine
See further info on stats and pools on the pgbouncer homepage: http://pgbouncer.projects.postgresql.org/doc/usage.html#_show_commands
Clemens Schwaighofer <firstname.lastname@example.org>