Projet

Général

Profil

Révision 89898512

ID89898512d3464518c065deaf8b74622ef81919bd
Parent 955e8cec
Enfant a79acee6

Ajouté par André de Kock il y a plus de 8 ans

Fixed output of transactions script

The current output of this script is:

root@master:/etc/munin/plugins# ./pg_transactions
\ncommits.value xxxx\nrollbacks.value xxxx

By removing the first `\n` and by adding an `E` before the second `\n` the output is:

root@master:/etc/munin/plugins# ./pg_transactions
commits.value xxxx +
rollbacks.value xxxx

And lastly by adding the `--no-align` attribute you get the correct output:

root@master:/etc/munin/plugins# ./pg_transactions
commits.value xxxx
rollbacks.value xxxx

Voir les différences:

plugins/postgresql/postgresql_transactions
40 40
   echo 'rollbacks.info Number of transaction rollbacks.'
41 41
   exit 0
42 42
fi
43
psql -h ${dbserver} -U ${dbuser} -tc "SELECT '\ncommits.value '||SUM(xact_commit)::TEXT || '\nrollbacks.value '||SUM(xact_rollback)::TEXT FROM pg_stat_database;"
43
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

Formats disponibles : Unified diff