Projet

Général

Profil

Révision 3c10c360

ID3c10c360cd2e4282886e1a2b88b5e58df55a0b18
Parent 154cef14
Enfant e93a46bc

Ajouté par Lars Kruse il y a plus de 7 ans

postgresql_transactions: configurable host and user

Voir les différences:

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