Révision 154cef14
postgresql_transactions: add support for DIRTYCONFIG
| plugins/postgresql/postgresql_transactions | ||
|---|---|---|
| 24 | 24 |
dbserver='localhost' |
| 25 | 25 |
dbuser='postgres' |
| 26 | 26 |
|
| 27 |
if [ "$1" = "config" ]; then |
|
| 27 |
|
|
| 28 |
do_config() {
|
|
| 28 | 29 |
echo 'graph_args --base 1000 --lower-limit 0' |
| 29 | 30 |
echo 'graph_category db' |
| 30 | 31 |
echo 'graph_info Shows summarized commits and rollbacks in transactions on the PostgreSQL Server.' |
| ... | ... | |
| 40 | 41 |
echo 'rollbacks.min 0' |
| 41 | 42 |
echo 'rollbacks.type DERIVE' |
| 42 | 43 |
echo 'rollbacks.info Number of transaction rollbacks per second.' |
| 43 |
exit 0 |
|
| 44 |
} |
|
| 45 |
|
|
| 46 |
|
|
| 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 |
|
| 49 |
} |
|
| 50 |
|
|
| 51 |
|
|
| 52 |
if [ "$1" = "config" ]; then |
|
| 53 |
do_config |
|
| 54 |
if [ "${MUNIN_CAP_DIRTYCONFIG:-0}" = "1" ]; then do_fetch; fi
|
|
| 55 |
else |
|
| 56 |
do_fetch |
|
| 44 | 57 |
fi |
| 45 |
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