Skip to content

Commit

Permalink
postgresql_transactions: configurable host and user
Browse files Browse the repository at this point in the history
  • Loading branch information
sumpfralle committed Jun 10, 2018
1 parent 154cef1 commit 3c10c36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/postgresql/postgresql_transactions
Expand Up @@ -21,8 +21,8 @@
# Log info:
#

dbserver='localhost'
dbuser='postgres'
dbhost=${dbhost:-localhost}
dbuser=${dbuser:-postgres}


do_config() {
Expand All @@ -45,7 +45,7 @@ do_config() {


do_fetch() {
psql -h "$dbserver" -U "$dbuser" -tc "SELECT 'commits.value '||SUM(xact_commit)::TEXT||E'\\nrollbacks.value '||SUM(xact_rollback)::TEXT FROM pg_stat_database;" --no-align
psql -h "$dbhost" -U "$dbuser" -tc "SELECT 'commits.value '||SUM(xact_commit)::TEXT||E'\\nrollbacks.value '||SUM(xact_rollback)::TEXT FROM pg_stat_database;" --no-align
}


Expand Down

0 comments on commit 3c10c36

Please sign in to comment.