Skip to content

Commit afd9aad

Browse files
committed
Added port cli option to postgres-graphite.rb.
1 parent 9a3346b commit afd9aad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/metric-postgres-graphite.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,17 @@ class CheckpostgresReplicationStatus < Sensu::Plugin::Metric::CLI::Graphite
3737
short: '-g SCHEME',
3838
long: '--scheme SCHEME',
3939
default: "#{Socket.gethostname}.postgres.replication_lag"
40+
41+
option :port,
42+
description: 'Database port',
43+
short: '-P PORT',
44+
long: '--port PORT',
45+
default: 5432
4046

4147
def run
4248
@dbmaster = config[:master_host]
4349
@dbslave = config[:slave_host]
44-
@dbport = 5432
50+
@dbport = config[:port]
4551
@dbname = config[:database]
4652
@dbusername = config[:user]
4753
@password = config[:pass]

0 commit comments

Comments
 (0)