2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

postgresql_transactions: change from bash to sh; fix shellcheck issues

This commit is contained in:
Lars Kruse 2018-06-10 13:56:07 +02:00
parent 93a567afbc
commit fdf6cea2b1

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#
# Plugin to monitor PostgreSQL Commits and Rollbacks in Transactions
#
@ -42,4 +42,4 @@ if [ "$1" = "config" ]; then
echo 'rollbacks.info Number of transaction rollbacks per second.'
exit 0
fi
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 "$dbserver" -U "$dbuser" -tc "SELECT 'commits.value '||SUM(xact_commit)::TEXT||E'\\nrollbacks.value '||SUM(xact_rollback)::TEXT FROM pg_stat_database;" --no-align