From 89898512d3464518c065deaf8b74622ef81919bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20de=20Kock?= Date: Sat, 22 Jul 2017 11:29:00 +0200 Subject: [PATCH] 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 --- plugins/postgresql/postgresql_transactions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/postgresql/postgresql_transactions b/plugins/postgresql/postgresql_transactions index 8c39ac22..f13740a5 100755 --- a/plugins/postgresql/postgresql_transactions +++ b/plugins/postgresql/postgresql_transactions @@ -40,4 +40,4 @@ if [ "$1" = "config" ]; then echo 'rollbacks.info Number of transaction rollbacks.' exit 0 fi -psql -h ${dbserver} -U ${dbuser} -tc "SELECT '\ncommits.value '||SUM(xact_commit)::TEXT || '\nrollbacks.value '||SUM(xact_rollback)::TEXT FROM pg_stat_database;" +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