Skip to content

Commit

Permalink
Fix user for pgsql checks
Browse files Browse the repository at this point in the history
This is the user meant for automation and the only one allowed to connect
without a password in 11.1.8.
  • Loading branch information
jaymzh committed Jul 29, 2014
1 parent 64cbf36 commit 50011b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chef-server-stats/chef-server-stats
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_postgresql_stats(embedded_path)
stats = {}
q = "SELECT SUM(#{columns.join('), SUM(')}) FROM pg_stat_all_tables;"
cmd = "su opscode-pgsql -c \"cd; #{psql_bin} -A -P tuples_only -U " +
"opscode_chef_ro -d opscode_chef -c '#{q}'\""
"opscode-pgsql -d opscode_chef -c '#{q}'\""

s = Mixlib::ShellOut.new(cmd).run_command
if s.exitstatus == 0
Expand All @@ -169,7 +169,7 @@ def get_postgresql_stats(embedded_path)
# postgresql connection count
q = "SELECT count(*) FROM pg_stat_activity WHERE datname = 'opscode_chef';"
cmd = "su opscode-pgsql -c \"cd; #{psql_bin} -A -P tuples_only -U " +
"opscode_chef_ro -d opscode_chef -c \\\"#{q}\\\"\""
"opscode-pgsql -d opscode_chef -c \\\"#{q}\\\"\""

s = Mixlib::ShellOut.new(cmd).run_command
if s.exitstatus == 0
Expand Down

0 comments on commit 50011b3

Please sign in to comment.