Skip to content

Commit bed1616

Browse files
mickfeechsstarcher
authored andcommitted
Add connections for custom ports (#27)
* update to include custom ports * update changelog
1 parent 469954d commit bed1616

14 files changed

+27
-0
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
55

66
## [Unreleased]
7+
### Fixed
8+
- check-postgres-alive.rb: Fix connections using a custom port (#25)
9+
- check-postgres-connections.rb: Fix connections using a custom port (#25)
10+
- check-postgres-query.rb: Fix connections using a custom port (#25)
11+
- check-postgres-replication.rb: Fix connections using a custom port (#25)
12+
- metrics-postgres-connections.rb: Fix connections using a custom port (#25)
13+
- metrics-postgres-dbsize.rb: Fix connections using a custom port (#25)
14+
- metrics-postgres-graphite.rb: Fix connections using a custom port (#25)
15+
- metrics-postgres-locks.rb: Fix connections using a custom port (#25)
16+
- metrics-postgres-statsgbwriter.rb: Fix connections using a custom port (#25)
17+
- metrics-postgres-statsdb.rb: Fix connections using a custom port (#25)
18+
- metrics-postgres-statsio.rb: Fix connections using a custom port (#25)
19+
- metrics-postgres-statstable.rb: Fix connections using a custom port (#25)
20+
- metrics-postgres-query.rb: Fix connections using a custom port (#25)
721

822
## [1.0.1] - 2017-01-04
923
### Fixed

bin/check-postgres-alive.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def run
6969
dbname: config[:database],
7070
user: config[:user],
7171
password: config[:password],
72+
port: config[:port],
7273
connect_timeout: config[:timeout])
7374
res = con.exec('select version();')
7475
info = res.first

bin/check-postgres-connections.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def run
9797
dbname: config[:database],
9898
user: config[:user],
9999
password: config[:password],
100+
port: config[:port],
100101
connect_timeout: config[:timeout])
101102
max_conns = con.exec('SHOW max_connections').getvalue(0, 0).to_i
102103
current_conns = con.exec('SELECT count(*) from pg_stat_activity').getvalue(0, 0).to_i

bin/check-postgres-query.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def run
100100
dbname: config[:database],
101101
user: config[:user],
102102
password: config[:password],
103+
port: config[:port],
103104
connect_timeout: config[:timeout])
104105
res = con.exec(config[:query].to_s)
105106
rescue PG::Error => e

bin/check-postgres-replication.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def run
9898
dbname: config[:database],
9999
user: config[:user],
100100
password: config[:password],
101+
port: config[:port],
101102
sslmode: ssl_mode,
102103
connect_timeout: config[:timeout])
103104

bin/metric-postgres-connections.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def run
7979
dbname: config[:database],
8080
user: config[:user],
8181
password: config[:password],
82+
port: config[:port],
8283
connect_timeout: config[:timeout])
8384
request = [
8485
"select case when count(*) = 1 then 'waiting' else",

bin/metric-postgres-dbsize.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def run
7979
dbname: config[:database],
8080
user: config[:user],
8181
password: config[:password],
82+
port: config[:port],
8283
connect_timeout: config[:timeout])
8384
request = [
8485
"select pg_database_size('#{config[:database]}')"

bin/metric-postgres-graphite.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def run
8282
dbname: config[:database],
8383
user: config[:user],
8484
password: config[:password],
85+
port: config[:port],
8586
connect_timeout: config[:timeout])
8687
res1 = conn_master.exec('SELECT pg_current_xlog_location()').getvalue(0, 0)
8788
m_segbytes = conn_master.exec('SHOW wal_segment_size').getvalue(0, 0).sub(/\D+/, '').to_i << 20

bin/metric-postgres-locks.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def run
8181
dbname: config[:database],
8282
user: config[:user],
8383
password: config[:password],
84+
port: config[:port],
8485
connect_timeout: config[:timeout])
8586
request = [
8687
'SELECT mode, count(mode) FROM pg_locks',

bin/metric-postgres-statsbgwriter.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def run
7373
dbname: 'postgres',
7474
user: config[:user],
7575
password: config[:password],
76+
port: config[:port],
7677
connect_timeout: config[:timeout])
7778
request = [
7879
'select checkpoints_timed, checkpoints_req,',

0 commit comments

Comments
 (0)