Révision 3c10c360
postgresql_transactions: configurable host and user
| plugins/postgresql/postgresql_transactions | ||
|---|---|---|
| 21 | 21 |
# Log info: |
| 22 | 22 |
# |
| 23 | 23 |
|
| 24 |
dbserver='localhost'
|
|
| 25 |
dbuser='postgres'
|
|
| 24 |
dbhost=${dbhost:-localhost}
|
|
| 25 |
dbuser=${dbuser:-postgres}
|
|
| 26 | 26 |
|
| 27 | 27 |
|
| 28 | 28 |
do_config() {
|
| ... | ... | |
| 45 | 45 |
|
| 46 | 46 |
|
| 47 | 47 |
do_fetch() {
|
| 48 |
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
|
|
| 48 |
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
|
|
| 49 | 49 |
} |
| 50 | 50 |
|
| 51 | 51 |
|
Formats disponibles : Unified diff