https://github.com/mirekys/collectd-pgpool
Collectd plugin for obtaining connection metrics from PgPool-II
https://github.com/mirekys/collectd-pgpool
collectd collectd-pgpool collectd-plugin pcp pgpool-ii postgresql
Last synced: 3 months ago
JSON representation
Collectd plugin for obtaining connection metrics from PgPool-II
- Host: GitHub
- URL: https://github.com/mirekys/collectd-pgpool
- Owner: mirekys
- License: mit
- Created: 2015-11-19T10:34:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-19T13:35:58.000Z (over 9 years ago)
- Last Synced: 2025-01-08T10:46:06.365Z (5 months ago)
- Topics: collectd, collectd-pgpool, collectd-plugin, pcp, pgpool-ii, postgresql
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# collectd-pgpool
[Collectd](http://www.collectd.org/) plugin for obtaining connection metrics from a running [PgPool-II](http://www.pgpool.net/mediawiki/index.php/Main_Page) instance. Based on the [collectd-python](https://collectd.org/documentation/manpages/collectd-python.5.shtml).# Installation & Configuration
* Make sure you have configured [pcp.conf](http://www.pgpool.net/docs/latest/pgpool-en.html#config) 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
```
ModulePath "/../../collectd-plugins/"
LogTraces false
Interactive false
Import 'pgpool'
Hostname "localhost"
PcpUser "pcpuser"
PcpPassword "..."
PcpPort "9898"
PcpTimeout 1
```
# 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 ```