From 3c10c360cd2e4282886e1a2b88b5e58df55a0b18 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Sun, 10 Jun 2018 14:06:30 +0200 Subject: [PATCH] postgresql_transactions: configurable host and user --- plugins/postgresql/postgresql_transactions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/postgresql/postgresql_transactions b/plugins/postgresql/postgresql_transactions index e21708ab..82e01619 100755 --- a/plugins/postgresql/postgresql_transactions +++ b/plugins/postgresql/postgresql_transactions @@ -21,8 +21,8 @@ # Log info: # -dbserver='localhost' -dbuser='postgres' +dbhost=${dbhost:-localhost} +dbuser=${dbuser:-postgres} do_config() { @@ -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 }