mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Initial version
This commit is contained in:
parent
c7cc092609
commit
98df7ce7cf
1 changed files with 43 additions and 0 deletions
43
plugins/other/postgresql_transactions
Executable file
43
plugins/other/postgresql_transactions
Executable file
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Plugin to monitor PostgreSQL Commits and Rollbacks in Transactions
|
||||
#
|
||||
# Author:
|
||||
# Guilherme Augusto da Rocha Silva <gars.dba@gmail.com>
|
||||
#
|
||||
# Created:
|
||||
# 9th of november 2007
|
||||
#
|
||||
# Usage:
|
||||
# Place in /etc/munin/plugins/ (or link it there using ln -s)
|
||||
#
|
||||
# Parameters:
|
||||
# config (required)
|
||||
#
|
||||
# General info:
|
||||
# Require permission for database access and read (no writes are processed).
|
||||
# Recomended user is PostgreSQL database owner (default: postgres).
|
||||
#
|
||||
# Log info:
|
||||
#
|
||||
|
||||
dbserver='localhost'
|
||||
dbuser='postgres'
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_args --base 1000 --lower-limit 0'
|
||||
echo 'graph_category Postgresql'
|
||||
echo 'graph_info Shows summarized commits and rollbacks in transactions on the PostgreSQL Server.'
|
||||
echo 'graph_title PostgreSQL Transactions'
|
||||
echo 'graph_vlabel Number of Commits and Rollbacks'
|
||||
|
||||
echo 'commits.label commits'
|
||||
echo 'commits.min 0'
|
||||
echo 'commits.info Number of transaction commits.'
|
||||
|
||||
echo 'rollbacks.label rollbacks'
|
||||
echo 'rollbacks.min 0'
|
||||
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;"
|
Loading…
Add table
Add a link
Reference in a new issue