Skip to content

Collectd plugin for obtaining connection metrics from PgPool-II

License

Notifications You must be signed in to change notification settings

mirekys/collectd-pgpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

collectd-pgpool

Collectd plugin for obtaining connection metrics from a running PgPool-II instance. Based on the collectd-python.

Installation & Configuration

  • Make sure you have configured pcp.conf on PgPool-II
  • Clone this repo: git clone https://github.com/mirekys/collectd-apachelog.git
  • Place pgpool.py and util.py to your collectd-python ModulePath
  • Update your collectd.conf
  <Plugin python>
        ModulePath "/../../collectd-plugins/"
        LogTraces false
        Interactive false
        Import 'pgpool'
        <Module pgpool>
                Hostname "localhost"
                PcpUser "pcpuser"
                PcpPassword "..."
                PcpPort "9898"
                PcpTimeout 1
        </Module>
</Plugin>

Output

Plugin executes the following PCP command:

pcp_proc_info -v $PCP_TIMEOUT $PCP_HOSTNAME $PCP_PORT $PCP_USER $PCP_PASSWORD

Which results in following output example:

pgpool/count-pools=6
pgpool/count-connections_per_pool=8
pgpool/count-pools-active=6
pgpool/count-pool0-dbname-dbuser-active_connections=1
pgpool/count-pool0-dbname-dbuser-total_connections=1
pgpool/count-pool1-dbname-dbuser-active_connections=0
pgpool/count-pool1-dbname-dbuser-total_connections=3
pgpool/count-pool2-dbname-dbuser-active_connections=0
pgpool/count-pool2-dbname-dbuser-total_connections=2
pgpool/count-pool3-dbname-dbuser-active_connections=0
pgpool/count-pool3-dbname-dbuser-total_connections=2
pgpool/count-pool4-dbname-dbuser-active_connections=1
pgpool/count-pool4-dbname-dbuser-total_connections=4
pgpool/count-pool5-dbname-dbuser-active_connections=1
pgpool/count-pool5-dbname-dbuser-total_connections=4

Debugging

You can run this plugin in standalone debug mode, where it outputs to console what would be otherwise sent to the collectd daemon:

./pgpool.py debug

About

Collectd plugin for obtaining connection metrics from PgPool-II

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages