mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +00:00
- have some dirs
This commit is contained in:
parent
0b089ea777
commit
08346aac58
687 changed files with 0 additions and 0 deletions
|
@ -1,59 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Plugin to monitor PostgreSQL Locks
|
||||
#
|
||||
# Author:
|
||||
# Guilherme Augusto da Rocha Silva <gars.dba@gmail.com>
|
||||
#
|
||||
# Created:
|
||||
# 5th of november 2007
|
||||
#
|
||||
# Modified:
|
||||
# 22th of September 2011 by Nozomu Kaneko <nozom.kaneko@gmail.com>
|
||||
#
|
||||
# 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'
|
||||
|
||||
modes="AccessExclusive AccessShare Exclusive RowExclusive RowShare Share ShareRowExclusive ShareUpdateExclusive"
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_args --lower-limit 0'
|
||||
echo 'graph_category Postgresql'
|
||||
echo 'graph_info Shows active locks on database server.'
|
||||
echo 'graph_scale no'
|
||||
echo 'graph_title PostgreSQL Active Locks'
|
||||
echo 'graph_vlabel Number of active locks'
|
||||
for mode in $modes; do
|
||||
echo $mode.label $mode
|
||||
echo $mode.info `echo $mode | perl -pe 's/(.)([A-Z])/$1 $2/g'` Lock.
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for mode in $modes; do
|
||||
eval ${mode}=0
|
||||
done
|
||||
|
||||
eval $(psql -h ${dbserver} -U ${dbuser} template1 -tc "SELECT trim(mode, 'Lock'), COUNT(*) FROM pg_locks GROUP BY mode ORDER BY 1;" | while read name sep num
|
||||
do
|
||||
test -z "${name}" && continue
|
||||
echo ${name}=${num}
|
||||
done)
|
||||
|
||||
for mode in $modes; do
|
||||
echo ${mode}.value $(eval echo \$$mode)
|
||||
done
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue