ืื ื’ืœื™ืชืฆืจืคืชื™ืชืกืคืจื“ื™

ืกืžืœ OnWorks

check_postgres_relation_sizep - ืžืงื•ื•ืŸ ื‘ืขื ืŸ

ื”ืคืขืœ ืืช check_postgres_relation_sizep ื‘ืกืคืง ืื™ืจื•ื— ื—ื™ื ืžื™ ืฉืœ OnWorks ื‘ืืžืฆืขื•ืช ืื•ื‘ื•ื ื˜ื• ืžืงื•ื•ืŸ, ืคื“ื•ืจื” ืžืงื•ื•ืŸ, ืืžื•ืœื˜ื•ืจ ืžืงื•ื•ืŸ ืฉืœ Windows ืื• ืืžื•ืœื˜ื•ืจ ืžืงื•ื•ืŸ ืฉืœ MAC OS

ื–ื•ื”ื™ ื”ืคืงื•ื“ื” check_postgres_relation_sizep ืฉื ื™ืชืŸ ืœื”ืคืขื™ืœ ื‘ืกืคืง ื”ืื™ืจื•ื— ื”ื—ื™ื ืžื™ ืฉืœ OnWorks ื‘ืืžืฆืขื•ืช ืื—ืช ืžืชื—ื ื•ืช ื”ืขื‘ื•ื“ื” ื”ืžืงื•ื•ื ื•ืช ื”ืžืจื•ื‘ื•ืช ืฉืœื ื• ื‘ื—ื™ื ื ื›ื’ื•ืŸ Ubuntu Online, Fedora Online, ืืžื•ืœื˜ื•ืจ ืžืงื•ื•ืŸ ืฉืœ Windows ืื• ืืžื•ืœื˜ื•ืจ ืžืงื•ื•ืŸ ืฉืœ MAC OS

ืชึธื›ึฐื ึดื™ืช:

ืฉืึตื


check_postgres - ืกืงืจื™ืคื˜ ื ื™ื˜ื•ืจ Postgres ืขื‘ื•ืจ Nagios, MRTG, Cacti ื•ืื—ืจื™ื

ืžืกืžืš ื–ื” ืžืชืืจ ืืช ื’ืจืกื” 2.22.0 ืฉืœ check_postgres

ืชึทืงืฆึดื™ืจ


## ืฆื•ืจ ืืช ื›ืœ ื”ืงื™ืฉื•ืจื™ื ื”ืกืžืœื™ื™ื
check_postgres --symlinks

## ื‘ื“ื•ืง ืืช ื”ื—ื™ื‘ื•ืจ ืœืžืกื“ ื”ื ืชื•ื ื™ื 'pluto' ืฉืœ Postgres:
check_postgres --action=ื—ื™ื‘ื•ืจ --db=pluto

## ืื•ืชื ื“ื‘ืจื™ื, ืื‘ืœ ื‘ืืžืฆืขื•ืช ื”-Symlink
check_postgres_connection --db=pluto

## ื”ื–ื”ืจ ืื > 100 ื ืขื™ืœื•ืช, ืงืจื™ื˜ื™ ืื > 200, ืื• > 20 ื‘ืœืขื“ื™ื™ื
check_postgres_locks --warning=100 --critical="total=200:exclusive=20"

## ื”ืฆื’ ืืช ื”ืžืกืคืจ ื”ื ื•ื›ื—ื™ ืฉืœ ื—ื™ื‘ื•ืจื™ื ืกืจืง ื‘ื™ืฆื™ืื” 6543:
check_postgres_txn_idle --port=6543 --output=simple

## ื™ืฉื ืŸ ืคืขื•ืœื•ืช ื•ืืคืฉืจื•ื™ื•ืช ืจื‘ื•ืช ืื—ืจื•ืช, ืื ื ื”ืžืฉื™ื›ื• ืœืงืจื•ื.

ืืช ื”ื—ื“ืฉื•ืช ื•ื”ืชื™ืขื•ื“ ื”ืื—ืจื•ื ื•ืช ื ื™ืชืŸ ืœืžืฆื•ื ืชืžื™ื“ ื‘ื›ืชื•ื‘ืช:
http://bucardo.org/check_postgres/

ืชื™ืื•ืจ


check_postgres ื”ื•ื ืกืงืจื™ืคื˜ Perl ื”ืžืจื™ืฅ ื‘ื“ื™ืงื•ืช ืจื‘ื•ืช ื•ืฉื•ื ื•ืช ื›ื ื’ื“ ืื—ื“ ืื• ื™ื•ืชืจ
ืžืื’ืจื™ ืžื™ื“ืข ืฉืœ Postgres. ื”ื•ื ืžืฉืชืžืฉ ื‘ืชื•ื›ื ืช psql ื›ื“ื™ ืœืืกื•ืฃ ืืช ื”ืžื™ื“ืข, ื•ืžื•ืฆื™ื ืืช
ืชื•ืฆืื•ืช ื‘ืื—ื“ ืžืฉืœื•ืฉื” ืคื•ืจืžื˜ื™ื: Nagios, MRTG ืื• ืคืฉื•ื˜.

ืชึฐืคื•ึผืงึธื” ืžืฆื‘ื™ื
ื ื™ืชืŸ ืœืฉื ื•ืช ืืช ื”ืคืœื˜ ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘ืืคืฉืจื•ืช "--output". ืคืœื˜ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื•ื nagios,
ืื ื›ื™ ื ื™ืชืŸ ืœืฉื ื•ืช ื–ืืช ื‘ื—ืœืง ื”ืขืœื™ื•ืŸ ืฉืœ ื”ืกืงืจื™ืคื˜ ืื ืชืจืฆื”. ื”ืืคืฉืจื•ืช ื”ื ื•ื›ื—ื™ืช
ื‘ื—ื™ืจื•ืช ื”ืŸ ื ื’ื™ื•ืก, mrtg, ื• ืคืฉื•ื˜. ื›ื“ื™ ืœื”ื™ืžื ืข ืžื”ืฆื•ืจืš ืœื”ื–ื™ืŸ ืืช ืืจื’ื•ืžื ื˜ ื”ืคืœื˜ ื›ืœ ืื—ื“
ื–ืžืŸ, ืกื•ื’ ื”ืคืœื˜ ืžื•ื’ื“ืจ ืื•ื˜ื•ืžื˜ื™ืช ืื ืœื ื ื™ืชืŸ ืืจื’ื•ืžื ื˜ --output, ื•ืื ื”-
ื‘ืกืคืจื™ื™ื” ื”ื ื•ื›ื—ื™ืช ื™ืฉ ืื—ืช ืžืืคืฉืจื•ื™ื•ืช ื”ืคืœื˜ ื‘ืฉืžื”. ืœื“ื•ื’ืžื”, ื™ืฆื™ืจืช ื
ืกืคืจื™ื™ื” ื‘ืฉื mrtg ื•ืžืื›ืœืกืช ืื•ืชื” ื‘ืงื™ืฉื•ืจื™ื ืกื™ืžืœื™ื™ื ื“ืจืš ื” --ืงื™ืฉื•ืจื™ื ืกื™ืžื ื™ื ื”ื˜ื™ืขื•ืŸ ื”ื™ื”
ื•ื“ื ืฉื›ืœ ื”ืคืขื•ืœื•ืช ื”ืžื•ืคืขืœื•ืช ืžืื•ืชื” ืกืคืจื™ื™ื” ืชืžื™ื“ ื™ื”ื™ื• ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ืœืคืœื˜ ืฉืœ "mrtg"
ื›ืงื™ืฆื•ืจ ื“ืจืš ืขื‘ื•ืจ --output=simple, ืืชื” ื™ื›ื•ืœ ืœื”ื–ื™ืŸ --simple, ืฉื’ื ืžื—ืœื™ืฃ ืืช ื”
ื˜ืจื™ืง ืœืžืชืŸ ืฉืžื•ืช ืฉืœ ืกืคืจื™ื•ืช.

ื ืื’ื™ื•ืก ืชืคื•ืงื”

ืคื•ืจืžื˜ ื”ืคืœื˜ ื”ืžื•ื’ื“ืจ ื›ื‘ืจื™ืจืช ืžื—ื“ืœ ื”ื•ื ืขื‘ื•ืจ Nagios, ืฉื”ื•ื ืฉื•ืจืช ืžื™ื“ืข ื‘ื•ื“ื“ืช, ื™ื—ื“ ืขื
ืืจื‘ืขื” ืงื•ื“ื™ ื™ืฆื™ืื” ืกืคืฆื™ืคื™ื™ื:

0 (ื‘ืกื“ืจ)
1 (ืื–ื”ืจื”)
2 (ืงืจื™ื˜ื™)
3 (ืœื ื™ื“ื•ืข)

ืฉื•ืจืช ื”ืคืœื˜ ื”ื™ื ืื—ืช ืžื”ืžื™ืœื™ื ืœืžืขืœื”, ื ืงื•ื“ืชื™ื™ื, ื•ืœืื—ืจ ืžื›ืŸ ืชื™ืื•ืจ ืงืฆืจ ืฉืœ ืžื”
ื ืžื“ื“. ืžื™ื“ืข ืกื˜ื˜ื™ืกื˜ื™ ื ื•ืกืฃ, ื›ืžื• ื’ื ืžืฉืš ื”ื–ืžืŸ ื”ื›ื•ืœืœ ืฉืœ ื”ืคืงื•ื“ื”
ืœืงื—, ื ื™ืชืŸ ืœืคืœื˜ ื’ื ื›ืŸ: ืขื™ื™ืŸ ื‘ืชื™ืขื•ื“ ืขืœ ื”ื˜ื™ืขื•ื ื™ื --showperf,
--perflimit, ื• --ื–ืžืŸ ื”ื”ืฆื’ื”.

MRTG ืชืคื•ืงื”

ืคืœื˜ MRTG ื”ื•ื ืืจื‘ืข ืฉื•ืจื•ืช, ื›ืืฉืจ ื”ืฉื•ืจื” ื”ืจืืฉื•ื ื” ืชืžื™ื“ ื ื•ืชื ืช ืžืกืคืจ ื‘ื•ื“ื“ ืฉืœ
ื—ึฒืฉืึดื™ื‘ื•ึผืช. ื‘ืžื™ื“ืช ื”ืืคืฉืจ, ืžืกืคืจ ื–ื” ืžื™ื™ืฆื’ ืขืจืš ืžืžืฉื™ ื›ื’ื•ืŸ ืžืกืคืจ ืฉืœ
ื‘ืชื™ื, ืื‘ืœ ื–ื” ื™ื›ื•ืœ ืœื”ื™ื•ืช ื’ื 1 ืื• 0 ืขื‘ื•ืจ ืคืขื•ืœื•ืช ืฉืžื—ื–ื™ืจื•ืช ืจืง "true" ืื• "false", ื›ื’ื•ืŸ
ื‘ืชื•ืจ check_postgres_version. ื”ืฉื•ืจื” ื”ืฉื ื™ื™ื” ื”ื™ื ื ืชื•ืŸ ื ื•ืกืฃ ื•ืžืฉืžืฉืช ืจืง ืขื‘ื•ืจ
ื›ืžื” ืคืขื•ืœื•ืช. ื”ืฉื•ืจื” ื”ืฉืœื™ืฉื™ืช ืžืฆื™ื™ื ืช "ื–ืžืŸ ืคืขื•ืœื”" ื•ืื™ื ื” ื‘ืฉื™ืžื•ืฉ. ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ื”ื™ื ื
ืชื™ืื•ืจ ื•ื‘ื“ืจืš ื›ืœืœ ืžืฆื™ื™ืŸ ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ื”ื ืชื•ืŸ ืžื”ืฉื•ืจื” ื”ืจืืฉื•ื ื”
ื ืฉืœืฃ, ืืš ืขืฉื•ื™ ืœื”ื™ื•ืช ืฉื•ื ื” ื‘ื”ืชืื ืœืคืขื•ืœื”.

ื—ืœืง ืžื”ืคืขื•ืœื•ืช ืžืงื‘ืœื•ืช ืื•ืคืฆื™ื•ื ืœื™ --mrtg ืืจื’ื•ืžื ื˜ ืœืฉืœื™ื˜ื” ื ื•ืกืคืช ืขืœ ื”ืคืœื˜.

ืขื™ื™ืŸ ื‘ืชื™ืขื•ื“ ืขืœ ื›ืœ ืคืขื•ืœื” ืœืคืจื˜ื™ื ืขืœ ื”ืคืœื˜ ื”ืžื“ื•ื™ืง ืฉืœ MRTG ืขื‘ื•ืจ ื›ืœ ืคืขื•ืœื”.

ืคึผึธืฉืื•ึผื˜ ืชืคื•ืงื”

ื”ืคืœื˜ ื”ืคืฉื•ื˜ ื”ื•ื ืคืฉื•ื˜ ื’ืจืกื” ืงื˜ื•ืžื” ืฉืœ ื”-MRTG, ื•ืคืฉื•ื˜ ืžื—ื–ื™ืจ ืืช
ืžืกืคืจ ืจืืฉื•ืŸ ื•ืชื• ืœื. ื–ื” ืžืื•ื“ ืฉื™ืžื•ืฉื™ ื›ืืฉืจ ืืชื” ืจืง ืจื•ืฆื” ืœื‘ื“ื•ืง ืืช ื”ืžืฆื‘
ืฉืœ ืžืฉื”ื•, ืœืœื ืงืฉืจ ืœืกืฃ ื›ืœืฉื”ื•. ืืชื” ื™ื›ื•ืœ ืœืฉื ื•ืช ืืช ื”ืคืœื˜ ื”ืžืกืคืจื™ ืขืœ ื™ื“ื™
ื”ื•ืกืคืช KB, MB, GB, TB ืื• EB ืœืืจื’ื•ืžื ื˜ ื”ืคืœื˜, ืœื“ื•ื’ืžื”:

--output=ืคืฉื•ื˜,MB

ืงืงื˜ื•ืก ืชืคื•ืงื”

ืคืœื˜ ื”ืงืงื˜ื•ืกื™ื ืžื•ืจื›ื‘ ืžืคืจื™ื˜ ืื—ื“ ืื• ื™ื•ืชืจ ื‘ืื•ืชื” ืฉื•ืจื”, ืขื ืฉื ืคืฉื•ื˜, ื
ื ืงื•ื“ืชื™ื™ื, ื•ืœืื—ืจ ืžื›ืŸ ืžืกืคืจ. ื›ืจื’ืข, ื”ืคืขื•ืœื” ื”ื™ื—ื™ื“ื” ืขื ืคืœื˜ ืงืงื˜ื•ืกื™ื ืžืคื•ืจืฉ ื”ื™ื
'dbstats', ื•ืฉื™ืžื•ืฉ ื‘ืืคืฉืจื•ืช --output ืื™ื ื• ื ื—ื•ืฅ ื‘ืžืงืจื” ื–ื”, ืžื›ื™ื•ื•ืŸ ืฉืงืงื˜ื•ืกื™ื ื”ื ื”ื™ื—ื™ื“ื™ื
ืคืœื˜ ืขื‘ื•ืจ ืคืขื•ืœื” ื–ื•. ืขื‘ื•ืจ ืคืขื•ืœื•ืช ืจื‘ื•ืช ืื—ืจื•ืช, ืžืกืคื™ืง ืฉื™ืžื•ืฉ ื‘--simple ื›ื“ื™ ืœื™ืฆื•ืจ ืงืงื˜ื•ืกื™ื
ืฉืžื—.

ืžืื’ืจ ืžื™ื“ืข ื—ื™ื‘ื•ืจ ืืคืฉืจื•ื™ื•ืช


ื›ืœ ื”ืคืขื•ืœื•ืช ืžืงื‘ืœื•ืช ืงื‘ื•ืฆื” ืžืฉื•ืชืคืช ืฉืœ ืืคืฉืจื•ื™ื•ืช ืžืกื“ ื ืชื•ื ื™ื.

-H ืฉืึตื or --host=NAME
ื”ืชื—ื‘ืจ ืœืžืืจื— ื”ืžืฆื•ื™ืŸ ืขืœ ื™ื“ื™ NAME. ื™ื›ื•ืœื” ืœื”ื™ื•ืช ืจืฉื™ืžื” ืฉืœ ืฉืžื•ืช ืžื•ืคืจื“ื™ื ื‘ืคืกื™ืงื™ื.
ืžื•ืชืจื™ื ืืจื’ื•ืžื ื˜ื™ื ืžืจื•ื‘ื™ื ืฉืœ ืžืืจื—. ืื ืœื ื ื™ืชืŸ ืžืืจื—, ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื "PGHOST"
ืžืฉืชื ื” ืกื‘ื™ื‘ื” ืื• ืœืœื ืžืืจื— ื›ืœืœ (ืžื” ืฉืžืฆื‘ื™ืข ืขืœ ืฉื™ืžื•ืฉ ื‘ืฉืงืข Unix ืžืงื•ืžื™).
ืืชื” ื™ื›ื•ืœ ื’ื ืœื”ืฉืชืžืฉ ื‘---dbhost.

-p ื ืžืœ or --port=PORT
ืžืชื—ื‘ืจ ื‘ืืžืฆืขื•ืช ืžืกืคืจ ื”-PORT ืฉืฆื•ื™ืŸ. ื™ื›ื•ืœื” ืœื”ื™ื•ืช ืจืฉื™ืžื” ืžื•ืคืจื“ืช ื‘ืคืกื™ืงื™ื ืฉืœ ื™ืฆื™ืื•ืช
ืžืกืคืจื™ื ื•ืืจื’ื•ืžื ื˜ื™ื ืฉืœ ื™ืฆื™ืื” ืžืจื•ื‘ื™ื ืžื•ืชืจื™ื. ืื ืœื ื ื™ืชืŸ ืžืกืคืจ ื™ืฆื™ืื”, ื‘ืจื™ืจืช ื”ืžื—ื“ืœ
ืœืžืฉืชื ื” ื”ืกื‘ื™ื‘ื” "PGPORT". ืื ื–ื” ืœื ืžื•ื’ื“ืจ, ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื 5432. ืืชื” ื™ื›ื•ืœ
ื”ืฉืชืžืฉ ื’ื ื‘---dbport

-db ืฉืึตื or --dbname=NAME
ืžืฆื™ื™ืŸ ืœืื™ื–ื” ืžืกื“ ื ืชื•ื ื™ื ืœื”ืชื—ื‘ืจ. ื™ื›ื•ืœื” ืœื”ื™ื•ืช ืจืฉื™ืžื” ืžื•ืคืจื“ืช ื‘ืคืกื™ืงื™ื ืฉืœ ืฉืžื•ืช, ื•
ืžื•ืชืจื™ื ืืจื’ื•ืžื ื˜ื™ื ืžืจื•ื‘ื™ื ืฉืœ dbname. ืื ืœื ืžืกื•ืคืงืช ืืคืฉืจื•ืช dbname, ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื
ืžืฉืชื ื” ื”ืกื‘ื™ื‘ื” "PGDATABASE". ืื ื–ื” ืœื ืžื•ื’ื“ืจ, ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื 'postgres'
ืื psql ื”ื•ื ื’ืจืกื” 8 ื•ืžืขืœื”, ื•-'template1' ืื—ืจืช.

-u ืืช USERNAME or --dbuser=USERNAME
ืฉื ืžืฉืชืžืฉ ืžืกื“ ื”ื ืชื•ื ื™ื ืฉื™ืฉ ืœื”ืชื—ื‘ืจ ืืœื™ื•. ื™ื›ื•ืœื” ืœื”ื™ื•ืช ืจืฉื™ืžื” ืžื•ืคืจื“ืช ื‘ืคืกื™ืงื™ื ืฉืœ
ืฉืžื•ืช ืžืฉืชืžืฉ ื•ืืจื’ื•ืžื ื˜ื™ื ืžืจื•ื‘ื™ื ืฉืœ dbuser ืžื•ืชืจื™ื. ืื ื–ื” ืœื ืžืกื•ืคืง, ื–ื”
ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ืœืžืฉืชื ื” ื”ืกื‘ื™ื‘ื” "PGUSER", ืื—ืจืช ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื 'postgres'.

--dbpass=PASSWORD
ืžืกืคืง ืืช ื”ืกื™ืกืžื” ืœื—ื™ื‘ื•ืจ ืœืžืกื“ ื”ื ืชื•ื ื™ื. ื”ืฉื™ืžื•ืฉ ื‘ืืคืฉืจื•ืช ื–ื• ื”ื•ื ืจื‘
ืžื™ื•ืืฉ. ื‘ืžืงื•ื ื–ืืช, ื™ืฉ ืœื”ืฉืชืžืฉ ื‘ืงื•ื‘ืฅ .pgpass ืื• pg_service.conf.

--dbservice=NAME
ืฉื ืฉื™ืจื•ืช ื‘ืชื•ืš ื”ืงื•ื‘ืฅ pg_service.conf. ืœืคื ื™ ื’ืจืกื” 9.0 ืฉืœ
Postgres, ื–ื”ื• ืงื•ื‘ืฅ ื’ืœื•ื‘ืœื™ ืฉื ืžืฆื ื‘ื“ืจืš ื›ืœืœ ื‘- /etc/pg_service.conf. ืื ืืชื”
ื‘ืืžืฆืขื•ืช ื’ืจืกื” 9.0 ื•ืžืขืœื” ืฉืœ Postgres, ืืชื” ื™ื›ื•ืœ ืœื”ืฉืชืžืฉ ื‘ืงื•ื‘ืฅ ".pg_service.conf" ื‘
ืกืคืจื™ื™ืช ื”ื‘ื™ืช ืฉืœ ื”ืžืฉืชืžืฉ ื”ืžืจื™ืฅ ืืช ื”ืกืงืจื™ืคื˜, ืœืžืฉืœ nagios.

ืงื•ื‘ืฅ ื–ื” ืžื›ื™ืœ ืจืฉื™ืžื” ืคืฉื•ื˜ื” ืฉืœ โ€‹โ€‹ืืคืฉืจื•ื™ื•ืช ื—ื™ื‘ื•ืจ. ืืชื” ื™ื›ื•ืœ ื’ื ืœืขื‘ื•ืจ ื ื•ืกืฃ
ืžื™ื“ืข ื‘ืขืช ืฉื™ืžื•ืฉ ื‘ืืคืฉืจื•ืช ื–ื• ื›ื’ื•ืŸ --dbservice="maindatabase sslmode=require"

ื ื™ืชืŸ ืœืžืฆื•ื ืืช ื”ืชื™ืขื•ื“ ืœืงื•ื‘ืฅ ื–ื” ื‘ื›ืชื•ื‘ืช
http://www.postgresql.org/docs/current/static/libpq-pgservice.html

ื ื™ืชืŸ ืœืงื‘ืฅ ืืช ืืคืฉืจื•ื™ื•ืช ื”ื—ื™ื‘ื•ืจ ืœืžืกื“ ื”ื ืชื•ื ื™ื: --host=a,b --host=c --port=1234
--port=3344 ื™ืชื—ื‘ืจ ืœ-a-1234, b-1234 ื•-c-3344. ืฉื™ืžื• ืœื‘ ืฉืœืื—ืจ ื”ื”ื’ื“ืจื”, ืืคืฉืจื•ืช
ืžืžืฉื™ืš ืขื“ ืฉื”ื•ื ืžืฉืชื ื” ืฉื•ื‘.

ื“ื•ื’ืžืื•ืช:

--host=a,b --port=5433 --db=c
ืžืชื—ื‘ืจ ืคืขืžื™ื™ื ืœื™ืฆื™ืื” 5433, ื‘ืืžืฆืขื•ืช ืžืกื“ ื ืชื•ื ื™ื c, ืœืžืืจื—ื™ื a ื•-b: a-5433-c b-5433-c

--host=a,b --port=5433 --db=c,d
ืžืชื—ื‘ืจ ืืจื‘ืข ืคืขืžื™ื: a-5433-c a-5433-d b-5433-c b-5433-d

--host=a,b --host=foo --port=1234 --port=5433 --db=e,f
ืžืชื—ื‘ืจ ืฉืฉ ืคืขืžื™ื: a-1234-e a-1234-f b-1234-e b-1234-f foo-5433-e foo-5433-f

--host=a,b --host=x --port=5432,5433 --dbuser=alice --dbuser=bob -db=baz
ืžืชื—ื‘ืจ ืฉืœื•ืฉ ืคืขืžื™ื: a-5432-alice-baz b-5433-alice-baz x-5433-bob-baz

--dbservice="foo" --port=5433
ืžืชื—ื‘ืจ ื‘ืืžืฆืขื•ืช ื”ืฉื™ืจื•ืช ื‘ืฉื 'foo' ื‘ืงื•ื‘ืฅ pg_service.conf, ืืš ืขื•ืงืฃ ืืช ื”ื™ืฆื™ืื”

ืื—ืจ ืืคืฉืจื•ื™ื•ืช


ืืคืฉืจื•ื™ื•ืช ืื—ืจื•ืช ื›ื•ืœืœื•ืช:

--action=NAME
ืžืฆื™ื™ืŸ ืื™ื–ื• ืคืขื•ืœื” ืื ื• ืžืคืขื™ืœื™ื. ื ื“ืจืฉ ืืœื ืื ื›ืŸ ืžืฉืชืžืฉื™ื ื‘ืงื•ื‘ืฅ ืขื ืงื™ืฉื•ืจ ืกื™ืžื•ืœ, ืฉื‘ื•
ื‘ืžืงืจื” ืฉืฉื ื”ืงื•ื‘ืฅ ืžืฉืžืฉ ื›ื“ื™ ืœื”ื‘ื™ืŸ ืืช ื”ืคืขื•ืœื”.

-- ืื–ื”ืจื”=VAL or -w ืžื“ื“
ืžื’ื“ื™ืจ ืืช ื”ืกืฃ ืฉื‘ื• ืžื•ืคืขืœืช ื”ืชืจืืช ืื–ื”ืจื”. ื”ืืคืฉืจื•ื™ื•ืช ื”ืชืงืคื•ืช ืœื›ืš
ื”ืืคืฉืจื•ืช ืชืœื•ื™ื” ื‘ืคืขื•ืœื” ืฉื‘ื” ื ืขืฉื” ืฉื™ืžื•ืฉ.

--critical=VAL or -c ืžื“ื“
ืžื’ื“ื™ืจ ืืช ื”ืกืฃ ืฉื‘ื• ืžื•ืคืขืœืช ื”ืชืจืื” ืงืจื™ื˜ื™ืช. ื”ืืคืฉืจื•ื™ื•ืช ื”ืชืงืคื•ืช ืœื›ืš
ื”ืืคืฉืจื•ืช ืชืœื•ื™ื” ื‘ืคืขื•ืœื” ืฉื‘ื” ื ืขืฉื” ืฉื™ืžื•ืฉ.

-t ืžื“ื“ or --timeout=VAL
ืžื’ื“ื™ืจ ืืช ื”ื–ืžืŸ ื”ืงืฆื•ื‘ ื‘ืฉื ื™ื•ืช ืฉืœืื—ืจื™ื• ื”ืกืงืจื™ืคื˜ ื™ื‘ื˜ืœ ืืช ื›ืœ ืžื” ืฉื”ื•ื ืขื•ืฉื”
ืœื”ื—ื–ื™ืจ ืกื˜ื˜ื•ืก ืœื ื™ื“ื•ืข. ื”ื–ืžืŸ ื”ืงืฆื•ื‘ ื”ื•ื ืœื›ืœ ืืฉื›ื•ืœ Postgres, ืœื ืขื‘ื•ืจ ื›ื•ืœื•
ืชึทืกืจึดื™ื˜. ืขืจืš ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื•ื 10; ื”ื™ื—ื™ื“ื•ืช ื”ืŸ ืชืžื™ื“ ื‘ืฉื ื™ื•ืช.

--ื”ื ื—ื”-ืžืฆื‘ ื”ืžืชื ื”
ืื ืฆื•ื™ืŸ, ืจืืฉื™ืช ื”ื‘ื“ื™ืงื” ืื ื”ืฉืจืช ื‘ืžืฆื‘ ื”ืžืชื ื” ื™ื‘ื•ืฆืข (--datadir
ื ื“ืจืฉ), ืื ื›ืŸ, ื›ืœ ื”ื‘ื“ื™ืงื•ืช ื”ื“ื•ืจืฉื•ืช ืฉืื™ืœืชื•ืช SQL ื™ืชืขืœืžื• ื•"ืฉืจืช
ื‘ืžืฆื‘ ื”ืžืชื ื”" ืขื ืžืฆื‘ ืื™ืฉื•ืจ ื™ื•ื—ื–ืจ ื‘ืžืงื•ื ื–ืืช.

ื“ื•ื’ืžื:

postgres@db$./check_postgres --action=version --warning=8.1 --datadir /var/lib/postgresql/8.3/main/ --assume-standby-mode
POSTGRES_VERSION ืื™ืฉื•ืจ: ืฉืจืช ื‘ืžืฆื‘ ื”ืžืชื ื” | ื–ืžืŸ=0.00

--ื”ื ื—ื”-ืคืจื•ื“
ืื ืฆื•ื™ืŸ, ื‘ื“ื•ืง ืื ื”ืฉืจืช ื‘ืžืฆื‘ ื™ื™ืฆื•ืจ ืžื‘ื•ืฆืข (--datadir ื ื“ืจืฉ).
ื”ืืคืฉืจื•ืช ืจืœื•ื•ื ื˜ื™ืช ืจืง ืขื‘ื•ืจ ("ืงื™ืฉื•ืจ ืกื™ืžืŸ: check_postgres_checkpoint").

ื“ื•ื’ืžื:

postgres@db$./check_postgres --action=checkpoint --datadir /var/lib/postgresql/8.3/main/ --assume-prod
POSTGRES_CHECKPOINT ื‘ืกื“ืจ: ื”ืžื—ืกื•ื ื”ืื—ืจื•ืŸ ื”ื™ื” ืœืคื ื™ 72 ืฉื ื™ื•ืช | age=72;;300 mode=MASTER

-h or - ืขื–ืจื”
ืžืฆื™ื’ ืžืกืš ืขื–ืจื” ืขื ืกื™ื›ื•ื ืฉืœ ื›ืœ ื”ืคืขื•ืœื•ืช ื•ื”ืืคืฉืจื•ื™ื•ืช.

--ืื™ืฉ
ืžืฆื™ื’ ืืช ื›ืœ ื”ืžื“ืจื™ืš.

-V or --ื’ึดืจึฐืกึธื”
ืžืฆื™ื’ ืืช ื”ื’ืจืกื” ื”ื ื•ื›ื—ื™ืช.

-v or --ืžึดืœื•ึผืœึดื™
ื”ื’ื“ืจ ืืช ืจืžืช ื”ื“ื™ื‘ื•ืจ. ื™ื›ื•ืœ ืœื”ืชืงืฉืจ ื™ื•ืชืจ ืžืคืขื ืื—ืช ื›ื“ื™ ืœื”ื’ื‘ื™ืจ ืืช ื”ืจืžื”. ืžื’ื“ื™ืจ ืืช ื–ื” ืœ
ืฉืœื•ืฉ ื•ืžืขืœื” (ื‘ืžื™ืœื™ื ืื—ืจื•ืช, ื”ื ืคืงืช "-v -v -v") ืžืคืขื™ืœื” ืžื™ื“ืข ื ื™ืคื•ื™ ื‘ืื’ื™ื
ืขื‘ื•ืจ ืชื•ื›ื ื™ืช ื–ื• ืฉื ืฉืœื—ืช ืืœ stderr.

--showperf=VAL
ืงื•ื‘ืข ืื ื ื•ืฆื™ื ื ืชื•ื ื™ ื‘ื™ืฆื•ืขื™ื ื ื•ืกืคื™ื ื‘ืคื•ืจืžื˜ Nagios ืกื˜ื ื“ืจื˜ื™ (ื‘ืกื•ืฃ
ืฉืœ ืžื—ืจื•ื–ืช, ืื—ืจื™ ืกืžืœ ืฆื™ื ื•ืจ, ื‘ืืžืฆืขื•ืช ืฉื=ืขืจืš). VAL ืฆืจื™ืš ืœื”ื™ื•ืช 0 ืื• 1. ื‘ืจื™ืจืช ื”ืžื—ื“ืœ
ื”ื•ื 1. ื ื›ื ืก ืœืชื•ืงืฃ ืจืง ืื ืžืฉืชืžืฉื™ื ื‘ืžืฆื‘ ืคืœื˜ ืฉืœ Nagios.

--perflimit=i
ืžื’ื“ื™ืจ ืžื’ื‘ืœื” ืœื’ื‘ื™ ืžืกืคืจ ืคืจื™ื˜ื™ ืขื ื™ื™ืŸ ื”ืžื“ื•ื•ื—ื™ื ื‘ืขืช ื”ืฉื™ืžื•ืฉ ื‘-
showperf ืื•ึนืคึผึฐืฆึดื™ึธื”. ื–ื” ืžืฉืคื™ืข ืจืง ืขืœ ืคืขื•ืœื•ืช ืฉืžื—ื–ื™ืจื•ืช ืžืกืคืจ ืจื‘ ืฉืœ
ืคืจื™ื˜ื™ื, ื›ื’ื•ืŸ table_size. ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื 0, ืื• ืœืœื ื”ื’ื‘ืœื”. ื”ื™ื–ื”ืจ ื‘ืขืช ื”ืฉื™ืžื•ืฉ ื‘ื–ื”
ืขื --ืœึดื›ืœื•ึนืœ or --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช, ื›ื›ืœ ืฉื”ื”ื’ื‘ืœื•ืช ื”ืœืœื• ื ืขืฉื•ืช ืœืื—ืจ ืžื” ื”ื™ื
ื”ืฉืื™ืœืชื” ื”ื•ืคืขืœื”, ื•ืœื›ืŸ ื™ื™ืชื›ืŸ ืฉื”ืžื’ื‘ืœื” ืฉืœืš ืœื ืชื›ืœื•ืœ ืืช ื”ืคืจื™ื˜ื™ื ื”ืจืฆื•ื™ื™ื. ืจืง ืœื•ืงื—
ื”ืฉืคืขื” ืื ืžืฉืชืžืฉื™ื ื‘ืžืฆื‘ ืคืœื˜ ืฉืœ Nagios.

--showtime=VAL
ืงื•ื‘ืข ืื ื”ื–ืžืŸ ืฉื ื“ืจืฉ ืœื”ืคืขืœืช ื›ืœ ืฉืื™ืœืชื” ืžื•ืฆื’ ื‘ืคืœื˜. VAL ืฆืจื™ืš ืœื”ื™ื•ืช 0
ืื• 1. ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื 1. ืื™ืŸ ื”ืฉืคืขื” ืืœื ืื ื›ืŸ showperf ืคื•ืขืœ. ื ื›ื ืก ืœืชื•ืงืฃ ืจืง ืื ืžืฉืชืžืฉื™ื
ืžืฆื‘ ืคืœื˜ ืฉืœ Nagios.

--ืžึดื‘ึฐื—ึธืŸ
ืžืืคืฉืจ ืžืฆื‘ ื‘ื“ื™ืงื”. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืžืฆื‘ ื‘ื“ื™ืงื”" ืœื”ืœืŸ.

--PGBINDIR=PATH
ืื•ืžืจ ืœืกืงืจื™ืคื˜ ื”ื™ื›ืŸ ืœืžืฆื•ื ืืช ื”ืงื‘ืฆื™ื ื”ื‘ื™ื ืืจื™ื™ื ืฉืœ psql. ืฉื™ืžื•ืฉื™ ืื ื™ืฉ ืœืš ื™ื•ืชืจ ืžืื—ื“
ื’ื™ืจืกื” ืฉืœ ืงื•ื‘ืฆื™ ื”ื”ืคืขืœื” ืฉืœ PostgreSQL ื‘ืžืขืจื›ืช ืฉืœืš, ืื• ืื ืœื ืงื™ื™ืžื™ื ื‘ืžืขืจื›ืช ืฉืœืš
ื ึธืชึดื™ื‘. ืฉื™ืžื• ืœื‘ ืฉื”ืืคืฉืจื•ืช ื”ื–ื• ืžื•ืคื™ืขื” ื‘ืื•ืชื™ื•ืช ืจื™ืฉื™ื•ืช. ื›ื‘ืจื™ืจืช ืžื—ื“ืœ, ืืคืฉืจื•ืช ื–ื• ื”ื™ื ืœึนื
ืžื•ืชืจ. ื›ื“ื™ ืœื”ืคืขื™ืœ ืืช ื–ื”, ืขืœื™ืš ืœืฉื ื•ืช ืืช $NO_PSQL_OPTION ืœื™ื“ ื”ื—ืœืง ื”ืขืœื™ื•ืŸ ืฉืœ ื”ืกืงืจื™ืคื˜
ืœ-0. ื”ื™ืžื ืข ืžืฉื™ืžื•ืฉ ื‘ืืคืฉืจื•ืช ื–ื• ืื ืืชื” ื™ื›ื•ืœ, ื•ื‘ืžืงื•ื ื–ืืช ื”ืฉืชืžืฉ ื‘ืžืฉืชื ื” ืกื‘ื™ื‘ื”
ื’ ืื• ืžืฉืชื ื” $PGBINDIR ื‘ืงื•ื“ ืงืฉื™ื—, ื’ื ืœื™ื“ ื”ื—ืœืง ื”ืขืœื™ื•ืŸ ืฉืœ ื”ืกืงืจื™ืคื˜, ืœื”ื’ื“ืจื”
ื”ื ืชื™ื‘ ืœ-PostgreSQL ืœืฉื™ืžื•ืฉ.

--PSQL=PATH
(ื”ื•ืฆื ืžืฉื™ืžื•ืฉ, ื–ึถื” ืื•ึนืคึผึฐืฆึดื™ึธื” ืื•ืœื™ be ื”ื•ืกืจ in a ืขืชื™ื“ ืœึฐืฉืึทื—ึฐืจึตืจ!) ืื•ืžืจ ืœืชืกืจื™ื˜ ื”ื™ื›ืŸ
ื›ื“ื™ ืœืžืฆื•ื ืืช ืชื•ื›ื ื™ืช psql. ืฉื™ืžื•ืฉื™ ืื ื™ืฉ ืœืš ื™ื•ืชืจ ืžื’ืจืกื” ืื—ืช ืฉืœ psql
ืงื•ื‘ืฅ ื”ืคืขืœื” ื‘ืžืขืจื›ืช ืฉืœืš, ืื• ืื ืื™ืŸ ืชื•ื›ื ื™ืช psql ื‘ื ืชื™ื‘ ืฉืœืš. ืฉื™ืžื• ืœื‘ ืฉื–ื”
ื”ืืคืฉืจื•ืช ื”ื™ื ื‘ืื•ืชื™ื•ืช ืจื™ืฉื™ื•ืช. ื›ื‘ืจื™ืจืช ืžื—ื“ืœ, ืืคืฉืจื•ืช ื–ื• ื”ื™ื ืœึนื ืžื•ืชืจ. ื›ื“ื™ ืœืืคืฉืจ ื–ืืช, ืืชื”
ื—ื™ื™ื‘ ืœืฉื ื•ืช ืืช $NO_PSQL_OPTION ืœื™ื“ ื”ื—ืœืง ื”ืขืœื™ื•ืŸ ืฉืœ ื”ืกืงืจื™ืคื˜ ืœ-0. ื”ื™ืžื ืข ืžืฉื™ืžื•ืฉ ื–ื”
ืืคืฉืจื•ืช ืื ืืชื” ื™ื›ื•ืœ, ื•ื‘ืžืงื•ื ื–ื” ืงื•ื“ื“ ืงืฉื™ื— ืืช ืžื™ืงื•ื ื”-psql ืฉืœืš ืœืžืฉืชื ื” $PSQL,
ื’ื ืœื™ื“ ื”ื—ืœืง ื”ืขืœื™ื•ืŸ ืฉืœ ื”ืชืกืจื™ื˜.

--ืงื™ืฉื•ืจื™ื ืกื™ืžื ื™ื
ื™ื•ืฆืจ ืกื™ืžืœื™ื ืงื™ื ืœืชื•ื›ื ื™ืช ื”ืจืืฉื™ืช ืขื‘ื•ืจ ื›ืœ ืคืขื•ืœื”.

--output=VAL
ืงื•ื‘ืข ืืช ื”ืคื•ืจืžื˜ ืฉืœ ื”ืคืœื˜, ืœืฉื™ืžื•ืฉ ื‘ืชื•ื›ื ื™ื•ืช ืฉื•ื ื•ืช. ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื
'ื ื’ื™ื•ืก'. ื”ืืคืฉืจื•ื™ื•ืช ื”ื–ืžื™ื ื•ืช ื”ืŸ 'nagios', 'mrtg', 'simple' ื•-'cacti'.

--mrtg=VAL
ืžืฉืžืฉ ืจืง ืขื‘ื•ืจ MRTG ืื• ืคืœื˜ ืคืฉื•ื˜, ืขื‘ื•ืจ ื›ืžื” ืคืขื•ืœื•ืช ืกืคืฆื™ืคื™ื•ืช.

--debugoutput=VAL
ืžื•ืฆื™ื ืืช ื”ืžื—ืจื•ื–ืช ื”ืžื“ื•ื™ืงืช ืฉื”ื•ื—ื–ืจื” ืขืœ ื™ื“ื™ psql, ืœืฉื™ืžื•ืฉ ื‘ืื™ืชื•ืจ ื‘ืื’ื™ื. ื”ืขืจืš ื”ื•ื ืื—ื“ ืื•
ื™ื•ืชืจ ืื•ืชื™ื•ืช, ืฉืงื•ื‘ืขื•ืช ืื ื”ืคืœื˜ ืžื•ืฆื’ ืื• ืœื, ื›ืืฉืจ 'a' = all, 'c'
= ืงืจื™ื˜ื™, 'w' = ืื–ื”ืจื”, 'o' = ื‘ืกื“ืจ, ื•-'u' = ืœื ื™ื“ื•ืข. ื ื™ืชืŸ ืœืฉืœื‘ ืื•ืชื™ื•ืช.

--get_method=VAL
ืžืืคืฉืจ ืคื™ืจื•ื˜ ืฉืœ ื”ืฉื™ื˜ื” ื”ืžืฉืžืฉืช ืœืื—ื–ื•ืจ ืžื™ื“ืข ืขื‘ื•ืจ "new_version_cp",
ื‘ื“ื™ืงื•ืช "new_version_pg", "new_version_bc", "new_version_box" ื•-"new_version_tnm".
ื”ืชื•ื›ื ื•ืช ื”ื‘ืื•ืช ื ื™ืกื•, ืขืœ ืžื ืช, ืœืชืคื•ืก ืืช ื”ืžื™ื“ืข ืžื”ืื™ื ื˜ืจื ื˜: GET,
wget, fetch, curl, lynx, links. ื›ื“ื™ ืœื›ืคื•ืช ืฉื™ืžื•ืฉ ื‘ืื—ื“ ื‘ืœื‘ื“ (ื•ื‘ื›ืš ืœื”ืกื™ืจ ืืช
ืขืœ ืžื ืช ืœื ืกื•ืช ืืช ื›ืœ ื”ืื—ืจื™ื ืขื“ ืฉืื—ืช ืžืื•ืชืŸ ืขื•ื‘ื“ื•ืช), ื”ื–ื™ื ื• ืืช ืื—ื“ ื”ืฉืžื•ืช ื›
ื”ื˜ื™ืขื•ืŸ ืœืงื‘ืœ_ืฉื™ื˜ื”. ืœื“ื•ื’ืžื”, ืชื™ื‘ืช BSD ืขืฉื•ื™ื” ืœื”ื–ื™ืŸ ืืช ื”ืฉื•ืจื” ื”ื‘ืื”
ื”ืงื•ื‘ืฅ ".check_postgresrc" ืฉืœื”ื:

get_method=fetch

--language=VAL
ื”ื’ื“ืจ ืืช ื”ืฉืคื” ืœืฉื™ืžื•ืฉ ืขื‘ื•ืจ ื›ืœ ื”ื•ื“ืขื•ืช ื”ืคืœื˜. ื‘ื“ืจืš ื›ืœืœ, ื–ื” ืžื–ื•ื”ื” ืขืœ ื™ื“ื™
ื‘ื•ื—ื ื™ื ืืช ืžืฉืชื ื™ ื”ืกื‘ื™ื‘ื” LC_ALL, LC_MESSAGES ื•-LANG, ืืš ืžื’ื“ื™ืจื™ื ื–ืืช
ื”ืืคืฉืจื•ืช ืชืขืงื•ืฃ ื›ืœ ื–ื™ื”ื•ื™ ื›ื–ื”.

ืคืขื•ืœื•ืช


ื”ืกืงืจื™ืคื˜ ืžืคืขื™ืœ ืคืขื•ืœื” ืื—ืช ืื• ื™ื•ืชืจ. ื–ื” ื™ื›ื•ืœ ืœื”ื™ืขืฉื•ืช ืขื ื“ื’ืœ --action, ืื• ืขืœ ื™ื“ื™
ื‘ืืžืฆืขื•ืช ืงื™ืฉื•ืจ ืกื™ืžืŸ ืœืงื•ื‘ืฅ ื”ืจืืฉื™ ื”ืžื›ื™ืœ ื‘ืชื•ื›ื• ืืช ืฉื ื”ืคืขื•ืœื”. ืœ
ืœื“ื•ื’ืžื”, ื›ื“ื™ ืœื”ืคืขื™ืœ ืืช ื”ืคืขื•ืœื” "timesync", ืืชื” ื™ื›ื•ืœ ืœื”ืคื™ืง:

check_postgres --action=timesync

ืื• ื”ืฉืชืžืฉ ื‘ืชื•ื›ื ื” ื‘ืฉื:

check_postgres_timesync

ื›ืœ ื”ืงื™ืฉื•ืจื™ื ื”ืกืžืœื™ื™ื ื ื•ืฆืจื™ื ืขื‘ื•ืจืš ื‘ืกืคืจื™ื™ื” ื”ื ื•ื›ื—ื™ืช ืื ืชืฉืชืžืฉ ื‘ืืคืฉืจื•ืช --symlinks

perl check_postgres --symlinks

ืื ืฉื ื”ืงื•ื‘ืฅ ื›ื‘ืจ ืงื™ื™ื, ื”ื•ื ืœื ื™ื•ื—ืœืฃ. ืื ื”ืงื•ื‘ืฅ ืงื™ื™ื ื•ื”ื•ื ื
symlink, ืืชื” ื™ื›ื•ืœ ืœืืœืฅ ืื•ืชื• ืœื“ืจื•ืก ื‘ืืžืฆืขื•ืช "--action=build_symlinks_force"

ืจื•ื‘ ื”ืคืขื•ืœื•ืช ืœื•ืงื—ื•ืช ื --ืึทื–ื”ึธืจึธื” ื•ื›ืŸ --ืงืจื™ื˜ื™ ืืคืฉืจื•ืช, ื”ืžืฆื™ื™ื ืช ื‘ืื™ื–ื• ื ืงื•ื“ื” ืื ื• ืžืฉื ื™ื
ืž-OK ืœ-WARNING, ื•ื‘ืื™ื–ื• ื ืงื•ื“ื” ืื ื—ื ื• ื”ื•ืœื›ื™ื ืœ-CRITICAL. ืฉื™ื ืœื‘ ื›ื™ ื”ื ืงืจื™ื˜ื™ื™ื
ืชืžื™ื“ ืžืกื•ืžืŸ ืงื•ื“ื, ื”ื’ื“ืจืช ื”ืื–ื”ืจื” ืฉื•ื•ื” ืœืงืจื™ื˜ื™ืช ื”ื™ื ื“ืจืš ื™ืขื™ืœื”
ื›ื‘ื” ืื–ื”ืจื•ืช ื•ืชืžื™ื“ ืชืŸ ืงืจื™ื˜ื™.

ื”ืคืขื•ืœื•ืช ื”ื ืชืžื›ื•ืช ื”ื ื•ื›ื—ื™ื•ืช ื”ืŸ:

ืืจื›ื™ื•ืŸ_ืžื•ื›ืŸ
("Symlink: check_postgres_archive_ready") ื‘ื•ื“ืง ื›ืžื” ืงื‘ืฆื™ WAL ืขื ืกื™ื•ืžืช .ืžื•ึผื›ึธืŸ
ืงื™ื™ืžื™ื ื‘ pg_xlog/archive_status ืกืคืจื™ื™ื”, ืฉื ืžืฆืืช ืžื—ื•ืฅ ืฉืœืš data_directory.
ืคืขื•ืœื” ื–ื• ื—ื™ื™ื‘ืช ืœื”ื™ื•ืช ืžื•ืคืขืœืช ื›ืžืฉืชืžืฉ-ืขืœ, ืขืœ ืžื ืช ืœื’ืฉืช ืœืชื•ื›ืŸ ืฉืœ
pg_xlog/archive_status ืžึทื“ืจึดื™ืš. ื”ื’ืจืกื” ื”ืžื™ื ื™ืžืœื™ืช ืœืฉื™ืžื•ืฉ ื‘ืคืขื•ืœื” ื–ื• ื”ื™ื Postgres 8.1.
ื”ืฉืžื™ื™ื --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื”ืืคืฉืจื•ื™ื•ืช ื”ืŸ ืคืฉื•ื˜ ื”ืžืกืคืจ ืฉืœ .ืžื•ึผื›ึธืŸ ืงื‘ืฆื™ื ื‘-
pg_xlog/archive_status ืžึทื“ืจึดื™ืš. ื‘ื“ืจืš ื›ืœืœ, ืขืจื›ื™ื ืืœื” ืฆืจื™ื›ื™ื ืœื”ื™ื•ืช ื ืžื•ื›ื™ื, ื•ืœื”ืคืขื™ืœ ืืช
ืžื ื’ื ื•ืŸ ืืจื›ื™ื•ืŸ, ืื ื—ื ื• ื‘ื“ืจืš ื›ืœืœ ืจื•ืฆื™ื ืฉื”ื•ื ื™ืื—ืกืŸ ืงื‘ืฆื™ WAL ื‘ืžื”ื™ืจื•ืช ื”ืืคืฉืจื™ืช.

ืื ืคืงื•ื“ืช ื”ืืจื›ื™ื•ืŸ ื ื›ืฉืœืช, ืžืกืคืจ ื”-WAL ืฉืœืš pg_xlog ืกืคืจื™ื™ื” ืชื’ื“ืœ ืขื“
ืœืžืฆื•ืช ืืช ื›ืœ ืฉื˜ื— ื”ื“ื™ืกืง ื•ืœืืœืฅ ืืช PostgreSQL ืœื”ืคืกื™ืง ืžื™ื“.

ื“ื•ื’ืžื” 1: ื‘ื“ื•ืง ืฉืžืกืคืจ ืงื‘ืฆื™ WAL ื”ืžื•ื›ื ื™ื ื”ื•ื 10 ืื• ืคื—ื•ืช ื‘ืžืืจื— "pluto"

check_postgres_archive_ready --host=pluto --critical=10

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื“ื•ื•ื— ืขืœ ืžืกืคืจ ืงื‘ืฆื™ WAL ืžื•ื›ื ื™ื ื‘ืฉื•ืจื” 1.

autovac_freeze
("symlink: check_postgres_autovac_freeze") ื‘ื•ื“ืง ืขื“ ื›ืžื” ื›ืœ ืžืกื“ ื ืชื•ื ื™ื ืงืจื•ื‘ ืœ-
ืคื•ืกื˜ื’ืจืก autovacuum_freeze_max_age ื”ื’ื“ืจื”. ืคืขื•ืœื” ื–ื• ืชืขื‘ื•ื“ ืจืง ืขื‘ื•ืจ ืžืกื“ื™ ื ืชื•ื ื™ื
ื’ืจืกื” 8.2 ื•ืžืขืœื”. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ืฆืจื™ื›ื•ืช ืœื”ืชื‘ื˜ื ื›
ืื—ื•ื–ื™ื. ื”'ื’ื™ืœ' ืฉืœ ื”ืขืกืงืื•ืช ื‘ื›ืœ ืžืกื“ ื ืชื•ื ื™ื ืžื•ืฉื•ื•ื” ืœ-
ื”ื’ื“ืจืช autovacuum_freeze_max_age (200 ืžื™ืœื™ื•ืŸ ื›ื‘ืจื™ืจืช ืžื—ื“ืœ) ื›ื“ื™ ืœื™ืฆื•ืจ ืžืขื•ื’ืœ
ืึฒื—ื•ึผื–ึดื™ื. ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื 90% ืขื‘ื•ืจ ื”ืื–ื”ืจื” ื• 95% ืขื‘ื•ืจ ื”ืงืจื™ื˜ื™ื™ื. ืžืื’ืจื™ ืžื™ื“ืข
ื ื™ืชืŸ ืœืกื ืŸ ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘- --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืจืื” "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™"
ืกืขื™ืฃ ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ื›ืืฉืจ ืžืกื“ื™ ื ืชื•ื ื™ื ื›ืœืฉื”ื ื‘ื™ืฆื™ืื” 5432 ื”ื ืžืขืœ 97%

check_postgres_autovac_freeze --port=5432 --warning="97%"

ืขื‘ื•ืจ ืชืคื•ืงืช MRTG, ื”ืื—ื•ื– ื”ื›ื•ืœืœ ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ืžื“ื•ื•ื— ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื•ื”-
ื”ื’ื™ืœ ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ืžื“ื•ื•ื— ื‘ืฉื•ืจื” ื”ืฉื ื™ื™ื”. ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืฉื™ืฉ ืœื”ื ืืช ื”ืื—ื•ื– ืž
ื”ืฉื•ืจื” ื”ืจืืฉื•ื ื” ืžื“ื•ื•ื—ืช ื‘ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช, ืžื•ืคืจื“ืช ืขืœ ื™ื“ื™ ืกืžืœ ืฆื™ื ื•ืจ.

backends
("Symlink: check_postgres_backends") ื‘ื•ื“ืง ืืช ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ื”ื ื•ื›ื—ื™ ืขื‘ื•ืจ ืื—ื“ ืื•
ื™ื•ืชืจ ืžืกื“ื™ ื ืชื•ื ื™ื, ื•ืื•ืคืฆื™ื•ื ืœื™ ืžืฉื•ื•ื” ืื•ืชื• ืœืžืงืกื™ืžื•ื ื”ืžื•ืชืจ, ืฉื ืงื‘ืข ืขืœ ื™ื“ื™
ืžืฉืชื ื” ื”ืชืฆื•ืจื” Postgres max_connections. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช
ื™ื›ื•ืœ ืœืœื‘ื•ืฉ ืื—ืช ืžืฉืœื•ืฉ ืฆื•ืจื•ืช. ืจืืฉื™ืช, ื ื™ืชืŸ ืœืชืช ืžืกืคืจ ืคืฉื•ื˜, ื”ืžื™ื™ืฆื’ ืืช
ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ืฉื‘ื”ื ืชื™ื ืชืŸ ื”ื”ืชืจืื”. ื‘ื—ื™ืจื” ื–ื• ืื™ื ื” ืžืฉืชืžืฉืช ื‘-
max_connections ื”ื’ื“ืจื”. ืฉื ื™ืช, ื ื™ืชืŸ ืœืชืช ืืช ืื—ื•ื– ื”ื—ื™ื‘ื•ืจื™ื ื”ื–ืžื™ื ื™ื.
ืฉืœื™ืฉื™ืช, ื ื™ืชืŸ ืœืชืช ืžืกืคืจ ืฉืœื™ืœื™ ื”ืžื™ื™ืฆื’ ืืช ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ืฉื ื•ืชืจื•
ืขื“ max_connections ืžื’ื™ืข. ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ืขื‘ื•ืจ --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื™ืฉ ืœื•
'90%' ื•'95%'. ืืชื” ื™ื›ื•ืœ ื’ื ืœืกื ืŸ ืืช ืžืกื“ื™ ื”ื ืชื•ื ื™ื ื‘ืืžืฆืขื•ืช ื” --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ
ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื›ื“ื™ ืœื”ืฆื™ื’ ืจืง ืชื”ืœื™ื›ื™ื ืฉืื™ื ื ืคืขื™ืœื™ื, ืืชื” ื™ื›ื•ืœ ืœื”ืฉืชืžืฉ ื‘- --ื ื•ื“ืœ ื˜ึทืขึฒื ึธื”. ืฉื™ื ืœื‘ ืฉื”ืžืฉืชืžืฉ ืืชื”
ืžืชื—ื‘ืจื™ื ื›ื™ ื”ื ื—ื™ื™ื‘ื™ื ืœื”ื™ื•ืช ืžืฉืชืžืฉ-ืขืœ ื›ื“ื™ ืฉื–ื” ื™ืขื‘ื•ื“ ื›ืžื• ืฉืฆืจื™ืš.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ื›ืืฉืจ ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ื‘-quirm ื”ืžืืจื— ืžื’ื™ืข ืœ-120, ื•-
ืงืจื™ื˜ื™ ืื ื”ื•ื ืžื’ื™ืข ืœ-150.

check_postgres_backends --host=quirm --warning=120 --critical=150

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ื›ืืฉืจ ื ื’ื™ืข ืœ-75% ืžื”ื’ื“ืจืช max_connections ืฉืœื ื• ื‘ืžืืจื—ื™ื
lancre ืื• lancre2.

check_postgres_backends --warning='75%' --critical='75%' --host=lancre,lancre2

ื“ื•ื’ืžื” 3: ืชืŸ ืื–ื”ืจื” ื›ืืฉืจ ื ื•ืชืจื• ืจืง 10 ื—ืจื™ืฆื™ ื—ื™ื‘ื•ืจ ื ื•ืกืคื™ื ื‘ืžืืจื—
ืคืœืกืžื™ื“, ื•ืงืจื™ื˜ื™ ื›ืฉื ื•ืชืจื• ืœื ื• ืจืง 5.

check_postgres_backends --warning=-10 --critical=-5 --host=plasmid

ื“ื•ื’ืžื” 4: ื‘ื“ื•ืง ืืช ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืžืœื‘ื“ ืืœื” ืขื "ืžื‘ื—ืŸ" ื‘ืฉืžื, ืื‘ืœ ืืคืฉืจ ื›ืืœื”
ื ืงืจืื™ื "pg_greatest". ื”ืชื—ื‘ืจ ื›ื™ืฆื™ืื” 5432 ื‘ืฉื ื™ ื”ืžืืจื—ื™ื ื”ืจืืฉื•ื ื™ื, ื•ื›ื™ืฆื™ืื” 5433 ืคื•ืขืœืช
ื”ืฉืœื™ืฉื™. ืื ื—ื ื• ืจื•ืฆื™ื ืชืžื™ื“ ืœื–ืจื•ืง ืงืจื™ื˜ื™ ื›ืฉืื ื—ื ื• ืžื’ื™ืขื™ื ืœ-30 ื—ื™ื‘ื•ืจื™ื ืื• ื™ื•ืชืจ.

check_postgres_backends --dbhost=hong,kong --dbhost=fooey --dbport=5432 --dbport=5433 --warning=30 --critical=30 --exclude="~test" --include="pg_greatest,~prod "

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ืžื“ื•ื•ื— ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื” ื•ื”ืจื‘ื™ืขื™ืช
line ื ื•ืชืŸ ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื, ื‘ืชื•ืกืคืช ื”-max_connections ื”ื ื•ื›ื—ื™ื™ื. ืื ื™ื•ืชืจ ืž
ืžืกื“ ื ืชื•ื ื™ื ืื—ื“ ื ื‘ื“ืง, ื–ื” ืขื ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ื”ื•ื ืคืœื˜.

ืœึฐื”ึทืชึฐืคึผึดื™ื—ึท
("Symlink: check_postgres_bloat") ื‘ื•ื“ืง ืืช ื›ืžื•ืช ื”ื ืคื™ื—ื•ืช ื‘ื˜ื‘ืœืื•ืช ื•ื‘ืื™ื ื“ืงืกื™ื. (ืœึฐื”ึทืชึฐืคึผึดื™ื—ึท
ื”ื•ื ื‘ื“ืจืš ื›ืœืœ ื›ืžื•ืช ื”ืฉื˜ื— ื”ืžืช ืฉืื™ื ื• ืžื ื•ืฆืœ ืฉื ืœืงื— ื‘ื˜ื‘ืœื” ืื• ื‘ืื™ื ื“ืงืก. ื”ื—ืœืœ ื”ื–ื” ื”ื•ื
ื‘ื“ืจืš ื›ืœืœ ืชื•ื—ื–ืจ ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘ืคืงื•ื“ืช VACUUM.) ืคืขื•ืœื” ื–ื• ื“ื•ืจืฉืช ื ืชื•ื ื™ื ืกื˜ื˜ื™ืกื˜ื™ื™ื
ืื•ืกืฃ ื™ื”ื™ื” ื–ืžื™ืŸ ื‘ืžืกื“ื™ ื”ื ืชื•ื ื™ื ื”ื™ืขื“, ื•ื“ื•ืจืฉ ื”ืคืขืœืช ANALYZE
ื‘ืชื“ื™ืจื•ืช ื’ื‘ื•ื”ื”. ื” --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ื ื™ืชืŸ ืœื”ืฉืชืžืฉ ื‘ืืคืฉืจื•ื™ื•ืช ื›ื“ื™ ืœืกื ืŸ ืœืื™ืœื• ื˜ื‘ืœืื•ืช
ืœื”ืกืชื›ืœ ืขืœ. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื”ืฉืžื™ื™ื --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื ื™ืชืŸ ืœืฆื™ื™ืŸ ืืคืฉืจื•ื™ื•ืช ื›ื’ื“ืœื™ื, ืื—ื•ื–ื™ื ืื• ืฉื ื™ื”ื. ืชึธืงึตืฃ
ื™ื—ื™ื“ื•ืช ื”ื’ื•ื“ืœ ื”ืŸ ื‘ืชื™ื, ืงื™ืœื•ื‘ื™ื™ื˜, ืžื’ื”-ื‘ื™ื™ื˜, ื’ื™ื’ื”-ื‘ื™ื™ื˜, ื˜ืจื”-ื‘ื™ื™ื˜, ืืงืก-ื‘ื™ื™ื˜, ืคื˜ื”-ื‘ื™ื™ื˜ ื•
ื–ื˜ื”-ื‘ื™ื™ื˜. ืืชื” ื™ื›ื•ืœ ืœืงืฆืจ ืืช ื›ืœ ืืœื” ื‘ืื•ืช ื”ืจืืฉื•ื ื”. ืคืจื™ื˜ื™ื ืœืœื ื™ื—ื™ื“ื•ืช ื”ื
ื”ื”ื ื—ื” ื”ื™ื 'ื‘ืชื™ื'. ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื '1 GB' ื•-'5 GB'. ื”ืขืจืš ืžื™ื™ืฆื’ ืืช
ืžืกืคืจ ื”"ื‘ื™ื™ื˜ื™ื ืžื‘ื•ื–ื‘ื–ื™ื", ืื• ื”ื”ื‘ื“ืœ ื‘ื™ืŸ ืžื” ืฉื‘ืคื•ืขืœ ืžืฉืžืฉ ืืช ื”ื˜ื‘ืœื” ื•
ืื™ื ื“ืงืก, ื•ืžื” ืื ื—ื ื• ืžื—ืฉื‘ื™ื ืฉื”ื•ื ืฆืจื™ืš ืœื”ื™ื•ืช.

ืฉื™ื ืœื‘ ืฉืœืคืขื•ืœื” ื–ื• ื™ืฉ ืฉื ื™ ืขืจื›ื™ื ืžืงื•ื“ื“ื™ื ื›ื“ื™ ืœืžื ื•ืข ืื–ืขืงื•ืช ืฉื•ื•ื ื‘ืงื˜ื ื”
ื™ื—ืกื™ื. ื˜ื‘ืœืื•ืช ื—ื™ื™ื‘ื•ืช ืœื›ืœื•ืœ ืœืคื—ื•ืช 10 ืขืžื•ื“ื™ื, ื•ืื™ื ื“ืงืกื™ื ืœืคื—ื•ืช 15, ืœืคื ื™ ืฉื™ื•ื›ืœื• ืœื”ื™ื•ืช
ื ื—ืฉื‘ ื‘ื‘ื“ื™ืงื” ื–ื•. ืื ืืชื” ื‘ืืžืช ืจื•ืฆื” ืœื”ืชืื™ื ืืช ื”ืขืจื›ื™ื ื”ืืœื”, ืืชื” ื™ื›ื•ืœ ืœื—ืคืฉ ืืช
ืžืฉืชื ื™ื $MINPAGES ื• $MINIPAGES ื‘ื—ืœืง ื”ืขืœื™ื•ืŸ ืฉืœ ืชืช-ื”ืฉื’ืจื” "check_bloat". ืืœื”
ื”ืขืจื›ื™ื ืžืชืขืœืžื™ื ืื ืื—ื“ ืžื”ื --ืœื ืœื›ืœื•ืœ or --ืœึดื›ืœื•ึนืœ ืžืฉืžืฉ.

ืจืง 10 ื”ื™ื—ืกื™ื ื”ื ืคื•ื—ื™ื ื‘ื™ื•ืชืจ ืžื•ืฆื’ื™ื. ืืชื” ื™ื›ื•ืœ ืœืฉื ื•ืช ืืช ื”ืžืกืคืจ ื”ื–ื” ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘-
--perflimit ืืคืฉืจื•ืช ืœื”ื’ื“ื™ืจ ืืช ื”ื’ื‘ื•ืœ ืฉืœืš.

ื”ืกื›ื™ืžื” ื‘ืฉื 'information_schema' ืื™ื ื” ื ื›ืœืœืช ื‘ื‘ื“ื™ืงื” ื–ื•, ื›ื˜ื‘ืœืื•ืช ื”ื™ื—ื™ื“ื•ืช ืฉืœื”
ืžื›ื™ืœ ื”ื ืงื˜ื ื™ื ื•ืื™ื ื ืžืฉืชื ื™ื.

ืฉื™ื ืœื‘ ืฉื”ืขืจื›ื™ื ืฉื—ื•ืฉื‘ื• ืขืœ ื™ื“ื™ ืคืขื•ืœื” ื–ื• ืื™ื ื ืžื“ื•ื™ืงื™ื, ื•ื™ืฉ ืœื”ืฉืชืžืฉ ื‘ื”ื ื›
ืงื• ืžื ื—ื” ื‘ืœื‘ื“. ื ืขืฉื” ืžืืžืฅ ื’ื“ื•ืœ ืœื”ืขืจื™ืš ืืช ื”ื’ื•ื“ืœ ื”ื ื›ื•ืŸ ืฉืœ ืฉื•ืœื—ืŸ, ืื‘ืœ ื‘
ื‘ืกื•ืฃ ื–ื” ืจืง ื”ืขืจื›ื”. ื’ื•ื“ืœ ื”ืื™ื ื“ืงืก ื”ื ื›ื•ืŸ ื”ื•ื ืืคื™ืœื• ื™ื•ืชืจ ื ื™ื—ื•ืฉ ืžืืฉืจ
ื’ื•ื“ืœ ื˜ื‘ืœื” ื ื›ื•ืŸ, ืื‘ืœ ืฉื ื™ื”ื ืืžื•ืจื™ื ืœืชืช ืžื•ืฉื’ ื’ืก ืขืœ ื›ืžื” ื“ื‘ืจื™ื ื ืคื•ื—ื™ื.

ื“ื•ื’ืžื” 1: ืื–ื”ืจื” ืื ื˜ื‘ืœื” ื›ืœืฉื”ื™ ื‘ื™ืฆื™ืื” 5432 ื”ื™ื ืžืขืœ 100 ืžื’ื”-ื‘ื™ื™ื˜ ืžื ื•ืคื—ืช, ื•ืงืจื™ื˜ื™ืช ืื ืžืขืœ 200
MB

check_postgres_bloat --port=5432 --warning='100 M' --critical='200 M'

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ืื 'ื”ื–ืžื ื•ืช' ื‘ื˜ื‘ืœื” ื‘-'sami' ื”ืžืืจื— ื™ืฉ ื™ื•ืชืจ ืž-10 ืžื’ื” ืฉืœ ื ืคื™ื—ื•ืช

check_postgres_bloat --host=sami --include=orders --critical='10 MB'

ื“ื•ื’ืžื” 3: ืชืŸ ืงืจื™ื˜ื™ ืื ื”ื˜ื‘ืœื” 'q4' ืขืœ 'ืžื›ื™ืจื•ืช' ืฉืœ ืžืกื“ ื”ื ืชื•ื ื™ื ื”ื™ื ืžืขืœ 50% ื ืคื•ื—ื”

check_postgres_bloat --db=sales --include=q4 --critical='50%'

ื“ื•ื’ืžื” 4: ืชืŸ ืงืจื™ื˜ื™ ื›ืœ ื˜ื‘ืœื” ื”ื™ื ืžืขืœ 20% ื ืคื•ื— ื• ื™ืฉ ื™ื•ืชืจ ืž-150 MB ืฉืœ ื ืคื™ื—ื•ืช:

check_postgres_bloat --port=5432 --critical='20% ื•-150 M'

ื“ื•ื’ืžื” 5: ืชืŸ ืงืจื™ื˜ื™ ื›ืœ ื˜ื‘ืœื” ื”ื™ื ืžืขืœ 40% ื ืคื•ื— or ื™ืฉ ื™ื•ืชืจ ืž-500 MB ืฉืœ ื ืคื™ื—ื•ืช:

check_postgres_bloat --port=5432 --warning='500 M or 40%'

ืขื‘ื•ืจ ืคืœื˜ MRTG, ื”ืฉื•ืจื” ื”ืจืืฉื•ื ื” ื ื•ืชื ืช ืืช ื”ืžืกืคืจ ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ืฉืœ ื‘ืชื™ื ืžื‘ื•ื–ื‘ื–ื™ื ืขื‘ื•ืจ ื”ื˜ื‘ืœืื•ืช,
ื•ื”ืฉื•ืจื” ื”ืฉื ื™ื™ื” ื ื•ืชื ืช ืืช ื”ืžืกืคืจ ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ืฉืœ ื‘ืชื™ื ืžื‘ื•ื–ื‘ื–ื™ื ืขื‘ื•ืจ ื”ืื™ื ื“ืงืกื™ื. ื”ืจื‘ื™ืขื™
ืฉื•ืจื” ืžืกืคืงืช ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื, ืฉื ื”ื˜ื‘ืœื” ื•ืฉื ื”ืื™ื ื“ืงืก. ืื ืืชื” ืจื•ืฆื”
ืคืœื˜ ืืช ื™ื—ืก ื”ื ืคื™ื—ื•ืช ื‘ืžืงื•ื (ืคื™ ื›ืžื” ื’ื“ื•ืœ ื”ื™ื—ืก ืœืขื•ืžืช ืื™ืš
ื’ื“ื•ืœ ื–ื” ืฆืจื™ืš ืœื”ื™ื•ืช), ืคืฉื•ื˜ ื”ืขื‘ื™ืจื• ื‘-"--mrtg=ratio".

ืžื—ืกื•ื
("Symlink: check_postgres_checkpoint") ืงื•ื‘ืข ื›ืžื” ื–ืžืŸ ืขื‘ืจ ืžืื– ื”ืžื—ืกื•ื ื”ืื—ืจื•ืŸ
ื”ื•ืคืขืœ. ื–ื” ื—ื™ื™ื‘ ืœืคืขื•ืœ ื‘ืื•ืชื• ืฉืจืช ื›ืžื• ืžืกื“ ื”ื ืชื•ื ื™ื ืฉื ื‘ื“ืง (ืœืžืฉืœ
ื“ื’ืœ -h ืœื ื™ืขื‘ื•ื“). ื‘ื“ื™ืงื” ื–ื• ื ื•ืขื“ื” ืœืคืขื•ืœ ืขืœ ืฉืจืช "ื”ืžืชื ื” ื—ืžื”", ื›ืœื•ืžืจ
ืžืขื‘ื“ ื‘ืื•ืคืŸ ืคืขื™ืœ ืงื‘ืฆื™ WAL ืฉื ืฉืœื—ื•, ื•ื”ื•ื ื ื•ืขื“ ืœื‘ื“ื•ืง ืฉื”ื”ืžืชื ื” ื”ื—ืžื” ืฉืœืš ื”ื™ื
ื‘ืืžืช 'ื—ื'. ื™ืฉ ืœื”ื’ื“ื™ืจ ืืช ืกืคืจื™ื™ืช ื”ื ืชื•ื ื™ื, ืื• ืขืœ ื™ื“ื™ ืžืฉืชื ื” ื”ืกื‘ื™ื‘ื”
"PGDATA", ืื• ื”ืขื‘ืจืช ื”ืืจื’ื•ืžื ื˜ "--datadir". ื–ื” ืžื—ื–ื™ืจ ืืช ืžืกืคืจ ื”ืฉื ื™ื•ืช ืžืื–
ื”ืžื—ืกื•ื ื”ืื—ืจื•ืŸ ื”ื•ืคืขืœ, ื›ืคื™ ืฉื ืงื‘ืข ืขืœ ื™ื“ื™ ื ื™ืชื•ื— ื”ืงืจื™ืื” ืœ-"pg_controldata". ื‘ื’ืœืœ
ื–ื”, ืงื•ื‘ืฅ ื”ื”ืคืขืœื” pg_controldata ื—ื™ื™ื‘ ืœื”ื™ื•ืช ื–ืžื™ืŸ ื‘ื ืชื™ื‘ ื”ื ื•ื›ื—ื™. ืœื—ืœื•ืคื™ืŸ,
ืืชื” ื™ื›ื•ืœ ืœืฆื™ื™ืŸ "PGBINDIR" ื‘ืชื•ืจ ื”ืกืคืจื™ื™ื” ืฉื‘ื” ื”ื•ื ื—ื™. ื–ื” ื’ื ืืคืฉืจื™ ืœื”ืฉืชืžืฉ
ื”ืืคืฉืจื•ื™ื•ืช ื”ืžื™ื•ื—ื“ื•ืช --ื”ื ื—ื”-ืคืจื•ื“ or --ื”ื ื—ื”-ืžืฆื‘ ื”ืžืชื ื”, ืื ื”ืžืฆื‘ ืฉื ืžืฆื ืื™ื ื• ื”
ืื—ื“ ืฆืคื•ื™, ืงืจื™ื˜ื™ ื ืคืœื˜.

ื™ืฉ ืœื”ื’ื“ื™ืจ ืœืคื—ื•ืช ืื–ื”ืจื” ืื• ืืจื’ื•ืžื ื˜ ืงืจื™ื˜ื™ ืื—ื“.

ืคืขื•ืœื” ื–ื• ื“ื•ืจืฉืช ืืช ืžื•ื“ื•ืœ Date::Parse.

ืขื‘ื•ืจ MRTG ืื• ืคืœื˜ ืคืฉื•ื˜, ืžื—ื–ื™ืจ ืืช ืžืกืคืจ ื”ืฉื ื™ื•ืช.

cluster_id
("symlink: check_postgres_cluster-id") ื‘ื•ื“ืง ืฉืžื–ื”ื” ืžืขืจื›ืช ืžืกื“ ื”ื ืชื•ื ื™ื ืกื™ืคืง
ืžืืช pg_controldata ื–ื”ื” ืœืคืขื ื”ืื—ืจื•ื ื” ืฉื‘ื“ืงืช. ื–ื” ื—ื™ื™ื‘ ืœืคืขื•ืœ ื‘ืื•ืชื• ืฉืจืช
ื‘ืชื•ืจ ืžืกื“ ื”ื ืชื•ื ื™ื ืฉื ื‘ื“ืง (ืœื“ื•ื’ืžื”, ื”ื“ื’ืœ -h ืœื ื™ืขื‘ื•ื“). ืื• ืืช
--ืึทื–ื”ึธืจึธื” ืื• --ืงืจื™ื˜ื™ ื™ืฉ ืœืชืช ืืคืฉืจื•ืช, ืื‘ืœ ืœื ืืช ืฉื ื™ื”ื. ื”ืขืจืš ืฉืœ ื›ืœ ืื—ื“ ื”ื•ื
ืžื–ื”ื” ื”ืืฉื›ื•ืœ, ืขืจืš ืžืกืคืจ ืฉืœื. ืืชื” ื™ื›ื•ืœ ืœืจื•ืฅ ืขื "--critical=0" ื”ืžื™ื•ื—ื“
ืืคืฉืจื•ืช ืœื’ืœื•ืช ืžื–ื”ื” ืืฉื›ื•ืœ ืงื™ื™ื.

ื“ื•ื’ืžื” 1: ืžืฆื ืืช ื”ืžื–ื”ื” ื”ืจืืฉื•ื ื™

check_postgres_cluster_id --critical=0 --datadir=/var//lib/postgresql/9.0/main

ื“ื•ื’ืžื” 2: ื•ื“ื ืฉื”ืืฉื›ื•ืœ ื–ื”ื” ื•ื”ื–ื”ื™ืจ ืื ืœื, ื‘ืืžืฆืขื•ืช ื”ืชื•ืฆืื” ืžืœืžืขืœื”.

check_postgres_cluster_id --critical=5633695740047915135

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ 1 ืื• 0 ื”ืžืฆื™ื™ืŸ ื”ืฆืœื—ื” ืฉืœ ื›ื™ืฉืœื•ืŸ ืฉืœ ื”ืžื–ื”ื”
ื”ืชืืžื”. ื™ืฉ ืœืกืคืง ืžื–ื”ื” ื›ืืจื’ื•ืžื ื˜ "--mrtg". ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืชืžื™ื“
ื ื•ืชืŸ ืืช ื”ืžื–ื”ื” ื”ื ื•ื›ื—ื™.

ื”ืชื—ื™ื™ื‘ื•ืช
("Symlink: check_postgres_commitratio") ื‘ื•ื“ืง ืืช ื™ื—ืก ื”ื”ืชื—ื™ื™ื‘ื•ื™ื•ืช ืฉืœ ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื
ืžืชืœื•ื ืŸ ื›ืฉื”ื ื ืžื•ื›ื™ื ืžื“ื™. ืื™ืŸ ืฆื•ืจืš ืœื”ืคืขื™ืœ ืคืงื•ื“ื” ื–ื• ื™ื•ืชืจ ืžืคืขื ืื—ืช ื‘ื›ืœ
ืืฉื›ื•ืœ ืžืกื“ ื ืชื•ื ื™ื. ื ื™ืชืŸ ืœืกื ืŸ ืžืกื“ื™ ื ืชื•ื ื™ื ื‘ืืžืฆืขื•ืช ื” --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืœึดืจึฐืื•ึนืช
ื”ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื. ื ื™ืชืŸ ืœืกื ืŸ ืื•ืชื ื’ื ืขืœ ื™ื“ื™ ื”ื‘ืขืœื™ื ืฉืœ
ืžืกื“ ื”ื ืชื•ื ื™ื ืขื ื” --includeuser ื• --excludeuser ืืคืฉืจื•ื™ื•ืช. ืจืื” ืืช "ืฉื ื”ืžืฉืชืžืฉ
ืกืขื™ืฃ ืกื™ื ื•ืŸ" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื™ืฉ ืœืฆื™ื™ืŸ ืืช ื”ืื–ื”ืจื” ื•ื”ืืคืฉืจื•ื™ื•ืช ื”ืงืจื™ื˜ื™ื•ืช ื‘ืื—ื•ื–ื™ื. ืื™ืŸ
ื‘ืจื™ืจื•ืช ืžื—ื“ืœ ืขื‘ื•ืจ ืคืขื•ืœื” ื–ื•: ื™ืฉ ืœืฆื™ื™ืŸ ืืช ื”ืื–ื”ืจื” ื•ื”ืงืจื™ื˜ื™ืช. ืขืจืš ื”ืื–ื”ืจื”
ืœื ื™ื›ื•ืœ ืœื”ื™ื•ืช ื’ื“ื•ืœ ืžื”ืขืจืš ื”ืงืจื™ื˜ื™. ื”ืคืœื˜ ืžื—ื–ื™ืจ ืืช ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืžืžื•ื™ื ื™ื ืœืคื™
ื”ืชื—ื™ื™ื‘ื•ืช, ื”ืงื˜ืŸ ื‘ื™ื•ืชืจ ืจืืฉื•ืŸ.

ื“ื•ื’ืžื”: ื”ื–ื”ืจ ืื ืžืกื“ ื ืชื•ื ื™ื ื›ืœืฉื”ื• ืขืœ ื“ื’ืœ ื”ืžืืจื— ื”ื•ื ืคื—ื•ืช ืž-90% ื‘ื”ืชื—ื™ื™ื‘ื•ืช, ื•ืงืจื™ื˜ื™
ืื ืคื—ื•ืช ืž-80%.

check_postgres_database_commitratio --host=flagg --warning='90%' --critical='80%'

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ืื—ื•ื– ืžืกื“ ื”ื ืชื•ื ื™ื ืขื ื”ื”ืชื—ื™ื™ื‘ื•ืช ื”ืงื˜ื ื” ื‘ื™ื•ืชืจ
ื”ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื•ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ื‘ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช.

ื”ืงืฉืจ
("symlink: check_postgres_connection") ืคืฉื•ื˜ ืžืชื—ื‘ืจ, ืžื•ืฆื™ื 'SELECT ื’ึดืจึฐืกึธื”()', ื•
ืžืฉืื™ืจ. ืœื•ืงื— ืœื --ืึทื–ื”ึธืจึธื” or --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช.

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืคืฉื•ื˜ ืžื•ืฆื™ื 1 (ื—ื™ื‘ื•ืจ ื˜ื•ื‘) ืื• 0 (ื—ื™ื‘ื•ืจ ื’ืจื•ืข) ื‘ืจืืฉื•ืŸ
ืงื•.

ืฉืื™ืœืชื”_ืžื•ืชืืžืช ืื™ืฉื™ืช
("Symlink: check_postgres_custom_query") ืžืคืขื™ืœ ืฉืื™ืœืชื” ืžื•ืชืืžืช ืื™ืฉื™ืช ืœื‘ื—ื™ืจืชืš ื•ืžื ืชื—
ื”ืชื•ืฆืื•ืช. ื”ืฉืื™ืœืชื” ืขืฆืžื” ืžื•ืขื‘ืจืช ื“ืจืš ื”ืืจื’ื•ืžื ื˜ "ืฉืื™ืœืชื”", ื•ืฆืจื™ื›ื” ืœื”ื™ื•ืช
ื ืฉืžืจ ืคืฉื•ื˜ ื›ื›ืœ ื”ืืคืฉืจ. ืื ืืคืฉืจ, ืขื˜ืคื• ืื•ืชื• ื‘ืชืฆื•ื’ื” ืื• ื‘ืคื•ื ืงืฆื™ื” ืฉื™ืฉ ืœืฉืžื•ืจ
ื“ื‘ืจื™ื ืงืœื™ื ื™ื•ืชืจ ืœื ื™ื”ื•ืœ. ื”ืฉืื™ืœืชื” ืฆืจื™ื›ื” ืœื”ื—ื–ื™ืจ ืขืžื•ื“ื” ืื—ืช ืื• ืฉืชื™ื™ื. ื–ื” ืžืชื‘ืงืฉ
ืื—ืช ื”ืขืžื•ื“ื•ืช ืชื™ืงืจื "ืชื•ืฆืื”" ื•ื”ื™ื ื”ืคืจื™ื˜ ืฉื™ื™ื‘ื“ืง ืžื•ืœ ืฉืœืš
ืื–ื”ืจื” ื•ืขืจื›ื™ื ืงืจื™ื˜ื™ื™ื. ื”ืขืžื•ื“ื” ื”ืฉื ื™ื™ื” ืžื™ื•ืขื“ืช ืœื ืชื•ื ื™ ื”ื‘ื™ืฆื•ืขื™ื ื•ืœื›ืœ ืฉื
ื ื™ืชืŸ ืœื”ืฉืชืžืฉ: ื–ื” ื™ื”ื™ื” ื”'ืขืจืš' ื‘ืงื˜ืข ื ืชื•ื ื™ ื‘ื™ืฆื•ืขื™ื.

ื™ืฉ ืœืฆื™ื™ืŸ ืœืคื—ื•ืช ืื–ื”ืจื” ืื• ืืจื’ื•ืžื ื˜ ืงืจื™ื˜ื™ ืื—ื“. ืœืžื” ืืœื” ืžื•ื’ื“ืจื™ื ืชืœื•ื™
ืขืœ ืกื•ื’ ื”ืฉืื™ืœืชื” ืฉืืชื” ืžืคืขื™ืœ. ื™ืฉื ื ืืจื‘ืขื” ืกื•ื’ื™ื ืฉืœ custom_queries ืฉื™ื›ื•ืœื™ื ืœื”ื™ื•ืช
run, ืฉืฆื•ื™ืŸ ืขืœ ื™ื“ื™ ื”ืืจื’ื•ืžื ื˜ "valtype". ืื ืืฃ ืื—ื“ ืœื ืฆื•ื™ืŸ, ืคืขื•ืœื” ื–ื• ืžื•ื’ื“ืจืช ื›ื‘ืจื™ืจืช ืžื—ื“ืœ
'ืžืกืคืจ ืฉืœื'. ืืจื‘ืขืช ื”ืกื•ื’ื™ื ื”ื:

ืžืกืคืจ ืฉืœื: ืขื•ืฉื” ื”ืฉื•ื•ืื” ืคืฉื•ื˜ื” ืฉืœ โ€‹โ€‹ืžืกืคืจื™ื ืฉืœืžื™ื. ื”ืขืžื•ื“ื” ื”ืจืืฉื•ื ื” ืฆืจื™ื›ื” ืœื”ื™ื•ืช ืžืกืคืจ ืฉืœื ืคืฉื•ื˜,
ื•ื”ืขืจื›ื™ ื”ืื–ื”ืจื” ื•ื”ืงืจื™ื˜ื™ื™ื ืฆืจื™ื›ื™ื ืœื”ื™ื•ืช ื–ื”ื™ื.

ืžื—ืจื•ื–ืช: ื”ืื–ื”ืจื” ื•ื”ืงืจื™ื˜ื™ืช ื”ืŸ ืžื—ืจื•ื–ื•ืช, ื•ืžื•ืคืขืœื•ืช ืจืง ืื ื”ืขืจืš ื‘-
ื”ืขืžื•ื“ื” ื”ืจืืฉื•ื ื” ืชื•ืืžืช ืื•ืชื• ื‘ื“ื™ื•ืง. ื–ื” ืชืœื•ื™ ืจื™ืฉื™ื•ืช.

ื–ืžืŸ: ื”ืื–ื”ืจื” ื•ื”ืงืจื™ื˜ื™ ื”ื ื–ืžื ื™ื, ื•ื™ื›ื•ืœื™ื ืœื›ืœื•ืœ ื™ื—ื™ื“ื•ืช ืฉืœ ืฉื ื™ื•ืช, ื“ืงื•ืช,
ืฉืขื•ืช, ืื• ื™ืžื™ื. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื›ืชื‘ ื‘ื™ื—ื™ื“ ืื• ื‘ืงื™ืฆื•ืจ ืœืื•ืช ื”ืจืืฉื•ื ื” ื‘ืœื‘ื“. ืื
ืœื ื ื™ืชื ื•ืช ื™ื—ื™ื“ื•ืช, ืžื ื™ื—ื™ื ืฉื ื™ื•ืช. ื”ืขืžื•ื“ื” ื”ืจืืฉื•ื ื” ืฆืจื™ื›ื” ืœื”ื™ื•ืช ืžืกืคืจ ืฉืœื
ืžื™ื™ืฆื’ ืืช ืžืกืคืจ ื”ืฉื ื™ื•ืช ืœื‘ื“ื™ืงื”.

ื’ื•ื“ืœ: ื”ืื–ื”ืจื” ื•ื”ืงืจื™ื˜ื™ ื”ื ื’ื“ืœื™ื, ื•ื™ื›ื•ืœื™ื ืœื›ืœื•ืœ ื™ื—ื™ื“ื•ืช ืฉืœ ื‘ืชื™ื, ืงื™ืœื•ื‘ื™ื™ื˜ื™ื,
ืžื’ื”-ื‘ื™ื™ื˜, ื’'ื™ื’ื”-ื‘ื™ื™ื˜, ื˜ืจื”-ื‘ื™ื™ื˜ ืื• ืืงืก-ื‘ื™ื™ื˜. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื•ืช ืžืงื•ืฆืจ ืœืื•ืช ื”ืจืืฉื•ื ื”.
ืื ืœื ื ื™ืชื ื•ืช ื™ื—ื™ื“ื•ืช, ืžื ื™ื—ื™ื ื‘ืชื™ื. ื”ืขืžื•ื“ื” ื”ืจืืฉื•ื ื” ืฆืจื™ื›ื” ืœื”ื™ื•ืช ืžืกืคืจ ืฉืœื
ืžื™ื™ืฆื’ ืืช ืžืกืคืจ ื”ื‘ืชื™ื ืœื‘ื“ื™ืงื”.

ื‘ื“ืจืš ื›ืœืœ, ื”ืชืจืื” ืžื•ืคืขืœืช ืื ื”ืขืจื›ื™ื ื”ืžื•ื—ื–ืจื™ื ื”ื ื™ื•ืชืจ ืžึตืึฒืฉืึถืจ ืื• ืฉื•ื•ื” ืœ-
ืขืจืš ืงืจื™ื˜ื™ ืื• ืื–ื”ืจื”. ืขื ื–ืืช, ืืคืฉืจื•ืช ืฉืœ --ืœึทื”ึฒืคื•ึนืš ื™ืคืขื™ืœ ืืช ื”ื”ืชืจืื” ืื
ื”ืขืจืš ื”ืžื•ื—ื–ืจ ื”ื•ื ืœื”ื•ืจื™ื“ ืžึตืึฒืฉืึถืจ ืื• ืฉื•ื•ื” ืœืขืจืš ื”ืงืจื™ื˜ื™ ืื• ื”ืื–ื”ืจื”.

ื“ื•ื’ืžื” 1: ืื–ื”ืจื” ืื ืงืฉืจ ื›ืœืฉื”ื• ืžืขืœ 100 ืขืžื•ื“ื™ื ื ืงืจื "ืจื“", ืฉื™ื ืืช ืžืกืคืจ ื”ืขืžื•ื“ื™ื
ื‘ืชื•ืš ืงื˜ืข ื ืชื•ื ื™ ื‘ื™ืฆื•ืขื™ื.

check_postgres_custom_query --valtype=string -w "rad" --query=
"ื‘ื—ืจ relname AS result, relpages AS pages FROM pg_class WHERE relpages > 100"

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ืื ื”ืคื•ื ืงืฆื™ื” "foobar" ืžื—ื–ื™ืจื” ืžืกืคืจ ืžืขืœ 5MB:

check_postgres_custom_query --critical='5MB'--valtype=size --query="SELECT foobar() AS result"

ื“ื•ื’ืžื” 2: ืื–ื”ืจื” ืื ื”ืคื•ื ืงืฆื™ื” "snazzo" ืžื—ื–ื™ืจื” ืคื—ื•ืช ืž-42:

check_postgres_custom_query --critical=42 --query="SELECT snazzo() AS result" --reverse

ืื ืืชื” ืžืฆื™ื’ custom_query ืฉื™ืžื•ืฉื™, ืฉืงื•ืœ ืœืฉืœื•ื— ืชื™ืงื•ืŸ ืœืชื•ื›ื ื™ืช ื–ื• ืืœ
ืœื”ืคื•ืš ืืช ื–ื” ืœืคืขื•ืœื” ืกื˜ื ื“ืจื˜ื™ืช ืฉืื ืฉื™ื ืื—ืจื™ื ื™ื›ื•ืœื™ื ืœื”ืฉืชืžืฉ ื‘ื”.

ืคืขื•ืœื” ื–ื• ืื™ื ื” ืชื•ืžื›ืช ืขื“ื™ื™ืŸ ื‘-MRTG ืื• ื‘ืคืœื˜ ืคืฉื•ื˜.

ื’ื•ื“ืœ_ื‘ืกื™ืก ื”ื ืชื•ื ื™ื
("Symlink: check_postgres_database_size") ื‘ื•ื“ืง ืืช ื”ื’ื•ื“ืœ ืฉืœ ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ื•ืžืชืœื•ื ืŸ
ื›ืฉื”ื ื’ื“ื•ืœื™ื ืžื“ื™. ืื™ืŸ ืฆื•ืจืš ืœื”ืคืขื™ืœ ืคืงื•ื“ื” ื–ื• ื™ื•ืชืจ ืžืคืขื ืื—ืช ื‘ื›ืœ ืžืกื“ ื ืชื•ื ื™ื
ืึถืฉืื›ึผื•ึนืœ. ื ื™ืชืŸ ืœืกื ืŸ ืžืกื“ื™ ื ืชื•ื ื™ื ื‘ืืžืฆืขื•ืช ื” --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืจืื” ืืช
ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื. ื ื™ืชืŸ ืœืกื ืŸ ืื•ืชื ื’ื ืขืœ ื™ื“ื™ ื”ื‘ืขืœื™ื ืฉืœ
ืžืกื“ ื ืชื•ื ื™ื ืขื ื” --includeuser ื• --excludeuser ืืคืฉืจื•ื™ื•ืช. ืจืื” ืืช "ืกื™ื ื•ืŸ ืฉื ืžืฉืชืžืฉ"
ืกืขื™ืฃ ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื ื™ืชืŸ ืœืฆื™ื™ืŸ ืืช ื”ืื–ื”ืจื” ื•ื”ืืคืฉืจื•ื™ื•ืช ื”ืงืจื™ื˜ื™ื•ืช ื›ื‘ืชื™ื, ืงื™ืœื•ื‘ื™ื™ื˜, ืžื’ื”-ื‘ื™ื™ื˜,
ื’'ื™ื’ื”-ื‘ื™ื™ื˜, ื˜ืจื”-ื‘ื™ื™ื˜ ืื• ืืงืก-ื‘ื™ื™ื˜. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื•ืช ืžืงื•ืฆืจ ื’ื ืœืื•ืช ื”ืจืืฉื•ื ื”.
ืื ืœื ื ื™ืชื ืช ื™ื—ื™ื“ื”, ื”ื”ื ื—ื” ื”ื™ื ืฉื”ื™ื—ื™ื“ื•ืช ื”ืŸ ื‘ืชื™ื. ืื™ืŸ ื‘ืจื™ืจืช ืžื—ื“ืœ ืขื‘ื•ืจ ื–ื”
ืคืขื•ืœื”: ื™ืฉ ืœืฆื™ื™ืŸ ืืช ื”ืื–ื”ืจื” ื•ื”ืงืจื™ื˜ื™ืช. ืขืจืš ื”ืื–ื”ืจื” ืœื ื™ื›ื•ืœ ืœื”ื™ื•ืช ื’ื“ื•ืœ ื™ื•ืชืจ
ืžืืฉืจ ื”ืขืจืš ื”ืงืจื™ื˜ื™. ื”ืคืœื˜ ืžื—ื–ื™ืจ ืืช ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืžืžื•ื™ื ื™ื ืœืคื™ ื”ื’ื•ื“ืœ ื”ื’ื“ื•ืœ ืชื—ื™ืœื”,
ืžืฆื™ื’ ื’ื ื‘ืชื™ื ื’ื•ืœืžื™ื™ื ื•ื’ื ื’ืจืกื” "ื™ืคื”" ืฉืœ ื”ื’ื•ื“ืœ.

ื“ื•ื’ืžื” 1: ื”ื–ื”ืจ ืื ืžืกื“ ื ืชื•ื ื™ื ื›ืœืฉื”ื• ืขืœ ื“ื’ืœ ื”ืžืืจื— ื”ื•ื ื‘ื’ื•ื“ืœ ืฉืœ ื™ื•ืชืจ ืž-1 TB, ื•ื—ื™ื•ื ื™ ืื ื”ื•ื ืžืขืœ
1.1TB

check_postgres_database_size --host=flagg --warning='1 TB' --critical='1.1 t'

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ืื ืชื‘ื ื™ืช ืžืกื“ ื”ื ืชื•ื ื™ื1 ื‘ื™ืฆื™ืื” 5432 ื”ื™ื ืžืขืœ 10 MB.

check_postgres_database_size --port=5432 --include=template1 --warning='10MB' --critical='10MB'

ื“ื•ื’ืžื” 3: ืชืŸ ืื–ื”ืจื” ืื ืžืกื“ ื ืชื•ื ื™ื ื›ืœืฉื”ื• ื‘ืžืืจื— 'tardis' ืฉื‘ื‘ืขืœื•ืช ื”ืžืฉืชืžืฉ 'tom' ื ื’ืžืจ
5 GB

check_postgres_database_size --host=tardis --includeuser=tom --warning='5 GB' --critical='10 GB'

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ื’ื•ื“ืœ ื‘ื‘ื™ื™ื˜ื™ื ืฉืœ ืžืกื“ ื”ื ืชื•ื ื™ื ื”ื’ื“ื•ืœ ื‘ื™ื•ืชืจ ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื•
ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ื‘ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช.

dbstats
("symlink: check_postgres_dbstats") ืžื“ื•ื•ื— ืขืœ ืžื™ื“ืข ืžืชืฆื•ื’ืช pg_stat_database,
ื•ืžื•ืฆื™ื ืื•ืชื• ื‘ืฆื•ืจื” ื™ื“ื™ื“ื•ืชื™ืช ืœืงืงื˜ื•ืกื™ื. ืื™ืŸ ืชืžื™ื›ื” ื‘ืคืœื˜ ืื—ืจ, ื›ืคื™ ืฉื”ื•ื ื ืชืžืš
ืื™ื ืคื•ืจืžื˜ื™ื‘ื™ ื•ืื™ื ื• ืžืชืื™ื ืœื”ืชืจืื•ืช, ื›ื’ื•ืŸ ื‘ืฉื™ืžื•ืฉ ืขื Nagios. ืื ืื™ืŸ ืืคืฉืจื•ื™ื•ืช
ื ื™ืชื ื™ื, ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืžื•ื—ื–ืจื™ื, ืื—ื“ ื‘ื›ืœ ืฉื•ืจื”. ืืชื” ื™ื›ื•ืœ ืœื›ืœื•ืœ ืžืกื“ ื ืชื•ื ื™ื ืกืคืฆื™ืคื™
ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘ืืคืฉืจื•ืช "--include", ืื• ืฉืืชื” ื™ื›ื•ืœ ืœื”ืฉืชืžืฉ ื‘ืืคืฉืจื•ืช "--dbname".

XNUMX ืคืจื™ื˜ื™ื ืžื•ื—ื–ืจื™ื ื‘ื›ืœ ืฉื•ืจื”, ื‘ืคื•ืจืžื˜ name:value, ืžื•ืคืจื“ื™ื ื‘ื™ื—ื™ื“
ืžึถืจื—ึธื‘. ื”ืคืจื™ื˜ื™ื ื”ื:

backends
ืžืกืคืจ ื”-backends ื”ืคื•ืขืœื™ื ื›ืขืช ืขื‘ื•ืจ ืžืกื“ ื ืชื•ื ื™ื ื–ื”.

ืžืชื—ื™ื™ื‘
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ commits ืขื‘ื•ืจ ืžืกื“ ื ืชื•ื ื™ื ื–ื” ืžืื– ืฉื ื•ืฆืจ ืื• ืื™ืคื•ืก.

ื”ื—ื–ืจื•ืช
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ื”ื—ื–ืจื•ืช ืœืื—ื•ืจ ืขื‘ื•ืจ ืžืกื“ ื ืชื•ื ื™ื ื–ื” ืžืื– ื™ืฆื™ืจืชื• ืื• ืื™ืคื•ืกื•.

ืœืงืจื•ื
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ื‘ืœื•ืงื™ ื“ื™ืกืง ืฉื ืงืจืื•.

hit ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ื›ื ื™ืกื•ืช ื—ื™ืฅ.

ret ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืฉื•ืจื•ืช ืฉื”ื•ื—ื–ืจื•.

ืœึฐื”ึธื‘ึดื™ื
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืฉื•ืจื•ืช ืฉื ืœืงื—ื•.

ins ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืฉื•ืจื•ืช ืฉื ื•ืกืคื•.

upd ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืฉื•ืจื•ืช ืฉืขื•ื“ื›ื ื•.

del ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืฉื•ืจื•ืช ืฉื ืžื—ืงื•.

dbname
ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื.

ืฉื™ืžื• ืœื‘ ืฉืคืจื™ื˜ื™ ret, fetch, ins, upd ื•-del ื™ื”ื™ื• ืชืžื™ื“ 0 ืื Postgres ื”ื™ื ื’ืจืกื” 8.2
ืื• ื ืžื•ืš ื™ื•ืชืจ, ืžื›ื™ื•ื•ืŸ ืฉื”ื ืชื•ื ื™ื ื”ืกื˜ื˜ื™ืกื˜ื™ื™ื ืœื ื”ื™ื• ื–ืžื™ื ื™ื ื‘ื’ืจืกืื•ืช ืืœื•.

ืื ื ื™ืชืŸ ืืจื’ื•ืžื ื˜ dbname, ื™ื•ื—ื–ืจื• ืฉื‘ืขื” ืคืจื™ื˜ื™ื ื ื•ืกืคื™ื:

idxscan
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืกืจื™ืงื•ืช ืื™ื ื“ืงืก ืžืฉืชืžืฉ.

idxtupread
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืขืจื›ื™ ืื™ื ื“ืงืก ืžืฉืชืžืฉื™ื ืฉื”ื•ื—ื–ืจื•.

idxtupfetch
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืฉื•ืจื•ืช ืฉื ืœืงื—ื• ืขืœ ื™ื“ื™ ืกืจื™ืงื•ืช ืื™ื ื“ืงืก ืžืฉืชืžืฉ ืคืฉื•ื˜ื•ืช.

idxblksread
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ื‘ืœื•ืงื™ ื“ื™ืกืง ืฉื ืงืจืื• ืขื‘ื•ืจ ื›ืœ ืื™ื ื“ืงืกื™ ื”ืžืฉืชืžืฉ.

idxblkshit
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ื”ืชืืžื•ืช ืžืื’ืจ ืขื‘ื•ืจ ื›ืœ ืื™ื ื“ืงืกื™ ื”ืžืฉืชืžืฉ.

seqscan
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืกืจื™ืงื•ืช ืขื•ืงื‘ื•ืช ืžื•ืœ ื›ืœ ื˜ื‘ืœืื•ืช ื”ืžืฉืชืžืฉ.

sequpread
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ tuples ืฉื”ื•ื—ื–ืจื• ืžื›ืœ ื˜ื‘ืœืื•ืช ื”ืžืฉืชืžืฉ.

ื“ื•ื’ืžื” 1: ืงื— ืืช ื”ื ืชื•ื ื™ื ื”ืกื˜ื˜ื™ืกื˜ื™ื™ื ืฉืœ ืžืกื“ ื ืชื•ื ื™ื ื‘ืฉื "ืžื•ืฆืจื™ื" ืขืœ ื”ืžืืจื— "ื•ื•ื™ืœื•":

check_postgres_dbstats --dbhost willow --dbname ืžื•ืฆืจื™ื

ื”ืคืœื˜ ืฉื™ื•ื—ื–ืจ ื™ื”ื™ื” ื›ืš (ื”ื›ืœ ื‘ืฉื•ืจื” ืื—ืช, ืœื ืขื˜ื•ืฃ):

backends:82 commits:58374408 rollbacks:1651 read:268435543 hit:2920381758 idxscan:310931294 idxtupread:2777040927
idxtupfetch:1840241349 idxblksread:62860110 idxblkshit:1107812216 seqscan:5085305 seqtupread:5370500520
ret:0 fetch:0 ins:0 upd:0 del:0 dbname:willow

disabled_triggers
("ืงื™ืฉื•ืจ ืกื™ืžืœื™: check_postgres_disabled_triggers") ื‘ื•ื“ืง ืืช ืžืกืคืจ ื”ื˜ืจื™ื’ืจื™ื ื”ืžื•ืฉื‘ืชื™ื
ื‘ืชื•ืš ืžืกื“ ื”ื ืชื•ื ื™ื. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ื”ืŸ ืžืกืคืจ ื”ื˜ืจื™ื’ืจื™ื ื›ืืœื”
ื ืžืฆื, ื•ืฉื ื™ื”ื ื›ื‘ืจื™ืจืช ืžื—ื“ืœ ืœ-"1", ืฉื›ืŸ ื‘ืฉื™ืžื•ืฉ ืจื’ื™ืœ ื‘ื™ื˜ื•ืœ ื˜ืจื™ื’ืจื™ื ื”ื•ื ืžืกื•ื›ืŸ
ืžึดืงืจึถื”. ืื ืžืกื“ ื”ื ืชื•ื ื™ื ื”ื ื‘ื“ืง ื”ื•ื 8.3 ื•ืžืขืœื”, ื”ื‘ื“ื™ืงื” ืžื™ื•ืขื“ืช ืœืžืกืคืจ ืฉืœ
ื˜ืจื™ื’ืจื™ื ืฉื ืžืฆืื™ื ื‘ืกื˜ื˜ื•ืก 'ืžื•ืฉื‘ืช' (ื‘ื ื™ื’ื•ื“ ืœื”ื™ื•ืชื 'ืชืžื™ื“' ืื• 'ืขื•ืชืง'). ื”
ื”ืคืœื˜ ื™ืฆื™ื’ ืืช ืฉื ื”ื˜ื‘ืœื” ื•ืืช ืฉื ื”ื˜ืจื™ื’ืจ ืขื‘ื•ืจ ื›ืœ ืžื•ืฉื‘ืช
ื”ื“ืง.

ื“ื•ื’ืžื” 1: ื•ื“ื ืฉืื™ืŸ ื˜ืจื™ื’ืจื™ื ืžื•ืฉื‘ืชื™ื

check_postgres_disabled_triggers

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ืžืกืคืจ ื”ื˜ืจื™ื’ืจื™ื ื”ืžื•ืฉื‘ืชื™ื ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”.

ื“ื™ืกืง_space
("Symlink: check_postgres_disk_space") ื‘ื•ื“ืง ืืช ืฉื˜ื— ื”ื“ื™ืกืง ื”ืคื™ื–ื™ ื”ืคื ื•ื™ ื‘ืฉื™ืžื•ืฉ ืขืœ ื™ื“ื™
Postgres. ืคืขื•ืœื” ื–ื• ืžื—ื™ื™ื‘ืช ืืช ืงื•ื‘ืฅ ื”ื”ืคืขืœื” "/bin/df"ื–ืžื™ืŸ ืœื“ื™ื•ื•ื—
ืขืœ ื’ื“ืœื™ ื“ื™ืกืงื™ื, ื•ื”ื•ื ื’ื ืฆืจื™ืš ืœื”ื™ื•ืช ืžื•ืคืขืœ ื‘ืชื•ืจ ืžืฉืชืžืฉ-ืขืœ, ื›ื“ื™ ืฉื”ื•ื ื™ื•ื›ืœ ืœื‘ื—ื•ืŸ ืืช
data_directory ื”ื’ื“ืจื” ื‘ืชื•ืš Postgres. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื ื™ืชื ื•ืช ืืคืฉืจื•ื™ื•ืช
ื‘ื’ื“ืœื™ื ืื• ื‘ืื—ื•ื–ื™ื ืื• ื‘ืฉื ื™ื”ื. ืื ืžืฉืชืžืฉื™ื ื‘ื’ื“ืœื™ื, ืกื•ื’ื™ ื”ื™ื—ื™ื“ื•ืช ื”ืกื˜ื ื“ืจื˜ื™ื™ื ื”ื
ืžื•ืชืจ: ื‘ื™ื™ื˜ื™ื, ืงื™ืœื•ื‘ื™ื™ื˜ื™ื, ื’'ื™ื’ื”-ื‘ื™ื™ื˜, ืžื’ื”-ื‘ื™ื™ื˜, ื’'ื™ื’ื”-ื‘ื™ื™ื˜, ื˜ืจื”-ื‘ื™ื™ื˜ ืื• ืืงืก-ื‘ื™ื™ื˜. ื›ืœ ืื—ื“
ื ื™ืชืŸ ืœืงืฆืจ ืœืื•ืช ื”ืจืืฉื•ื ื” ื‘ืœื‘ื“; ืื™ืŸ ื™ื—ื™ื“ื•ืช ื›ืœืœ ืžืฆื™ื™ื ืช 'ื‘ืชื™ื'. ื”
ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื '90%' ื•-'95%'.

ืคืงื•ื“ื” ื–ื• ื‘ื•ื“ืงืช ืืช ื”ื“ื‘ืจื™ื ื”ื‘ืื™ื ื›ื“ื™ ืœืงื‘ื•ืข ืืช ื›ืœ ื”ื“ื™ืกืงื™ื ื”ืคื™ื–ื™ื™ื ื”ืฉื•ื ื™ื
ื‘ืฉื™ืžื•ืฉ ืขืœ ื™ื“ื™ Postgres.

data_directory - ื”ื“ื™ืกืง ืฉื‘ื• ื ืžืฆืืช ืกืคืจื™ื™ืช ื”ื ืชื•ื ื™ื ื”ืจืืฉื™ืช.

ื”ื™ื›ื ืก ื‘ืกืคืจื™ื™ื” - ื”ื“ื™ืกืง ืฉื‘ื• ื ืžืฆืื™ื ืงื•ื‘ืฆื™ ื”ื™ื•ืžืŸ.

ื•ื•ืœ ืคื™ืœื” ื‘ืกืคืจื™ื™ื” - ื”ื“ื™ืกืง ืฉื‘ื• ื ืžืฆืื™ื ื™ื•ืžื ื™ ื”ื›ืชื™ื‘ื” ืงื“ื™ืžื” (ืœืžืฉืœ ืขื ืงื™ืฉื•ืจ ืกื™ืžืœื™ pg_xlog)

ืžืจื—ื‘ื™ ืฉื•ืœื—ื ื•ืช - ื›ืœ ืฉื˜ื— ื˜ื‘ืœื” ืฉื ืžืฆื ื‘ื“ื™ืกืง ื ืคืจื“.

ื”ืคืœื˜ ืžืฆื™ื’ ืืช ื”ื’ื•ื“ืœ ื”ื›ื•ืœืœ ื‘ืฉื™ืžื•ืฉ ื•ื–ืžื™ืŸ ื‘ื›ืœ ื“ื™ืกืง, ื›ืžื• ื’ื ืืช
ืื—ื•ื–, ืžืกื•ื“ืจ ืœืคื™ ื”ืื—ื•ื– ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ืœื ืžื•ืš ื‘ื™ื•ืชืจ ื‘ืฉื™ืžื•ืฉ. ื›ืœ ืคืจื™ื˜ ืœืžืขืœื” ืžืžืคื” ืœืงื•ื‘ืฅ
ืžืขืจื›ืช: ื ื™ืชืŸ ืœื›ืœื•ืœ ืื• ืœื ืœื›ืœื•ืœ ืื•ืชื. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืžื™ื“ืข ื ื•ืกืฃ
ืคืจื˜ื™ื.

ื“ื•ื’ืžื” 1: ื•ื“ื ืฉืืฃ ืžืขืจื›ืช ืงื‘ืฆื™ื ืื™ื ื” ืขื•ืœื” ืขืœ 90% ืขื‘ื•ืจ ืžืกื“ ื”ื ืชื•ื ื™ื ื‘ื™ืฆื™ืื” 5432.

check_postgres_disk_space --port=5432 --warning='90%' --critical='90%'

ื“ื•ื’ืžื” 2: ื‘ื“ื•ืง ืฉื›ืœ ืžืขืจื›ื•ืช ื”ืงื‘ืฆื™ื ื”ืžืชื—ื™ืœื•ืช ื‘-/dev/sda ืงื˜ื ื•ืช ืž-10 GB ื•
11 GB (ืื–ื”ืจื” ื•ืงืจื™ื˜ื™)

check_postgres_disk_space --port=5432 --warning='10 GB' --critical='11 GB' --include="~^/dev/sda"

ื“ื•ื’ืžื” 4: ื•ื“ื ืฉืืฃ ืžืขืจื›ืช ืงื‘ืฆื™ื ืื™ื ื” ืžืขืœ 50% ื• ื™ืฉ ืžืขืœ 15 GB

check_postgres_disk_space --critical='50% ื•-15 GB'

ื“ื•ื’ืžื” 5: ื”ืคืง ืื–ื”ืจื” ืื ืžืขืจื›ืช ืงื‘ืฆื™ื ื›ืœืฉื”ื™ ืžืœืื” ื‘ืžืขืœ 70%. or ื™ืฉ ื™ื•ืชืจ ืž-1T

check_postgres_disk_space --warning='1T ืื• 75'

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ื’ื•ื“ืœ ื‘ื‘ื™ื™ื˜ื™ื ืฉืœ ืžืขืจื›ืช ื”ืงื‘ืฆื™ื ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื•ื”-
ืฉื ืžืขืจื›ืช ื”ืงื‘ืฆื™ื ื‘ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช.

fsm_pages
("symlink: check_postgres_fsm_pages") ื‘ื•ื“ืง ื›ืžื” ืงืจื•ื‘ ืืฉื›ื•ืœ ืœ-Postgres
max_fsm_pages ื”ื’ื“ืจื”. ืคืขื•ืœื” ื–ื• ืชืขื‘ื•ื“ ืจืง ืขื‘ื•ืจ ืžืกื“ื™ ื ืชื•ื ื™ื ืฉืœ 8.2 ื•ืžืขืœื”, ื•ื”ื™ื
ื“ื•ืจืฉ ืืช ืžื•ื“ื•ืœ ื”ืชืจื•ืžื” pg_freespacemap ืœื”ื™ื•ืช ืžื•ืชืงืŸ. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™
ื™ืฉ ืœื‘ื˜ื ืืช ื”ืืคืฉืจื•ื™ื•ืช ื‘ืื—ื•ื–ื™ื. ืžืกืคืจ ื”ื“ืคื™ื ื‘ืฉื™ืžื•ืฉ ื‘ืžืคืช ื”ืฉื˜ื— ื”ืคื ื•ื™
ื ืงื‘ืข ืขืœ ื™ื“ื™ ื”ืกืชื›ืœื•ืช ื‘ืชืฆื•ื’ืช pg_freespacemap_relations, ื•ื”ืคืขืœืช ื ื•ืกื—ื”
ืžื‘ื•ืกืก ืขืœ ื”ื ื•ืกื—ื” ื”ืžืฉืžืฉืช ืœื”ืคืงืช ืžืฉื‘ืฆื•ืช ืขืžื•ื“ื™ื ืฉืœ ืฉื˜ื— ืคื ื•ื™ ื‘ืžืคื” ื‘ืžื™ืœื•ืœื™ ื•ืืงื•ื
ืคืงื•ื“ื”. ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื 85% ืขื‘ื•ืจ ื”ืื–ื”ืจื” ื• 95% ืขื‘ื•ืจ ื”ืงืจื™ื˜ื™ื™ื.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ื›ืืฉืจ ื”ืืฉื›ื•ืœ ืฉืœื ื• ืžื ืฆืœ 76% ืžืฉื˜ื—ื™ ื”ื“ืคื™ื ื”ืคื ื•ื™,
ืขื pg_freespacemap ืžื•ืชืงืŸ ื‘ืžืกื“ ื”ื ืชื•ื ื™ื ืจื•ื‘ืจื˜

check_postgres_fsm_pages --dbname=robert --warning="76%"

ื‘ื–ืžืŸ ืฉืืชื” ืฆืจื™ืš ืœื”ืขื‘ื™ืจ ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ืฉื‘ื• ืžื•ืชืงืŸ pg_freespacemap, ืืชื”
ืฆืจื™ืš ืœื”ืจื™ืฅ ืืช ื”ื‘ื“ื™ืงื” ื”ื–ื• ืจืง ืคืขื ืื—ืช ื‘ื›ืœ ืืฉื›ื•ืœ. ื›ืžื• ื›ืŸ, ื‘ื“ื™ืงืช ืžื™ื“ืข ื–ื” ืื›ืŸ ืžื—ื™ื™ื‘ืช
ื”ืฉื’ืช ืžื ืขื•ืœื™ื ืžื™ื•ื—ื“ื™ื ืขืœ ืžืคืช ื”ืฉื˜ื— ื”ืคื ื•ื™, ืœื›ืŸ ืžื•ืžืœืฅ ืœื ืœื”ืคืขื™ืœ ื–ืืช
ืœื‘ื“ื•ืง ื‘ืžืจื•ื•ื—ื™ื ืงืฆืจื™ื.

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ืื—ื•ื– ืฉืœ ืžืคืช ื”ืฉื˜ื— ื”ืคื ื•ื™ ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื•ืืช ื”ืžืกืคืจ
ืฉืœ ื”ื“ืคื™ื ื‘ืฉื™ืžื•ืฉ ื›ืขืช ื‘ืฉื•ืจื” ื”ืฉื ื™ื™ื”.

fsm_relations
("symlink: check_postgres_fsm_relations") ื‘ื•ื“ืง ื›ืžื” ืงืจื•ื‘ ืืฉื›ื•ืœ ืœ-Postgres
max_fsm_relations ื”ื’ื“ืจื”. ืคืขื•ืœื” ื–ื• ืชืขื‘ื•ื“ ืจืง ืขื‘ื•ืจ ืžืกื“ื™ ื ืชื•ื ื™ื ืฉืœ 8.2 ื•ืžืขืœื”, ื•
ื–ื” ื“ื•ืจืฉ ืืช ืžื•ื“ื•ืœ ื”ืชืจื•ืžื” pg_freespacemap ืœื”ื™ื•ืช ืžื•ืชืงืŸ. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™
ื™ืฉ ืœื‘ื˜ื ืืช ื”ืืคืฉืจื•ื™ื•ืช ื‘ืื—ื•ื–ื™ื. ืžืกืคืจ ื”ื™ื—ืกื™ื ื‘ืฉื™ืžื•ืฉ ื‘-free-
space-map ื ืงื‘ืข ืขืœ ื™ื“ื™ ื”ืกืชื›ืœื•ืช ื‘ืชืฆื•ื’ืช pg_freespacemap_relations. ื‘ืจื™ืจืช ื”ืžื—ื“ืœ
ื”ืขืจื›ื™ื ื”ื 85% ืขื‘ื•ืจ ื”ืื–ื”ืจื” ื• 95% ืขื‘ื•ืจ ื”ืงืจื™ื˜ื™ื™ื.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ื›ืืฉืจ ื”ืืฉื›ื•ืœ ืฉืœื ื• ื ื™ืฆืœ 80% ืžื™ื—ืกื™ ื”ืฉื˜ื— ื”ืคื ื•ื™,
ืขื pg_freespacemap ืžื•ืชืงืŸ ื‘ืžืกื“ ื”ื ืชื•ื ื™ื Dylan

check_postgres_fsm_relations --dbname=dylan --warning="75%"

ื‘ื–ืžืŸ ืฉืืชื” ืฆืจื™ืš ืœื”ืขื‘ื™ืจ ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ืฉื‘ื• ืžื•ืชืงืŸ pg_freespacemap, ืืชื”
ืฆืจื™ืš ืœื”ืจื™ืฅ ืืช ื”ื‘ื“ื™ืงื” ื”ื–ื• ืจืง ืคืขื ืื—ืช ื‘ื›ืœ ืืฉื›ื•ืœ. ื›ืžื• ื›ืŸ, ื‘ื“ื™ืงืช ืžื™ื“ืข ื–ื” ืื›ืŸ ืžื—ื™ื™ื‘ืช
ื”ืฉื’ืช ืžื ืขื•ืœื™ื ืžื™ื•ื—ื“ื™ื ืขืœ ืžืคืช ื”ืฉื˜ื— ื”ืคื ื•ื™, ืœื›ืŸ ืžื•ืžืœืฅ ืœื ืœื”ืคืขื™ืœ ื–ืืช
ืœื‘ื“ื•ืง ื‘ืžืจื•ื•ื—ื™ื ืงืฆืจื™ื.

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ืื—ื•ื– ืฉืœ ืžืคืช ื”ืฉื˜ื— ื”ืคื ื•ื™ ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื”ืžืกืคืจ ืฉืœ
ื”ื™ื—ืกื™ื ื”ืžืฉืžืฉื™ื ื›ื™ื•ื ื‘ืงื• ื”ืฉื ื™.

hitratio
("Symlink: check_postgres_hitratio") ื‘ื•ื“ืง ืืช ื™ื—ืก ื”ืคื’ื™ืขื” ืฉืœ ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ื•ืžืชืœื•ื ืŸ
ื›ืฉื”ื ื ืžื•ื›ื™ื ืžื“ื™. ืื™ืŸ ืฆื•ืจืš ืœื”ืคืขื™ืœ ืคืงื•ื“ื” ื–ื• ื™ื•ืชืจ ืžืคืขื ืื—ืช ื‘ื›ืœ ืžืกื“ ื ืชื•ื ื™ื
ืึถืฉืื›ึผื•ึนืœ. ื ื™ืชืŸ ืœืกื ืŸ ืžืกื“ื™ ื ืชื•ื ื™ื ื‘ืืžืฆืขื•ืช ื” --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืจืื” ืืช
ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื. ื ื™ืชืŸ ืœืกื ืŸ ืื•ืชื ื’ื ืขืœ ื™ื“ื™ ื”ื‘ืขืœื™ื ืฉืœ
ืžืกื“ ื ืชื•ื ื™ื ืขื ื” --includeuser ื• --excludeuser ืืคืฉืจื•ื™ื•ืช. ืจืื” ืืช "ืกื™ื ื•ืŸ ืฉื ืžืฉืชืžืฉ"
ืกืขื™ืฃ ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื™ืฉ ืœืฆื™ื™ืŸ ืืช ื”ืื–ื”ืจื” ื•ื”ืืคืฉืจื•ื™ื•ืช ื”ืงืจื™ื˜ื™ื•ืช ื‘ืื—ื•ื–ื™ื. ืื™ืŸ
ื‘ืจื™ืจื•ืช ืžื—ื“ืœ ืขื‘ื•ืจ ืคืขื•ืœื” ื–ื•: ื™ืฉ ืœืฆื™ื™ืŸ ืืช ื”ืื–ื”ืจื” ื•ื”ืงืจื™ื˜ื™ืช. ืขืจืš ื”ืื–ื”ืจื”
ืœื ื™ื›ื•ืœ ืœื”ื™ื•ืช ื’ื“ื•ืœ ืžื”ืขืจืš ื”ืงืจื™ื˜ื™. ื”ืคืœื˜ ืžื—ื–ื™ืจ ืืช ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืžืžื•ื™ื ื™ื ืœืคื™
hitratio, ื”ืงื˜ืŸ ื‘ื™ื•ืชืจ ืจืืฉื•ืŸ.

ื“ื•ื’ืžื”: ื”ื–ื”ืจ ืื ืžืกื“ ื ืชื•ื ื™ื ื›ืœืฉื”ื• ืขืœ ื“ื’ืœ ื”ืžืืจื— ื”ื•ื ืคื—ื•ืช ืž-90% ื‘ืฉื™ืขื•ืจ ื™ื—ืก, ื•ืงืจื™ื˜ื™ ืื
ืคื—ื•ืช ืž-80%.

check_postgres_hitratio --host=flagg --warning='90%' --critical='80%'

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ืื—ื•ื– ืฉืœ ืžืกื“ ื”ื ืชื•ื ื™ื ืขื ื”ื™ื—ืก ื”ืงื˜ืŸ ื‘ื™ื•ืชืจ ื‘-
ืฉื•ืจื” ืจืืฉื•ื ื”, ื•ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ื‘ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช.

ื—ื_ื”ืžืชื ื”_ืขื™ื›ื•ื‘
("Symlink: check_hot_standby_delay") ื‘ื•ื“ืง ืืช ื”ืฉื”ื™ื™ืช ื”ืฉื›ืคื•ืœ ื‘ืกื˜ืจื™ืžื™ื ื’ ืขืœ ื™ื“ื™ ืžื—ืฉื•ื‘
delta ื‘ื™ืŸ ืžื™ืงื•ื ื”-xlog ื”ื ื•ื›ื—ื™ ืฉืœ ืฉืจืช ืžืืกื˜ืจ ืœื‘ื™ืŸ ืžื™ืงื•ื ื”ื”ืฉืžืขื” ื”ื—ื•ื–ืจืช ืฉืœ a
ืขื‘ื“ ืžื—ื•ื‘ืจ ืืœื™ื•. ืฉืจืช ื”ืขื‘ื“ ื—ื™ื™ื‘ ืœื”ื™ื•ืช ื‘ืžืฆื‘ hot_standby (ืœืžืฉืœ ืœืงืจื™ืื” ื‘ืœื‘ื“),
ืœื›ืŸ ื”ื’ืจืกื” ื”ืžื™ื ื™ืžืœื™ืช ืœืฉื™ืžื•ืฉ ื‘ืคืขื•ืœื” ื–ื• ื”ื™ื Postgres 9.0. ื” --ืึทื–ื”ึธืจึธื” ื•
--ืงืจื™ื˜ื™ ื”ืืคืฉืจื•ื™ื•ืช ื”ืŸ ื”ื“ืœืชื ื‘ื™ืŸ ืžื™ืงื•ืžื™ ื”-xlog. ืžื›ื™ื•ื•ืŸ ืฉื”ืขืจื›ื™ื ื”ืœืœื• ื”ื ื‘ืชื™ื
ืงื™ื–ื•ื–ื™ื ื‘-WAL ื”ื ืฆืจื™ื›ื™ื ืœื”ืชืื™ื ืœื ืคื— ื”ืขืกืงืื•ืช ื”ืฆืคื•ื™ ืฉืœ ื”ื™ื™ืฉื•ื ืฉืœืš
ื›ื“ื™ ืœืžื ื•ืข ืชื•ืฆืื•ืช ื—ื™ื•ื‘ื™ื•ืช ืื• ืฉืœื™ืœื™ื•ืช ืฉื’ื•ื™ื•ืช.

ื”ืืคืฉืจื•ื™ื•ืช ื”ืจืืฉื•ื ื•ืช "--dbname", "--host" ื•-"--port" ื•ื›ื•' ื ื—ืฉื‘ื•ืช ืœืžืืกื˜ืจ; ื”
ื”ืฉื ื™ ืฉื™ื™ืš ืœืขื‘ื“.

ืขืจื›ื™ ื‘ืชื™ื ืฆืจื™ื›ื™ื ืœื”ืชื‘ืกืก ืขืœ ื ืคื— ื”ืขืกืงืื•ืช ื”ื“ืจื•ืฉื•ืช ืœื‘ื™ืฆื•ืข ื”ืกื˜ืจื™ืžื™ื ื’
ื ื™ืชื•ืง ืฉื›ืคื•ืœ ืžื”ืžืืกื˜ืจ ื‘ื’ืœืœ ืคื™ื’ื•ืจ ืจื‘ ืžื“ื™, ืฉื ืงื‘ืข ืขืœ ื™ื“ื™ ื”-Postgres
ืžืฉืชื ื” ืชืฆื•ืจื” wal_keep_segments. ืขื‘ื•ืจ ื™ื—ื™ื“ื•ืช ื–ืžืŸ, ื™ื—ื™ื“ื•ืช ืชืงืคื•ืช ื”ืŸ 'ืฉื ื™ื•ืช',
'ื“ืงื•ืช', 'ืฉืขื•ืช' ืื• 'ื™ืžื™ื'. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื›ืชื‘ ื‘ื™ื—ื™ื“ ืื• ื‘ืงื™ืฆื•ืจ ืœ-
ืžื›ืชื‘ ืจืืฉื•ืŸ. ื›ืืฉืจ ืžืฆื™ื™ื ื™ื ืืช ืฉื ื™ื”ื, ื‘ืฆื•ืจื” 'ื‘ืชื™ื ื• ื–ืžืŸ', ืฉื ื™ ื”ืชื ืื™ื ื—ื™ื™ื‘ื™ื ืœื”ื™ื•ืช
ื ื›ื•ืŸ ืœืกืฃ ืฉื™ืฉ ืœืขืžื•ื“ ื‘ื•.

ืขืœื™ืš ืœืกืคืง ืžื™ื“ืข ื›ื™ืฆื“ ืœื”ื’ื™ืข ืœืžืื’ืจื™ ื”ืžื™ื“ืข ืขืœ ื™ื“ื™ ืžืชืŸ ืคืกื™ืง ืžื•ืคืจื“
ืจืฉื™ืžื” ืœืคืจืžื˜ืจื™ื --dbhost ื•--dbport, ื›ื’ื•ืŸ "--dbport=5432,5543". ืื ืœื ื ื™ืชืŸ,
ื”ืคืขื•ืœื” ื ื›ืฉืœืช.

ื“ื•ื’ืžื” 1: ืื–ื”ืจื” ืฉืžืกื“ ื ืชื•ื ื™ื ืขื ื”ืขืชืง ืžืงื•ืžื™ ื‘ื™ืฆื™ืื” 5433 ื ืžืฆื ืžืื—ื•ืจื™ ื›ืœ ืฉื™ื“ื•ืจ ื—ื•ื–ืจ ืฉืœ xlog
ื‘ื›ืœืœ

check_hot_standby_delay --dbport=5432,5433 --warning='1'

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ืื ืจืคืœื™ืงืช ื”ืขืกืงื” ื”ืื—ืจื•ื ื” ืฉืžืงื‘ืœืช ื”ื™ื ื™ื•ืชืจ ืž-1
ืœืคื ื™ ื“ืงื•ืช

check_hot_standby_delay --dbhost=master,replica1 --critical='10 ื“ืงื•ืช'

ื“ื•ื’ืžื” 3: ืืคืฉืจ ืœืจืคืœื™ืงื”1 ืœื”ื™ื•ืช ืงื˜ืข WAL ืื—ื“ ืžืื—ื•ืจ, ืื ื”ืžืืกื˜ืจ ืจื•ืื” ืœืจื’ืข
ื™ื•ืชืจ ืคืขื™ืœื•ืช ืžืžื” ืฉื—ื™ื‘ื•ืจ ื”ืฉื›ืคื•ืœ ื‘ืกื˜ืจื™ืžื™ื ื’ ื™ื›ื•ืœ ืœื”ืชืžื•ื“ื“, ืื• 10 ื“ืงื•ืช ืื—ืจื™,
ืื ื”ืžืืกื˜ืจ ืจื•ืื” ืžืขื˜ ืžืื•ื“ ืคืขื™ืœื•ืช ื•ืื™ื ื• ืžืขื‘ื“ ืขืกืงืื•ืช, ืื‘ืœ ืœื
ืฉื ื™ื”ื, ืžื” ืฉื™ืขื™ื“ ืขืœ ื‘ืขื™ื” ืžืชืžืฉื›ืช ื‘ื—ื™ื‘ื•ืจ ื”ืฉื›ืคื•ืœ.

check_hot_standby_delay --dbhost=master,replica1 --warning='1048576 ื•-2 ื“ืงื•ืช' --critical='16777216 ื•-10 ื“ืงื•ืช'

index_size
table_size
ื’ื•ื“ืœ_ื™ื—ืก
(ืงื™ืฉื•ืจื™ื ืกื™ืžืœื™ื™ื: "check_postgres_index_size", "check_postgres_table_size", ื•ื›ืŸ
"check_postgres_relation_size") ื”ืคืขื•ืœื•ืช table_size ื• index_size ื”ื ืคืฉื•ื˜
ื•ืจื™ืืฆื™ื•ืช ืฉืœ ื’ื•ื“ืœ_ื™ื—ืก ืคืขื•ืœื”, ืฉื‘ื•ื“ืงืช ื’ื ืงืฉืจ ืฉืฆืžื—
ื’ึธื“ื•ึนืœ. ื ื™ืชืŸ ืœืกื ืŸ ืงืฉืจื™ื (ื‘ืžื™ืœื™ื ืื—ืจื•ืช, ื˜ื‘ืœืื•ืช ื•ืื™ื ื“ืงืกื™ื) ื‘ืืžืฆืขื•ืช ื”- --ืœึดื›ืœื•ึนืœ
ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื. ื™ื—ืกื™ื ื™ื›ื•ืœื™ื
ื™ืกื•ื ื ื• ื’ื ืขืœ ื™ื“ื™ ื”ืžืฉืชืžืฉ ืฉื‘ื‘ืขืœื•ืชื•, ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘- --includeuser ื• --excludeuser
ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ืฉื ืžืฉืชืžืฉ" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื”ืขืจื›ื™ื ืขื‘ื•ืจ --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื”ืืคืฉืจื•ื™ื•ืช ื”ืŸ ื’ื“ืœื™ ืงื‘ืฆื™ื, ื•ืขืฉื•ื™ื•ืช ืœื”ื›ื™ืœ ื™ื—ื™ื“ื•ืช ืฉืœ
ื‘ืชื™ื, ืงื™ืœื•ื‘ื™ื™ื˜, ืžื’ื”-ื‘ื™ื™ื˜, ื’ื™ื’ื”-ื‘ื™ื™ื˜, ื˜ืจื”-ื‘ื™ื™ื˜ ืื• ืืงืก-ื‘ื™ื™ื˜. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื•ืช ืžืงื•ืฆืจ
ืœืื•ืช ื”ืจืืฉื•ื ื”. ืื ืœื ื ื™ืชื ื•ืช ื™ื—ื™ื“ื•ืช, ืžื ื™ื—ื™ื ื‘ืชื™ื. ืื™ืŸ ื‘ืจื™ืจืช ืžื—ื“ืœ
ืขืจื›ื™ื: ื™ืฉ ืœืชืช ื’ื ืืช ื”ืื–ื”ืจื” ื•ื’ื ืืช ื”ืืคืฉืจื•ืช ื”ืงืจื™ื˜ื™ืช. ื˜ืงืกื˜ ื”ื”ื—ื–ืจื” ืžืฆื™ื’ ืืช
ื’ื•ื“ืœ ื”ืงืฉืจ ื”ื’ื“ื•ืœ ื‘ื™ื•ืชืจ ืฉื ืžืฆื.

ืื --showperf ื”ืืคืฉืจื•ืช ืžื•ืคืขืœืช, ืืช ื›ืœ ืฉืœ ื”ื™ื—ืกื™ื ืขื ื”ื’ื“ืœื™ื ืฉืœื”ื ื™ื™ื ืชื ื•.
ื›ื“ื™ ืœืžื ื•ืข ื–ืืช, ืžื•ืžืœืฅ ืœื”ื’ื“ื™ืจ ืืช --perflimit ืืคืฉืจื•ืช, ืฉืชื’ืจื•ื
ื”ืฉืื™ืœืชื” ืœื‘ืฆืข "ORDER BY size DESC LIMIT (perflimit)".

ื“ื•ื’ืžื” 1: ืชืŸ ืงืจื™ื˜ื™ ืื ื˜ื‘ืœื” ื›ืœืฉื”ื™ ื”ื™ื ื’ื“ื•ืœื” ืž-600MB ื‘ื‘ื•ืจื™ืง ืžืืจื—.

check_postgres_table_size --critical='600 MB' --warning='600 MB' --host=burrick

ื“ื•ื’ืžื” 2: ื”ืชืจื™ืข ืื ืžื•ืฆืจื™ ื”ืฉื•ืœื—ืŸ ื”ื ื‘ื’ื•ื“ืœ ืฉืœ ืžืขืœ 4 GB, ื•ืชืŸ ืงืจื™ื˜ื™ ื‘-4.5 GB.

check_postgres_table_size --host=burrick --warning='4 GB' --critical='4.5 GB' --include=products

ื“ื•ื’ืžื” 3: ื”ื–ื”ืจ ืื ืื™ื ื“ืงืก ื›ืœืฉื”ื• ืฉืื™ื ื• ื‘ื‘ืขืœื•ืช postgres ืขื•ืœื” ืขืœ 500 MB.

check_postgres_index_size --port=5432 --excludeuser=postgres -w 500MB -c 600MB

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ื’ื•ื“ืœ ื‘ื‘ื™ื™ื˜ื™ื ืฉืœ ื”ื™ื—ืก ื”ื’ื“ื•ืœ ื‘ื™ื•ืชืจ, ื•ืืช ื”ืฉื ืฉืœ ื”-
ืžืกื“ ื ืชื•ื ื™ื ื•ื™ื—ืก ื‘ืชื•ืจ ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช.

ื ื™ืชื•ื—_ืื—ืจื•ืŸ
ื•ืืงื•ื_ืื—ืจื•ืŸ
last_autoanalyze
ื•ืืงื•ื_ืื•ื˜ื•ืžื˜ื™ ืื—ืจื•ืŸ
(ืงื™ืฉื•ืจื™ื ืกื™ืžืœื™ื™ื: "check_postgres_last_analyze", "check_postgres_last_vacuum",
"check_postgres_last_autoanalyze", ื•-"check_postgres_last_autovacuum") ื‘ื•ื“ืง ื›ืžื” ื–ืžืŸ
ื–ื” ื”ื™ื” ืžืื– ืฉื•ื•ืืงื•ื (ืื• ื ื™ืชื•ื—) ื”ื•ืคืขืœ ืœืื—ืจื•ื ื” ืขืœ ื›ืœ ื˜ื‘ืœื” ื‘ืžืกื“ ื ืชื•ื ื™ื ืื—ื“ ืื• ื™ื•ืชืจ.
ื”ืฉื™ืžื•ืฉ ื‘ืคืขื•ืœื•ืช ืืœื• ืžื—ื™ื™ื‘ ืฉืžืกื“ ื”ื ืชื•ื ื™ื ื”ื™ืขื“ ื”ื•ื ื’ืจืกื” 8.3 ืื• ืžืชืขืœื”, ืื• ืžืฉื”ื• ื›ื–ื”
ื”ื’ืจืกื” ื”ื™ื 8.2 ื•ืžืฉืชื ื” ื”ืชืฆื•ืจื” stats_row_level ื”ื•ืคืขืœ. ื˜ื‘ืœืื•ืช
ื ื™ืชืŸ ืœืกื ืŸ ืขื --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืจืื” "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™"
ืกืขื™ืฃ ืœืคืจื˜ื™ื ื ื•ืกืคื™ื. ื ื™ืชืŸ ืœืกื ืŸ ื˜ื‘ืœืื•ืช ื’ื ืขืœ ื™ื“ื™ ื‘ืขืœื™ื”ื ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘-
--includeuser ื• --excludeuser ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ืฉื ืžืฉืชืžืฉ" ืœืžื™ื“ืข ื ื•ืกืฃ
ืคืจื˜ื™ื.

ื”ื™ื—ื™ื“ื•ืช ืขื‘ื•ืจ --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืžืฆื•ื™ื ื™ื ื›ื–ืžื ื™ื. ื™ื—ื™ื“ื•ืช ื—ื•ืงื™ื•ืช ื”ืŸ ืฉื ื™ื•ืช,
ื“ืงื•ืช, ืฉืขื•ืช ื•ื™ืžื™ื; ื ื™ืชืŸ ืœืงืฆืจ ืืช ื›ื•ืœื ืœืื•ืช ื”ืจืืฉื•ื ื”. ืื ืื™ืŸ ื™ื—ื™ื“ื•ืช
ื‘ื”ื™ื ืชืŸ, ืžื ื™ื—ื™ื 'ืฉื ื™ื•ืช'. ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื 'ื™ื•ื ืื—ื“' ื•'ื™ื•ืžื™ื™ื'. ืฉื™ืžื• ืœื‘
ืฉื™ืฉ ืžืงืจื™ื ืฉื‘ื”ื ืฉื“ื” ื–ื” ืื™ื ื• ืžืื•ื›ืœืก ืื•ื˜ื•ืžื˜ื™ืช. ืื ื‘ื˜ื•ื—
ื˜ื‘ืœืื•ืช ื ื•ืชื ื•ืช ืœืš ื‘ืขื™ื•ืช, ื•ื“ื ืฉื™ืฉ ืœื”ืŸ ืฉื•ืจื•ืช ืžืชื•ืช ืœืฉืื•ื‘, ืื• ืกืชื
ืœื”ื•ืฆื™ื ืื•ืชื ืžื”ืžื‘ื—ืŸ.

ื”ืกื›ื™ืžื” ื‘ืฉื 'information_schema' ืื™ื ื” ื ื›ืœืœืช ื‘ื‘ื“ื™ืงื” ื–ื•, ื›ื˜ื‘ืœืื•ืช ื”ื™ื—ื™ื“ื•ืช ืฉืœื”
ืžื›ื™ืœ ื”ื ืงื˜ื ื™ื ื•ืื™ื ื ืžืฉืชื ื™ื.

ืฉื™ื ืœื‘ ืฉื”ื’ืจืกืื•ืช ื”ืœื 'ืื•ื˜ื•ืžื˜ื™ื•ืช' ื™ื‘ื“ืงื• ื’ื ืืช ื”ื’ืจืกืื•ืช ื”ืื•ื˜ื•ืžื˜ื™ื•ืช. ื‘ืื—ืจ
ืžื™ืœื™ื, ืฉื™ืžื•ืฉ ื‘-last_vacuum ื™ื“ื•ื•ื— ืขืœ ื”ื•ื•ืืงื•ื ื”ืื—ืจื•ืŸ, ื‘ื™ืŸ ืื ื–ื” ื”ื™ื” ื•ืืงื•ื ืจื’ื™ืœ,
ืื• ืื—ื“ ื”ืžื•ืคืขืœ ืขืœ ื™ื“ื™ ื“ืžื•ืŸ ื”ืื•ื˜ื•ื•ื•ืืงื•ื.

ื“ื•ื’ืžื” 1: ื”ืชืจื™ืขื• ืื ืฉื•ืœื—ืŸ ื›ืœืฉื”ื• ืœื ืฉื•ืื‘ ืื‘ืง ื‘ืžืฉืš 3 ื™ืžื™ื, ื•ืชืŸ ืงืจื™ื˜ื™ ื‘-a
ืฉื‘ื•ืข, ืขื‘ื•ืจ ืœืขื ื” ืžืืจื—ืช

check_postgres_last_vacuum --host=ืœืขื ื ื” --warning='3d' --critical='7d'

ื“ื•ื’ืžื” 2: ื–ื”ื” ืœืขื™ืœ, ืื‘ืœ ื“ืœื’ ืขืœ ื˜ื‘ืœืื•ืช ื”ืฉื™ื™ื›ื•ืช ืœืžืฉืชืžืฉื™ื 'ืขืจื‘' ืื• 'ืžืœื•ืจื™'

check_postgres_last_vacuum --host=ืœืขื ื ื” --warning='3d' --critical='7d' --excludeusers=eve,mallory

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ (ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”) ืืช ืคืจืง ื”ื–ืžืŸ ื”ืงื˜ืŸ ื‘ื™ื•ืชืจ ื‘ืฉื ื™ื•ืช ืžืื– ื
ื”ื˜ื‘ืœื” ืฉื•ืื‘ื” ืื• ื ื•ืชื—ื” ืœืื—ืจื•ื ื”. ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืžื—ื–ื™ืจื” ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ื•
ืฉื ื”ื˜ื‘ืœื”.

ืžืื–ื™ืŸ
("Symlink: check_postgres_listener") ืืฉืจ ืฉืžื™ืฉื”ื• ืžืงืฉื™ื‘ ืœืื—ื“ ืื• ื™ื•ืชืจ
ืžื—ืจื•ื–ื•ืช ืกืคืฆื™ืคื™ื•ืช (ื‘ืืžืฆืขื•ืช ืžืขืจื›ืช LISTEN/NOTIFY), ืขืœ ื™ื“ื™ ื”ืชื‘ื•ื ื ื•ืช ื‘ื˜ื‘ืœื” pg_listener.
ื™ืฉ ืฆื•ืจืš ืจืง ื‘ืื—ื“ ืฉืœ ืื–ื”ืจื” ืื• ืงืจื™ื˜ื™. ื”ืคื•ืจืžื˜ ื”ื•ื ืžื—ืจื•ื–ืช ืคืฉื•ื˜ื” ื”ืžื™ื™ืฆื’ืช ืืช
LISTEN target, ืื• ืชื• ื˜ื™ืœื“ื” ื•ืื—ืจื™ื• ืžื—ืจื•ื–ืช ืœื‘ื“ื™ืงืช ื‘ื™ื˜ื•ื™ ืจื’ื™ืœ.
ืฉื™ืžื• ืœื‘ ืฉื‘ื“ื™ืงื” ื–ื• ืœื ืชืขื‘ื•ื“ ืขืœ ื’ืจืกืื•ืช ืฉืœ Postgres 9.0 ื•ืžืขืœื”.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ืื ืืฃ ืื—ื“ ืœื ืžืงืฉื™ื‘ ืœืžื—ืจื•ื–ืช bucardo_mcp_ping ื‘ื™ืฆื™ืื•ืช
5555 ื•5556

check_postgres_listener --port=5555,5556 --warning=bucardo_mcp_ping

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ืื ืื™ืŸ ื‘ืงืฉื•ืช LISTEN ืคืขื™ืœื•ืช ื”ืžืชืื™ืžื•ืช ืœ-'grimm'
ืžืกื“ ื ืชื•ื ื™ื ืื•ืกืงืจ

check_postgres_listener --db oskar --critical=~grimm

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ 1 ืื• 0 ืขืœ ื”ืจืืฉื•ืŸ, ืžืฆื™ื™ืŸ ื”ืฆืœื—ื” ืื• ื›ื™ืฉืœื•ืŸ. ื”ืฉื
ืฉืœ ื”ื”ื•ื“ืขื” ื™ืฉ ืœืกืคืง ื‘ืืžืฆืขื•ืช --mrtg ืื•ึนืคึผึฐืฆึดื™ึธื”.

ืžื ืขื•ืœื™ื
("Symlink: check_postgres_locks") ื‘ื“ื•ืง ืืช ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ืžื ืขื•ืœื™ื ื‘ืื—ื“ ืื• ื™ื•ืชืจ
ืžืกื“ื™ ื ืชื•ื ื™ื. ืื™ืŸ ืฆื•ืจืš ืœื”ืคืขื™ืœ ื–ืืช ื™ื•ืชืจ ืžืคืขื ืื—ืช ื‘ื›ืœ ืืฉื›ื•ืœ ืžืกื“ ื ืชื•ื ื™ื. ืžืกื“ื™ ื ืชื•ื ื™ื ื™ื›ื•ืœื™ื
ืœื”ื™ื•ืช ืžืกื•ื ืŸ ืขื --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™".
ืœืงื‘ืœืช ืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื”ืฉืžื™ื™ื --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื ื™ืชืŸ ืœืฆื™ื™ืŸ ืืคืฉืจื•ื™ื•ืช ื›ืžืกืคืจื™ื ืคืฉื•ื˜ื™ื, ื”ืžื™ื™ืฆื’ื™ื
ื”ืžืกืคืจ ื”ื›ื•ืœืœ ืฉืœ ื”ืžื ืขื•ืœื™ื, ืื• ืฉื ื™ืชืŸ ืœื—ืœืง ืื•ืชื ืœืคื™ ืกื•ื’ ื”ืžื ืขื•ืœ. ืฉืžื•ืช ืžื ืขื•ืœื™ื ื—ื•ืงื™ื™ื
ื”ื 'ืกื”"ื›', 'ืžืžืชื™ืŸ', ืื• ืฉื ืฉืœ ืกื•ื’ ืžื ืขื•ืœ ื”ืžืฉืžืฉ ืืช Postgres. ื”ืฉืžื•ืช ื”ืืœื” ื”ื
ืœื ืจื’ื™ืฉ ืœืื•ืชื™ื•ืช ื’ื“ื•ืœื•ืช ื•ืœื ืฆืจื™ืš ืืช ื”ื—ืœืง ื”"ื ืขื•ืœ" ื‘ืงืฆื”, ืื– ื‘ืœืขื“ื™ ื™ืชืื™ื
'ื ืขืœื” ื‘ืœืขื“ื™ืช'. ื”ืคื•ืจืžื˜ ื”ื•ื ืฉื=ืžืกืคืจ, ืขื ืคืจื™ื˜ื™ื ืฉื•ื ื™ื ืžื•ืคืจื“ื™ื ื‘ืืžืฆืขื•ืช ื ืงื•ื“ืชื™ื™ื ืื•
ื ืงื•ื“ื”-ืคืกื™ืง (ืื• ื›ืœ ืกืžืœ ืื—ืจ).

ื“ื•ื’ืžื” 1: ืื–ื”ืจื” ืื ืžืกืคืจ ื”ืžื ืขื•ืœื™ื ื”ื•ื 100 ืื• ื™ื•ืชืจ, ื•ืงืจื™ื˜ื™ ืื 200 ืื• ื™ื•ืชืจ, ื‘-
ืžืืจื— ื’ืืจื˜

check_postgres_locks --host=garrett --warning=100 --critical=200

ื“ื•ื’ืžื” 2: ื‘-artemus ื”ืžืืจื—, ื”ื–ื”ืจ ืื ืงื™ื™ืžื™ื 200 ืžื ืขื•ืœื™ื ืื• ื™ื•ืชืจ, ื•ืชืŸ ืงืจื™ื˜ื™ ืื
ืงื™ื™ืžื™ื ืœืžืขืœื” ืž-250 ืžื ืขื•ืœื™ื ื‘ืกืš ื”ื›ืœ, ืื• ืื ืงื™ื™ืžื™ื ืœืžืขืœื” ืž-20 ืžื ืขื•ืœื™ื ื‘ืœืขื“ื™ื™ื, ืื• ืื ืœืžืขืœื” ืž-5 ื—ื™ื‘ื•ืจื™ื
ืžื—ื›ื™ื ืœืžื ืขื•ืœ.

check_postgres_locks --host=artemus --warning=200 --critical="total=250:waiting=5:exclusive=20"

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ืžืกืคืจ ื”ืžื ืขื•ืœื™ื ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื•ืืช ื”ืฉื ืฉืœ
ืžืกื“ ื”ื ืชื•ื ื™ื ื‘ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช.

ืงื•ื‘ืฅ ืœื•ื’
("Symlink: check_postgres_logfile") ืžื‘ื˜ื™ื— ืฉืงื•ื‘ืฅ ื”ื™ื•ืžืŸ ื ืžืฆื ื‘ืžื™ืงื•ื ื”ืฆืคื•ื™
ื•ื ืจืฉืžืช ืืœื™ื•. ืคืขื•ืœื” ื–ื• ืžื ืคื™ืงื” ืคืงื•ื“ื” ืฉืžื˜ื™ืœื” ืฉื’ื™ืื” ืขืœ ื›ืœ ืื—ื“ ืžื”ื
ืžืกื“ ื”ื ืชื•ื ื™ื ืฉื”ื•ื ื‘ื•ื“ืง, ื•ืžื‘ื˜ื™ื— ืฉื”ื”ื•ื“ืขื” ืžื•ืคื™ืขื” ื‘ื™ื•ืžื ื™ื. ื–ื” ืกื•ืจืง ืืช
ื”ื’ื“ืจื•ืช log_* ืฉื•ื ื•ืช ื‘ืชื•ืš Postgres ื›ื“ื™ ืœื”ื‘ื™ืŸ ื”ื™ื›ืŸ ื”ื™ื•ืžื ื™ื ืฆืจื™ื›ื™ื ืœื”ื™ื•ืช. ืื ืืชื”
ืžืฉืชืžืฉื™ื ื‘-syslog, ื”ื•ื ืžื‘ืฆืข ืกืจื™ืงื” ื’ืกื” (ืืš ืœื ื—ืกื™ื ืช ืชืงืœื•ืช) ืฉืœ /etc/syslog.conf.
ืœื—ืœื•ืคื™ืŸ, ืืชื” ื™ื›ื•ืœ ืœืกืคืง ืืช ืฉื ืงื•ื‘ืฅ ื”ื™ื•ืžืŸ ืขื ื”- --ืงื•ื‘ืฅ ืœื•ื’ ืื•ึนืคึผึฐืฆึดื™ึธื”. ื–ื”
ืฉื™ืžื•ืฉื™ ื‘ืžื™ื•ื—ื“ ืื ื‘ื™ื•ืžื ื™ื ื™ืฉ ืกื›ื™ืžืช ืกื™ื‘ื•ื‘ ืžื•ืชืืžืช ืื™ืฉื™ืช ื”ืžื•ื ืขืช ืขืœ ื™ื“ื™ ืชื•ื›ื ื™ืช ื—ื™ืฆื•ื ื™ืช.
ื”ืฉืžื™ื™ื --ืงื•ื‘ืฅ ืœื•ื’ ื”ืื•ืคืฆื™ื” ืชื•ืžื›ืช ื‘ืชื•ื•ื™ ื”ื‘ืจื™ื—ื” ื”ื‘ืื™ื: "%Y %m %d %H", ืืฉืจ
ืžื™ื™ืฆื’ื™ื ืืช ื”ืฉื ื”, ื”ื—ื•ื“ืฉ, ื”ืชืืจื™ืš ื•ื”ืฉืขื” ื”ื ื•ื›ื—ื™ื™ื ื‘ื”ืชืืžื”. ืฉื’ื™ืื” ื”ื™ื ืชืžื™ื“
ื“ื•ื•ื— ื›ืงืจื™ื˜ื™ ืืœื ืื ืืคืฉืจื•ืช ื”ืื–ื”ืจื” ื”ื•ืขื‘ืจื” ื›ืขืจืš ืฉืื™ื ื• ืืคืก.
ืžืœื‘ื“ ื”ืฉื™ืžื•ืฉ ื”ืกืคืฆื™ืคื™ ื”ื–ื”, ื”ืืคืฉืจื•ื™ื•ืช "--ืื–ื”ืจื”" ื•-"--ืงืจื™ื˜ื™ื•ืช". ืœึนื be
ืžึฐืฉืื•ึผืžึธืฉื.

ื“ื•ื’ืžื” 1: ื‘ื™ืฆื™ืื” 5432, ื•ื“ื ืฉืงื•ื‘ืฅ ื”ื™ื•ืžืŸ ื ื›ืชื‘ ืœืงื•ื‘ืฅ
/home/greg/pg8.2.log

check_postgres_logfile --port=5432 --logfile=/home/greg/pg8.2.log

ื“ื•ื’ืžื” 2: ื–ื”ื” ืœืขื™ืœ, ืื‘ืœ ื”ืขืœื” ืื–ื”ืจื”, ืœื ืงืจื™ื˜ื™

check_postgres_logfile --port=5432 --logfile=/home/greg/pg8.2.log -w 1

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ 1 ืื• 0 ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื”ืžืฆื™ื™ืŸ ื”ืฆืœื—ื” ืื• ื›ื™ืฉืœื•ืŸ. ื‘
ื‘ืžืงืจื” ืฉืœ ื›ืฉืœ, ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืชืกืคืง ืคืจื˜ื™ื ื ื•ืกืคื™ื ืขืœ ื”ื›ืฉืœ ืฉื ืชืงืœ ื‘ื•.

new_version_bc
("ืงื™ืฉื•ืจ ืกื™ืžืœื™: check_postgres_new_version_bc") ื‘ื•ื“ืง ืื ื’ืจืกื” ื—ื“ืฉื” ื™ื•ืชืจ ืฉืœ ื”ื‘ื•ืงืจื“ื•
ืชื•ื›ื ื™ืช ื–ืžื™ื ื”. ื”ื’ืจืกื” ื”ื ื•ื›ื—ื™ืช ืžืชืงื‘ืœืช ืขืœ ื™ื“ื™ ื”ืคืขืœืช "bucardo_ctl --version".
ืื ื™ืฉ ืฉื“ืจื•ื’ ื’ื“ื•ืœ, ืžื•ื—ื–ืจืช ืื–ื”ืจื”. ืื ืฉื“ืจื•ื’ ื’ืจืกื” ื”ื•ื
ื–ืžื™ืŸ, ืžื•ื—ื–ืจ ืงืจื™ื˜ื™. (ื‘ื•ืงืจื“ื• ื”ื•ื ืื“ื•ืŸ ืœืขื‘ื“, ื•ืื“ื•ืŸ ืœืื“ื•ืŸ
ืžืขืจื›ืช ืฉื›ืคื•ืœ ืขื‘ื•ืจ Postgres: ืจืื” http://bucardo.org ืœืžื™ื“ืข ื ื•ืกืฃ). ืจืื” ื’ื
ื”ืžื™ื“ืข ืขืœ ื”ืืคืฉืจื•ืช "--get_method".

new_version_box
("ืงื™ืฉื•ืจ ืกื™ืžืœื™: check_postgres_new_version_box") ื‘ื•ื“ืง ืื ื’ืจืกื” ื—ื“ืฉื” ื™ื•ืชืจ ืฉืœ ื”-boxinfo
ืชื•ื›ื ื™ืช ื–ืžื™ื ื”. ื”ื’ืจืกื” ื”ื ื•ื›ื—ื™ืช ืžืชืงื‘ืœืช ืขืœ ื™ื“ื™ ื”ืคืขืœืช "boxinfo.pl --version".
ืื ื™ืฉ ืฉื“ืจื•ื’ ื’ื“ื•ืœ, ืžื•ื—ื–ืจืช ืื–ื”ืจื”. ืื ืฉื“ืจื•ื’ ื’ืจืกื” ื”ื•ื
ื–ืžื™ืŸ, ืžื•ื—ื–ืจ ืงืจื™ื˜ื™. (boxinfo ื”ื™ื ืชื•ื›ื ื™ืช ืœืชืคื•ืก ื—ืฉื•ื‘
ืžื™ื“ืข ืžืฉืจืช ื•ื”ื›ื ืกืชื• ืœืคื•ืจืžื˜ HTML: ืจืื”
http://bucardo.org/wiki/boxinfo ืœืžื™ื“ืข ื ื•ืกืฃ). ืจืื” ื’ื ืืช ื”ืžื™ื“ืข ืขืœ
ืืคืฉืจื•ืช "--get_method".

new_version_cp
("Symlink: check_postgres_new_version_cp") ื‘ื•ื“ืง ืื ื’ืจืกื” ื—ื“ืฉื” ื™ื•ืชืจ ืฉืœ ืชื•ื›ื ื™ืช ื–ื•
(check_postgres) ื–ืžื™ืŸ, ืขืœ ื™ื“ื™ ื ื˜ื™ืœืช ื”ื’ืจืกื” ืžืงื•ื‘ืฅ ื˜ืงืกื˜ ืงื˜ืŸ ื‘-main
ืขืžื•ื“ ื”ื‘ื™ืช ืฉืœ ื”ืคืจื•ื™ืงื˜. ืžื—ื–ื™ืจ ืื–ื”ืจื” ืื ื”ื’ืจืกื” ื”ืžื•ื—ื–ืจืช ืœื
ืœื”ืชืื™ื ืœื–ื” ืฉืืชื” ืจืฅ. ื”ืžืจื•ื•ื— ื”ืžื•ืžืœืฅ ืœื‘ื“ื™ืงื” ื”ื•ื ืคืขื ื‘ื™ื•ื. ืจืื” ื’ื ืืช
ืžื™ื“ืข ืขืœ ื”ืืคืฉืจื•ืช "--get_method".

new_version_pg
("Symlink: check_postgres_new_version_pg") ื‘ื•ื“ืง ืื ืงื™ื™ืžืช ื’ืจืกื” ื—ื“ืฉื” ื™ื•ืชืจ ืฉืœ Postgres
ืขื‘ื•ืจ ื›ืœ ืžืกื“ ื ืชื•ื ื™ื ืฉืžื—ื•ื‘ืจ ืืœื™ื•. ืฉื™ื ืœื‘ ืฉื–ื” ืจืง ื‘ื•ื“ืง ืขื“ื›ื•ืŸ, ืœืžืฉืœ ืžืขื‘ืจ ืž
8.3.6 ืขื“ 8.3.7. ืชื™ืงื•ื ื™ื ืชืžื™ื“ ืชื•ืืžื™ื 100% ื‘ื™ื ืืจื™ื™ื ื•ืื™ื ื ื›ื•ืœืœื™ื dump ื•
ืฉื—ื–ืจ ื›ื“ื™ ืœืฉื“ืจื’. ื ืขืฉื• ืชื™ืงื•ื ื™ื ื›ื“ื™ ืœื˜ืคืœ ื‘ื‘ืื’ื™ื, ืœื›ืŸ ืฉื“ืจื•ื’ ื‘ื”ืงื“ื ื”ืืคืฉืจื™
ืชืžื™ื“ ืžื•ืžืœืฅ. ืžื—ื–ื™ืจ ืื–ื”ืจื” ืื ืื™ืŸ ืœืš ืืช ื”ื’ืจืกื” ื”ืื—ืจื•ื ื”. ื–ื”
ืžื•ืžืœืฅ ืœื‘ืฆืข ื‘ื“ื™ืงื” ื–ื• ืœืคื—ื•ืช ืคืขื ื‘ื™ื•ื. ืจืื” ื’ื ืืช ื”ืžื™ื“ืข ืขืœ
ืืคืฉืจื•ืช "--get_method".

new_version_tnm
("symlink: check_postgres_new_version_tnm") ื‘ื•ื“ืง ืื ื’ืจืกื” ื—ื“ืฉื” ื™ื•ืชืจ ืฉืœ ื”-tail_n_mail
ืชื•ื›ื ื™ืช ื–ืžื™ื ื”. ื”ื’ืจืกื” ื”ื ื•ื›ื—ื™ืช ืžืชืงื‘ืœืช ืขืœ ื™ื“ื™ ื”ืคืขืœืช "tail_n_mail --version".
ืื ื™ืฉ ืฉื“ืจื•ื’ ื’ื“ื•ืœ, ืžื•ื—ื–ืจืช ืื–ื”ืจื”. ืื ืฉื“ืจื•ื’ ื’ืจืกื” ื”ื•ื
ื–ืžื™ืŸ, ืžื•ื—ื–ืจ ืงืจื™ื˜ื™. (tail_n_mail ื”ื•ื ื›ืœื™ ื ื™ื˜ื•ืจ ื™ื•ืžืŸ ืฉื™ื›ื•ืœ ืœืฉืœื•ื—
ื“ื•ืืจ ื›ืืฉืจ ืื™ืจื•ืขื™ื ืžืขื ื™ื™ื ื™ื ืžื•ืคื™ืขื™ื ื‘ื™ื•ืžื ื™ Postgres ืฉืœืš. ืœึดืจึฐืื•ึนืช:
http://bucardo.org/wiki/Tail_n_mail ืœืžื™ื“ืข ื ื•ืกืฃ). ืจืื” ื’ื ืืช ื”ืžื™ื“ืข ืขืœ
ื”ืืคืฉืจื•ืช "--get_method".

pgb_pool_cl_active
pgb_pool_cl_waiting
pgb_pool_sv_active
pgb_pool_sv_idle
pgb_pool_sv_used
pgb_pool_sv_tested
pgb_pool_sv_login
pgb_pool_maxwait
(ืงื™ืฉื•ืจื™ื ืกื™ืžืœื™ื™ื: "check_postgres_pgb_pool_cl_active", "check_postgres_pgb_pool_cl_waiting",
"check_postgres_pgb_pool_sv_active", "check_postgres_pgb_pool_sv_idle",
"check_postgres_pgb_pool_sv_used", "check_postgres_pgb_pool_sv_tested",
"check_postgres_pgb_pool_sv_login", ื•-"check_postgres_pgb_pool_maxwait")

ื‘ื•ื—ืŸ ืืช ืกื˜ื˜ื™ืกื˜ื™ืงืช ื”ื‘ืจื™ื›ื” ืฉืœ pgbouncer. ืœื›ืœ ื‘ืจื™ื›ื” ื™ืฉ ืงื‘ื•ืฆื” ืฉืœ ื—ื™ื‘ื•ืจื™ "ืœืงื•ื—",
ื”ื›ื•ื•ื ื” ืœื—ื™ื‘ื•ืจื™ื ืžืœืงื•ื—ื•ืช ื—ื™ืฆื•ื ื™ื™ื, ื•ื—ื™ื‘ื•ืจื™ "ืฉืจืช", ื”ื›ื•ื•ื ื”
ื—ื™ื‘ื•ืจื™ื ืœ-PostgreSQL ืขืฆืžื•. ื”ืคืขื•ืœื•ืช ื”ืงืฉื•ืจื•ืช ืœ-check_postgres ืžื•ืคื™ืขื•ืช ื‘ืงื™ื“ื•ืžืช "cl_"
ื•-"sv_", ื‘ื”ืชืืžื”. ื—ื™ื‘ื•ืจื™ ืœืงื•ื— ืคืขื™ืœื™ื ื”ื ืื•ืชื ื—ื™ื‘ื•ืจื™ื ื”ืžืงื•ืฉืจื™ื ื›ืขืช
ืขื ื—ื™ื‘ื•ืจ ืฉืจืช ืคืขื™ืœ. ื—ื™ื‘ื•ืจื™ ืœืงื•ื—ื•ืช ืขืฉื•ื™ื™ื ื’ื ืœื”ื™ื•ืช "ืžืžืชื™ื ื™ื", ื›ืœื•ืžืจ ื”ื
ืขื“ื™ื™ืŸ ืœื ื”ื•ืงืฆื” ืœื”ื ื—ื™ื‘ื•ืจ ืœืฉืจืช. ื—ื™ื‘ื•ืจื™ ื”ืฉืจืช "ืคืขื™ืœื™ื" (ืžืงื•ืฉืจื™ื
ืœืœืงื•ื—), "ื‘ื˜ืœื”" (ืขืžื™ื“ื” ืœื—ื™ื‘ื•ืจ ืœืงื•ื— ืœืงืฉืจ ืื™ืชื•), "ืžืฉื•ืžืฉ" (ืกืชื
ืžื ื•ืชืง ืžืœืงื•ื—, ื•ืขื“ื™ื™ืŸ ืœื ื”ื•ื—ื–ืจ ืœืžืื’ืจ ื”ื‘ื˜ืœื”), "ื ื‘ื“ืง" (ื ืžืฆื ื›ืจื’ืข
ื ื‘ื“ืง) ื•"ื›ื ื™ืกื”" (ื‘ืชื”ืœื™ืš ื”ื”ืชื—ื‘ืจื•ืช). ืขืจืš maxwait ืžืจืื” ื›ืžื” ื–ืžืŸ ืคื ื™ืžื”
ืฉื ื™ื•ืช ื—ื™ื‘ื•ืจ ื”ืœืงื•ื— ื”ืžืžืชื™ืŸ ื”ื™ืฉืŸ ื‘ื™ื•ืชืจ ื—ื™ื›ื”.

pgbouncer_backends
("Symlink: check_postgres_pgbouncer_backends") ื‘ื•ื“ืง ืืช ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ื”ื ื•ื›ื—ื™
ืขื‘ื•ืจ ืžืกื“ ื ืชื•ื ื™ื ืื—ื“ ืื• ื™ื•ืชืจ ื‘ืืžืฆืขื•ืช pgbouncer, ื•ืื•ืคืฆื™ื•ื ืœื™ ืžืฉื•ื•ื” ืื•ืชื• ืœืžืงืกื™ืžื•ื
ืžื•ืชืจ, ืืฉืจ ื ืงื‘ืข ืขืœ ื™ื“ื™ ืžืฉืชื ื” ื”ืชืฆื•ืจื” pgbouncer max_client_conn. ื”
--ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ื™ื›ื•ืœื•ืช ืœืœื‘ื•ืฉ ืื—ืช ืžืฉืœื•ืฉ ืฆื•ืจื•ืช. ืจืืฉื™ืช, ืžืกืคืจ ืคืฉื•ื˜ ื™ื›ื•ืœ
ืœื”ื™ื•ืช ื ืชื•ืŸ, ื”ืžื™ื™ืฆื’ ืืช ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ืฉื‘ื”ื ืชื™ื ืชืŸ ื”ื”ืชืจืื”.
ื‘ื—ื™ืจื” ื–ื• ืื™ื ื” ืžืฉืชืžืฉืช ื‘- max_connections ื”ื’ื“ืจื”. ืฉื ื™ืช, ืื—ื•ื– ื”ืคื ื•ื™
ื ื™ืชืŸ ืœืชืช ืงืฉืจื™ื. ืฉืœื™ืฉื™ืช, ื ื™ืชืŸ ืœืชืช ืžืกืคืจ ืฉืœื™ืœื™ ื”ืžื™ื™ืฆื’ ืืช
ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ืฉื ื•ืชืจื• ืขื“ max_connections ืžื’ื™ืข. ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ืขื‘ื•ืจ
--ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื”ื '90%' ื•-'95%'. ืืชื” ื™ื›ื•ืœ ื’ื ืœืกื ืŸ ืืช ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘
ืžื” ื”ื™ื --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื›ื“ื™ ืœื”ืฆื™ื’ ืจืง ืชื”ืœื™ื›ื™ื ืฉืื™ื ื ืคืขื™ืœื™ื, ืืชื” ื™ื›ื•ืœ ืœื”ืฉืชืžืฉ ื‘- --ื ื•ื“ืœ ื˜ึทืขึฒื ึธื”. ืฉื™ื ืœื‘ ืฉื”ืžืฉืชืžืฉ ืืชื”
ืžืชื—ื‘ืจื™ื ื›ื™ ื”ื ื—ื™ื™ื‘ื™ื ืœื”ื™ื•ืช ืžืฉืชืžืฉ-ืขืœ ื›ื“ื™ ืฉื–ื” ื™ืขื‘ื•ื“ ื›ืžื• ืฉืฆืจื™ืš.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ื›ืืฉืจ ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ื‘-quirm ื”ืžืืจื— ืžื’ื™ืข ืœ-120, ื•-
ืงืจื™ื˜ื™ ืื ื”ื•ื ืžื’ื™ืข ืœ-150.

check_postgres_pgbouncer_backends --host=quirm --warning=120 --critical=150 -p 6432 -u pgbouncer

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ื›ืืฉืจ ื ื’ื™ืข ืœ-75% ืžื”ื’ื“ืจืช max_connections ืฉืœื ื• ื‘ืžืืจื—ื™ื
lancre ืื• lancre2.

check_postgres_pgbouncer_backends --warning='75%' --critical='75%' --host=lancre,lancre2 -p 6432 -u pgbouncer

ื“ื•ื’ืžื” 3: ืชืŸ ืื–ื”ืจื” ื›ืืฉืจ ื ื•ืชืจื• ืจืง 10 ื—ืจื™ืฆื™ ื—ื™ื‘ื•ืจ ื ื•ืกืคื™ื ื‘ืžืืจื—
ืคืœืกืžื™ื“, ื•ืงืจื™ื˜ื™ ื›ืฉื ื•ืชืจื• ืœื ื• ืจืง 5.

check_postgres_pgbouncer_backends --warning=-10 --critical=-5 --host=plasmid -p 6432 -u pgbouncer

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ืžื“ื•ื•ื— ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื” ื•ื”ืจื‘ื™ืขื™ืช
line ื ื•ืชืŸ ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื, ื‘ืชื•ืกืคืช ื”-max_client_conn ื”ื ื•ื›ื—ื™. ืื ื™ื•ืชืจ ืžืื—ื“
ืžืกื“ ื”ื ืชื•ื ื™ื ื ืฉืืœ, ื–ื” ืขื ืžืกืคืจ ื”ื—ื™ื‘ื•ืจื™ื ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ื”ื•ื ืคืœื˜.

pgbouncer_checksum
("Symlink: check_postgres_pgbouncer_checksum") ื‘ื•ื“ืง ืฉื›ืœ ื”ื”ื’ื“ืจื•ืช ืฉืœ pgBouncer ื”ืŸ
ื–ื”ื” ืœืคืขื ื”ืื—ืจื•ื ื” ืฉื‘ื“ืงืช. ื–ื” ื ืขืฉื” ืขืœ ื™ื“ื™ ื”ืคืงืช ืกื›ื•ื ื‘ื™ืงื•ืจืช ืฉืœ ืจืฉื™ืžื” ืžืžื•ื™ื ืช
ืฉืœ ืงื‘ื™ืขืช ืฉืžื•ืช ื•ืขืจื›ื™ื”ื. ืฉื™ื ืœื‘ ืฉืืชื” ืœื ืฆืจื™ืš ืœืฆื™ื™ืŸ ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื, ื–ื”
ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ืชื”ื™ื” ืื•ื˜ื•ืžื˜ื™ืช ืœ-pgbouncer. ืื• ืืช --ืึทื–ื”ึธืจึธื” ืื• --ืงืจื™ื˜ื™ ืื•ึนืคึผึฐืฆึดื™ึธื”
ืฆืจื™ืš ืœืชืช, ืื‘ืœ ืœื ืืช ืฉื ื™ื”ื. ื”ืขืจืš ืฉืœ ื›ืœ ืื—ื“ ืžื”ื ื”ื•ื ืกื›ื•ื ื”ื‘ื“ื™ืงื”, 32 ืชื•ื•ื™ื
ืขืจืš ื”ืงืกื“ืฆื™ืžืœื™. ืืชื” ื™ื›ื•ืœ ืœืจื•ืฅ ืขื ื”ืืคืฉืจื•ืช ื”ืžื™ื•ื—ื“ืช "--critical=0" ื›ื“ื™ ืœื’ืœื•ืช
ืกื›ื•ื ื‘ื“ื™ืงื” ืงื™ื™ื.

ืคืขื•ืœื” ื–ื• ื“ื•ืจืฉืช ืืช ื”ืžื•ื“ื•ืœ Digest::MD5.

ื“ื•ื’ืžื” 1: ืžืฆื ืืช ืกื›ื•ื ื”ื‘ื“ื™ืงื” ื”ืจืืฉื•ื ื™ ืขื‘ื•ืจ ืชืฆื•ืจืช pgbouncer ื‘ื™ืฆื™ืื” 6432 ื‘ืืžืฆืขื•ืช ื”-
ืžืฉืชืžืฉ ื‘ืจื™ืจืช ืžื—ื“ืœ (ื‘ื“ืจืš ื›ืœืœ postgres)

check_postgres_pgbouncer_checksum --port=6432 --critical=0

ื“ื•ื’ืžื” 2: ื•ื“ื ืฉืฉื•ื ื”ื’ื“ืจื•ืช ืœื ื”ืฉืชื ื• ื•ื”ื–ื”ื™ืจ ืื ื›ืŸ, ื‘ืืžืฆืขื•ืช ืกื›ื•ื ื”ื‘ื“ื™ืงื” ืž
ืžึตืขึทืœ.

check_postgres_pgbouncer_checksum --port=6432 --warning=cd2f3b5e129dc2b4f5c0f6d8d2e64231

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ 1 ืื• 0 ื”ืžืฆื‘ื™ืข ืขืœ ื”ืฆืœื—ื” ืฉืœ ื›ื™ืฉืœื•ืŸ ื‘ื”ืชืืžื” ืฉืœ ืกื›ื•ื ื”ื‘ื“ื™ืงื”.
ื™ืฉ ืœืกืคืง ืกื›ื•ื ื‘ื™ืงื•ืจืช ื›ืืจื’ื•ืžื ื˜ "--mrtg". ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืชืžื™ื“ ื ื•ืชื ืช ืืช ื”
ืกื›ื•ื ื‘ื“ื™ืงื” ื ื•ื›ื—ื™.

pgagent_jobs
("Symlink: check_postgres_pgagent_jobs") ื‘ื•ื“ืง ืฉื›ืœ ื”ืžืฉืจื•ืช ืฉืœ pgAgent ืฉื™ืฉ ืœื”ืŸ
ืฉื‘ื•ืฆืขื• ื‘ืžืจื•ื•ื— ื”ื–ืžืŸ ื”ืงื•ื“ื ื”ืฆืœื™ื—ื•. ื–ื” ื ืขืฉื” ืขืœ ื™ื“ื™ ื‘ื“ื™ืงื” ืขื‘ื•ืจ
ื›ืœ ื”ืฉืœื‘ื™ื ืฉื™ืฉ ืœื”ื ืชื•ืฆืื” ืฉืื™ื ื” ืืคืก.

ื ื™ืชืŸ ืœืฆื™ื™ืŸ "--ืื–ื”ืจื”" ืื• "--ืงืจื™ื˜ื™", ืื• ืฉื ื™ื”ื, ื›ื–ืžื ื™ื, ื•ื”ืขื‘ื•ื“ื•ืช ื™ื”ื™ื•
ื ื‘ื“ืง ืขื‘ื•ืจ ื›ืฉืœื™ื ื‘ืชื•ืš ืคืจืงื™ ื”ื–ืžืŸ ืฉืฆื•ื™ื ื• ืœืคื ื™ ื”ืฉืขื” ื”ื ื•ื›ื—ื™ืช. ืชึธืงึตืฃ
ื™ื—ื™ื“ื•ืช ื”ืŸ ืฉื ื™ื•ืช, ื“ืงื•ืช, ืฉืขื•ืช ื•ื™ืžื™ื; ื ื™ืชืŸ ืœืงืฆืจ ืืช ื›ื•ืœื ืœืื•ืช ื”ืจืืฉื•ื ื”.
ืื ืœื ื ื™ืชื ื•ืช ื™ื—ื™ื“ื•ืช, ืžื ื™ื—ื™ื 'ืฉื ื™ื•ืช'.

ื“ื•ื’ืžื” 1: ืชืŸ ืงืจื™ื˜ื™ ื›ืืฉืจ ื›ืœ ืขื‘ื•ื“ื•ืช ืฉื‘ื•ืฆืขื• ื‘ื™ืžืžื” ื”ืื—ืจื•ื ื” ื ื›ืฉืœื•.

check_postgres_pgagent_jobs --critical=1d

ื“ื•ื’ืžื” 2: ืชืŸ ืื–ื”ืจื” ื›ืืฉืจ ื›ืœ ืขื‘ื•ื“ื•ืช ืฉื‘ื•ืฆืขื• ื‘ืฉื‘ื•ืข ื”ืื—ืจื•ืŸ ื ื›ืฉืœื•.

check_postgres_pgagent_jobs --warning=7d

ื“ื•ื’ืžื” 3: ืชืŸ ืงืจื™ื˜ื™ ืขื‘ื•ืจ ืขื‘ื•ื“ื•ืช ืฉื ื›ืฉืœื• ื‘-2 ื”ืฉืขื•ืช ื”ืื—ืจื•ื ื•ืช ื•ืื–ื”ืจื” ืขื‘ื•ืจ
ืขื‘ื•ื“ื•ืช ืฉื ื›ืฉืœื• ื‘-4 ื”ืฉืขื•ืช ื”ืื—ืจื•ื ื•ืช:

check_postgres_pgagent_jobs --critical=2h --warning=4h

ready_txns
("ืงื™ืฉื•ืจ ืกื™ืžืœื™: check_postgres_prepared_txns") ื‘ื“ื•ืง ืืช ื”ื’ื™ืœ ืฉืœ ื›ืœ ืžื•ื›ืŸ ืงื™ื™ื
ืขืกืงืื•ืช. ืฉื™ืžื• ืœื‘ ืฉืจื•ื‘ ื”ืื ืฉื™ื ืœื ื™ืฉืชืžืฉื• ื‘ืขืกืงืื•ืช ืžื•ื›ื ื•ืช, ืžื›ื™ื•ื•ืŸ ืฉื”ืŸ ื—ืœืง
ืžื—ื•ื™ื‘ื•ืช ื“ื•-ื—ืœืงื™ืช ื•ืžืกื•ื‘ื›ืช ืœืชื—ื–ื•ืงื”. ืืกื•ืจ ื’ื ืœื‘ืœื‘ืœ ื‘ื™ื ื™ื”ื
ื”ืฆื”ืจื•ืช ืžื•ื›ื ื•ืช, ื•ื–ื” ืžื” ืฉืจื•ื‘ ื”ืื ืฉื™ื ื—ื•ืฉื‘ื™ื ืขืœื™ื• ื›ืฉื”ื ืฉื•ืžืขื™ื ืœื”ื›ื™ืŸ. ื”
ืขืจืš ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ืœืื–ื”ืจื” ื”ื•ื ืฉื ื™ื™ื” ืื—ืช, ื›ื“ื™ ืœื–ื”ื•ืช ื›ืœ ืฉื™ืžื•ืฉ ื‘ืขืกืงืื•ืช ืžื•ื›ื ื•ืช, ืืฉืจ
ื–ื• ื›ื ืจืื” ื˜ืขื•ืช ื‘ืจื•ื‘ ื”ืžืขืจื›ื•ืช. ืื–ื”ืจื” ื•ืงืจื™ื˜ื™ ื”ื ืžืกืคืจ ื”ืฉื ื™ื•ืช ื
ืขืกืงื” ืžื•ื›ื ื” ื ืคืชื—ื” ืœืคื ื™ ืžืชืŸ ื”ืชืจืื”.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ืขืœ ื–ื™ื”ื•ื™ ืขืกืงืื•ืช ืžื•ื›ื ื•ืช:

check_postgres_prepared_txns -w 0

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ืื ืขืกืงื” ืžื•ื›ื ื” ื”ื™ื™ืชื” ืคืชื•ื—ื” ื™ื•ืชืจ ืž-10
ืฉื ื™ื•ืช, ืืš ืืคืฉืจ ืขื“ 360 ืฉื ื™ื•ืช ืขื‘ื•ืจ ืžืกื“ ื”ื ืชื•ื ื™ื 'shrike':

check_postgres_prepared_txns --critical=10 --exclude=shrike
check_postgres_prepared_txns --critical=360 --include=shrike

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ืžืกืคืจ ื”ืฉื ื™ื•ืช ืฉื”ืขืกืงื” ื”ื™ืฉื ื” ื‘ื™ื•ืชืจ ื”ื™ื™ืชื” ืคืชื•ื—ื” ื‘ืชื•ืจ
ื”ืฉื•ืจื” ื”ืจืืฉื•ื ื”, ื•ืžืื™ื–ื” ืžืกื“ ื ืชื•ื ื™ื ื”ื’ื™ืข ื‘ืชื•ืจ ื”ืฉื•ืจื” ื”ืื—ืจื•ื ื”.

query_runtime
("symlink: check_postgres_query_runtime") ื‘ื•ื“ืง ื›ืžื” ื–ืžืŸ ืœื•ืงื— ืฉืื™ืœืชื” ืกืคืฆื™ืคื™ืช ืœืจื•ืฅ,
ืขืœ ื™ื“ื™ ื‘ื™ืฆื•ืข "ื”ืกื‘ืจ ื ื™ืชื•ื—" ื ื’ื“ื•. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ื”ืŸ
ืžืฉืš ื”ื–ืžืŸ ื”ืžืงืกื™ืžืœื™ ืฉื”ืฉืื™ืœืชื” ืฆืจื™ื›ื” ืœืงื—ืช. ื™ื—ื™ื“ื•ืช ืชืงืคื•ืช ื”ืŸ ืฉื ื™ื•ืช, ื“ืงื•ืช ื•ืฉืขื•ืช;
ื ื™ืชืŸ ืœืงืฆืจ ื›ืœ ืื—ื“ ืœืื•ืช ื”ืจืืฉื•ื ื”. ืื ืœื ื ื™ืชื ื•ืช ื™ื—ื™ื“ื•ืช, ืžื ื™ื—ื™ื 'ืฉื ื™ื•ืช'.
ื™ืฉ ืœืชืช ื’ื ืืช ื”ืื–ื”ืจื” ื•ื’ื ืืช ื”ืืคืฉืจื•ืช ื”ืงืจื™ื˜ื™ืช. ืฉื ื”ืชืฆื•ื’ื” ืื• ื”ืคื•ื ืงืฆื™ื”
ื›ื“ื™ ืœื”ืคืขื™ืœ ื™ืฉ ืœื”ืขื‘ื™ืจ ืœ- --ืฉื ืฉืื™ืœืชื” ืื•ึนืคึผึฐืฆึดื™ึธื”. ื–ื” ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžื•ืจื›ื‘ ืžืžื™ืœื” ืื—ืช
(ืื• schema.word), ืขื ืขื•ืชืงื™ื ืื•ืคืฆื™ื•ื ืœื™ื™ื ื‘ืกื•ืฃ.

ื“ื•ื’ืžื” 1: ืชืŸ ืงืจื™ื˜ื™ ืื ื”ืคื•ื ืงืฆื™ื” ื‘ืฉื "speedtest" ืœื ืžืฆืœื™ื—ื” ืœืคืขื•ืœ ืชื•ืš 10 ืฉื ื™ื•ืช ืื•
ืคึผึธื—ื•ึผืช.

check_postgres_query_runtime --queryname='speedtest()' --critical=10 --warning=10

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื“ื•ื•ื— ืขืœ ื”ื–ืžืŸ ื‘ืฉื ื™ื•ืช ืขื“ ืœื”ืฉืœืžืช ื”ืฉืื™ืœืชื” ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”.
ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืžืคืจื˜ืช ืืช ืžืกื“ ื”ื ืชื•ื ื™ื.

ืฉืื™ืœืชื”_ื–ืžืŸ
("Symlink: check_postgres_query_time") ื‘ื•ื“ืง ืืช ืžืฉืš ื”ืฉืื™ืœืชื•ืช ื”ืจืฆื•ืช ื‘ืื—ืช ืื• ื™ื•ืชืจ
ืžืกื“ื™ ื ืชื•ื ื™ื. ืื™ืŸ ืฆื•ืจืš ืœื”ืคืขื™ืœ ืืช ื–ื” ื™ื•ืชืจ ืžืคืขื ืื—ืช ืขืœ ืื•ืชื• ืืฉื›ื•ืœ ืžืกื“ ื ืชื•ื ื™ื. ื”ืขืจื”
ืฉื–ื” ื›ื‘ืจ ืœื ื›ื•ืœืœ ืฉืื™ืœืชื•ืช ืฉื”ืŸ "ื‘ื˜ืœื•ืช ื‘ืขืกืงื”". ืžืกื“ื™ ื ืชื•ื ื™ื ื™ื›ื•ืœื™ื ืœื”ื™ื•ืช
ืžืกื•ื ืŸ ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘- --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™".
ืœืคืจื˜ื™ื ื ื•ืกืคื™ื. ืืชื” ื™ื›ื•ืœ ื’ื ืœืกื ืŸ ืขืœ ื”ืžืฉืชืžืฉ ืฉืžืคืขื™ืœ ืืช ื”ืฉืื™ืœืชื” ืขื ื” --includeuser
ื• --excludeuser ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ืฉื ืžืฉืชืžืฉ" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื”ืขืจื›ื™ื ืขื‘ื•ืจ --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื”ืืคืฉืจื•ื™ื•ืช ื”ืŸ ื›ืžื•ื™ื•ืช ื–ืžืŸ, ื•ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื™ื '2
ื“ืงื•ืช' ื•-'5 ื“ืงื•ืช' ื‘ื”ืชืืžื”. ื™ื—ื™ื“ื•ืช ื—ื•ืงื™ื•ืช ื”ืŸ 'ืฉื ื™ื•ืช', 'ื“ืงื•ืช', 'ืฉืขื•ืช' ืื•
'ื™ืžื™ื'. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื›ืชื‘ ื‘ื™ื—ื™ื“ ืื• ื‘ืงื™ืฆื•ืจ ืœืื•ืช ื”ืจืืฉื•ื ื” ื‘ืœื‘ื“. ืื ืื™ืŸ ื™ื—ื™ื“ื•ืช
ื ื™ืชื ื™ื, ื”ื”ื ื—ื” ื”ื™ื ืฉื”ื™ื—ื™ื“ื” ื”ื™ื ืฉื ื™ื•ืช.

ืคืขื•ืœื” ื–ื• ื“ื•ืจืฉืช Postgres 8.1 ื•ืžืขืœื”.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ืื ืฉืื™ืœืชื” ื›ืœืฉื”ื™ ืจืฆื” ื™ื•ืชืจ ืž-3 ื“ืงื•ืช, ื•ื›ืŸ ื
ืงืจื™ื˜ื™ ืื ื™ื•ืชืจ ืž-5 ื“ืงื•ืช.

check_postgres_query_time --port=5432 --warning='3 ื“ืงื•ืช' --critical='5 ื“ืงื•ืช'

ื“ื•ื’ืžื” 2: ื‘ืืžืฆืขื•ืช ืขืจื›ื™ ื‘ืจื™ืจืช ืžื—ื“ืœ (2 ื•-5 ื“ืงื•ืช), ื‘ื“ื•ืง ืืช ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืžืœื‘ื“ ืืœื”
ืžืชื—ื™ืœ ื‘'ืชื‘ื ื™ืช'.

check_postgres_query_time --port=5432 --exclude=~^ืชื‘ื ื™ืช

ื“ื•ื’ืžื” 3: ืื–ื”ืจื” ืื ืœืžืฉืชืžืฉ 'don' ื™ืฉ ืฉืื™ืœืชื” ืฉืคื•ืขืœืช ืžืขืœ 20 ืฉื ื™ื•ืช

check_postgres_query_time --port=5432 --includeuser=don --warning=20s

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ืื•ืจืš ื‘ืฉื ื™ื•ืช ืฉืœ ื”ืฉืื™ืœืชื” ื”ืจืฆื” ื”ื›ื™ ืืจื•ื›ื” ื‘ืฉืื™ืœืชื” ื”ืจืืฉื•ื ื”
ืงึทื•. ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ื ื•ืชื ืช ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื.

replicate_row
("Symlink: check_postgres_replicate_row") ื‘ื•ื“ืง ืฉืฉื›ืคื•ืœ ืžืืกื˜ืจ-ืขื‘ื“ ืขื•ื‘ื“
ืœืขื‘ื“ ืื—ื“ ืื• ื™ื•ืชืจ.

ื”ืืคืฉืจื•ื™ื•ืช ื”ืจืืฉื•ื ื•ืช "--dbname", "--host" ื•-"--port" ื•ื›ื•' ื ื—ืฉื‘ื•ืช ืœืžืืกื˜ืจ;
ื”ืฉื™ืžื•ืฉื™ื ื”ื‘ืื™ื ื”ื ื”ืขื‘ื“ื™ื. ื”ืขืจื›ื™ื ืื• ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื”ืืคืฉืจื•ื™ื•ืช ื”ืŸ
ื™ื—ื™ื“ื•ืช ื–ืžืŸ, ื•ื™ืฉ ืœืกืคืง ืœืคื—ื•ืช ืื—ืช (ืœืœื ื‘ืจื™ืจืช ืžื—ื“ืœ). ื™ื—ื™ื“ื•ืช ื—ื•ืงื™ื•ืช ื”ืŸ 'ืฉื ื™ื•ืช',
'ื“ืงื•ืช', 'ืฉืขื•ืช' ืื• 'ื™ืžื™ื'. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื›ืชื‘ ื‘ื™ื—ื™ื“ ืื• ื‘ืงื™ืฆื•ืจ ืœ-
ืžื›ืชื‘ ืจืืฉื•ืŸ. ืื ืœื ื ื™ืชื ื•ืช ื™ื—ื™ื“ื•ืช, ื”ื”ื ื—ื” ื”ื™ื ืฉื”ื™ื—ื™ื“ื•ืช ื”ืŸ ืฉื ื™ื•ืช.

ื‘ื“ื™ืงื” ื–ื• ืžืขื“ื›ื ืช ืฉื•ืจื” ื‘ื•ื“ื“ืช ื‘ืžืืกื˜ืจ, ื•ืœืื—ืจ ืžื›ืŸ ืžื•ื“ื“ืช ื›ืžื” ื–ืžืŸ ืœื•ืงื— ืœื”
ื—ืœ ืขืœ ื”ืขื‘ื“ื™ื. ืœืฉื ื›ืš, ืขืœื™ืš ืœื‘ื—ื•ืจ ื˜ื‘ืœื” ืฉืขื•ื‘ืจืช ืฉื›ืคื•ืœ
ืžืฆื ืฉื•ืจื” ืฉื ื™ืชืŸ ืœืฉื ื•ืช, ื•ืœื ืขื•ืžื“ืช ืœื”ืฉืชื ื•ืช ื‘ืฉื•ื ืชื”ืœื™ืš ืื—ืจ. ื
ืขืžื•ื“ื” ืกืคืฆื™ืคื™ืช ื‘ืฉื•ืจื” ื–ื• ืชืฉืชื ื” ืžืขืจืš ืื—ื“ ืœืžืฉื ื”ื•. ื›ืœ ื–ื” ื ื™ื–ื•ืŸ
ืœืืคืฉืจื•ืช "repinfo", ื•ืขืœื™ื• ืœื”ื›ื™ืœ ืืช ื”ืืคืฉืจื•ื™ื•ืช ื”ื‘ืื•ืช, ืžื•ืคืจื“ื•ืช ื‘ืคืกื™ืงื™ื:
ืฉื ื˜ื‘ืœื”, ืžืคืชื— ืจืืฉื™, ืžื–ื”ื” ืžืคืชื—, ืขืžื•ื“ื”, ืขืจืš ืจืืฉื•ืŸ, ืขืจืš ืฉื ื™.

ื“ื•ื’ืžื” 1: ืกืœื•ื ื™ ืžืฉื›ืคืœ ื˜ื‘ืœื” ื‘ืฉื 'ื”ื–ืžื ื•ืช' ืžื”ืžืืจื— 'ืืœืคื' ืœืืจื— 'ื‘ื˜ื',
ื‘ืžืกื“ ื”ื ืชื•ื ื™ื 'ืžื›ื™ืจื•ืช'. ื”ืžืคืชื— ื”ืจืืฉื™ ืฉืœ ื”ื˜ื‘ืœื” ื ืงืจื id, ื•ืื ื—ื ื• ื”ื•ืœื›ื™ื ืœืขืฉื•ืช ื–ืืช
ื‘ื“ื•ืง ืืช ื”ืฉื•ืจื” ืขื ืžื–ื”ื” ืฉืœ 3 (ืฉื”ื•ื ื”ื™ืกื˜ื•ืจื™ ื•ืœืขื•ืœื ืœื ื”ืฉืชื ื”). ื™ืฉ ืขืžื•ื“ื”
ื‘ืฉื 'salesrep' ืฉืื ื• ื”ื•ืœื›ื™ื ืœื”ื—ืœื™ืฃ ืžืขืจืš 'slon' ืœ-'nols' ื›ื“ื™ ืœื‘ื“ื•ืง
ื”ืฉื›ืคื•ืœ. ืื ื—ื ื• ืจื•ืฆื™ื ืœื–ืจื•ืง ืื–ื”ืจื” ืื ื”ืฉื›ืคื•ืœ ืœื ืžืชืจื—ืฉ ืชื•ืš 10
ืฉื ื™ื•ืช.

check_postgres_replicate_row --host=alpha --dbname=sales --host=beta
--dbname=sales --warning=10 --repinfo=orders,id,3,salesrep,slon,nols

ื“ื•ื’ืžื” 2: ื‘ื•ืงืจื“ื• ืžืฉื›ืคืœ ื˜ื‘ืœื” ื‘ืฉื 'ืงื‘ืœื”' ืžื”ืžืืจื— 'ื™ืจื•ืง' ืœืžืืจื—ื™ื
'ืื“ื•ื', 'ื›ื—ื•ืœ' ื•'ืฆื”ื•ื‘'. ืžืกื“ ื”ื ืชื•ื ื™ื ืฉืœ ืฉื ื™ ื”ืฆื“ื“ื™ื ื”ื•ื 'ืฆื™ื‘ื•ืจื™'. ืžืกื“ื™ ื”ื ืชื•ื ื™ื ืฉืœ ื”ืขื‘ื“ื™ื
ืคื•ืขืœื™ื ื‘ื™ืฆื™ืื” 5455. ื”ืžืคืชื— ื”ืจืืฉื™ ื ืงืจื 'receipt_id', ื”ืฉื•ืจื” ื‘ื” ืื ื• ืจื•ืฆื™ื ืœื”ืฉืชืžืฉ
ื™ืฉ ืขืจืš ืฉืœ 9, ื•ื”ืขืžื•ื“ื” ืฉืื ื• ืจื•ืฆื™ื ืœืฉื ื•ืช ืขื‘ื•ืจ ื”ื‘ื“ื™ืงื” ื ืงืจืืช 'ืื–ื•ืจ'. ื ื•
ื”ื—ืœืฃ ื‘ื™ืŸ 'ืฆืคื•ืŸ' ืœ'ื“ืจื•ื' ืขื‘ื•ืจ ื”ืขืจืš ืฉืœ ืขืžื•ื“ื” ื–ื•, ื•ื–ืจื•ืง ืื ืงืจื™ื˜ื™
ื”ืฉื™ื ื•ื™ ืื™ื ื• ืขืœ ืฉืœื•ืฉืช ื”ืขื‘ื“ื™ื ืชื•ืš 5 ืฉื ื™ื•ืช.

check_postgres_replicate_row --host=green --port=5455 --host=red,blue,yellow
--critical=5 --repinfo=receipt,receipt_id,9,zone,north,south

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื” ืืช ื”ื–ืžืŸ ื‘ืฉื ื™ื•ืช ืฉืืœื™ื• ืœื•ืงื— ื”ืฉื›ืคื•ืœ
ืกื™ื™ื. ื”ื–ืžืŸ ื”ืžืจื‘ื™ ืžื•ื’ื“ืจ ืœ-4 ื“ืงื•ืช 30 ืฉื ื™ื•ืช: ืื ืœื ื ืžืฉื›ื” ืฉื›ืคื•ืœ
ื‘ืžืงื•ื ื‘ื–ืžืŸ ื”ืืจื•ืš ื”ื–ื”, ื ื–ืจืงืช ืฉื’ื™ืื”.

same_schema
("symlink: check_postgres_same_schema") ืžืืžืช ืฉืฉื ื™ ืžืกื“ื™ ื ืชื•ื ื™ื ืื• ื™ื•ืชืจ ื–ื”ื™ื
ืœื’ื‘ื™ ื”ืกื›ื™ืžื” ืฉืœื”ื (ืื‘ืœ ืœื ื”ื ืชื•ื ื™ื ืฉื‘ืชื•ื›ื•). ื–ื” ืฉื™ืžื•ืฉื™ ื‘ืžื™ื•ื—ื“ ืœื”ื›ื ื”
ื‘ื˜ื•ื— ืฉื”ืขื‘ื“ื™ื ืฉืœืš ืœื ืฉื•ื ื• ืื• ื”ื•ืฉื—ืชื• ื‘ืฉื•ื ืฆื•ืจื” ื‘ืขืช ื”ืฉื™ืžื•ืฉ ืžืืกื˜ืจ ืœืขื‘ื“
ืฉื›ืคื•ืœ. ื‘ื ื™ื’ื•ื“ ืœืจื•ื‘ ื”ืคืขื•ืœื•ืช ื”ืื—ืจื•ืช, ืื™ืŸ ืœื–ื” ืื–ื”ืจื” ืื• ืงืจื™ื˜ืจื™ื•ื ื™ื ืงืจื™ื˜ื™ื™ื - ื”
ืžืกื“ื™ ื ืชื•ื ื™ื ืžืกื•ื ื›ืจื ื™ื ืื• ืฉืœื. ืื ื”ื ืฉื•ื ื™ื, ืจืฉื™ืžื” ืžืคื•ืจื˜ืช ืฉืœ
ืžื•ืฆื’ื™ื ื”ื‘ื“ืœื™ื.

ื™ื™ืชื›ืŸ ืฉืชืจืฆื” ืœื ืœื›ืœื•ืœ ืื• ืœืกื ืŸ ื”ื‘ื“ืœื™ื ืžืกื•ื™ืžื™ื. ื”ื“ืจืš ืœืขืฉื•ืช ื–ืืช ื”ื™ื ืœื”ื•ืกื™ืฃ
ืžื—ืจื•ื–ื•ืช ืœืืคืฉืจื•ืช "--ืคื™ืœื˜ืจ". ื›ื“ื™ ืœื ืœื›ืœื•ืœ ืกื•ื’ ืฉืœ ืื•ื‘ื™ื™ืงื˜, ื”ืฉืชืžืฉ ื‘-"noname", ื›ืืฉืจ 'ืฉื'
ื”ื•ื ืกื•ื’ ื”ืื•ื‘ื™ื™ืงื˜, ืœืžืฉืœ, "noschema". ื›ื“ื™ ืœื”ื•ืฆื™ื ืื•ื‘ื™ื™ืงื˜ื™ื ืžืกื•ื’ ืžืกื•ื™ื ืขืœ ื™ื“ื™ ื
ื‘ื™ื˜ื•ื™ ืจื’ื•ืœืจื™ ื›ื ื’ื“ ืฉืžื, ื”ืฉืชืžืฉ ื‘-"noname=regex". ืจืื” ืืช ื”ื“ื•ื’ืžืื•ืช ืฉืœื”ืœืŸ ืขื‘ื•ืจ ื
ื”ื‘ื ื” ื˜ื•ื‘ื” ื™ื•ืชืจ.

ืกื•ื’ื™ ื”ืื•ื‘ื™ื™ืงื˜ื™ื ืฉื ื™ืชืŸ ืœืกื ืŸ ื›ื•ืœืœื™ื:

ื”ืžืฉืชืžืฉ
ืกื›ื™ืžื”
ืฉื•ืœื—ืŸ
ื ื•ืฃ
ืžื“ื“
ืจืฆืฃ
-
ืœื”ืคืขื™ืœ
ืคื•ื ืงืฆื™ื”

ืืคืฉืจื•ืช ื”ืกื™ื ื•ืŸ "noposition" ืžื•ื ืขืช ืื™ืžื•ืช ืฉืœ ืžื™ืงื•ื ื”ืขืžื•ื“ื•ืช ื‘ืชื•ืš a
ื”ืฉื•ืœื—ืŸ.

ืืคืฉืจื•ืช ื”ืกื™ื ื•ืŸ "nofuncbody" ืžื•ื ืขืช ื”ืฉื•ื•ืื” ื‘ื™ืŸ ื’ื•ืคื™ ื›ืœ ื”ืคื•ื ืงืฆื™ื•ืช.

ืืคืฉืจื•ืช ื”ืกื™ื ื•ืŸ "noperm" ืžื•ื ืขืช ื”ืฉื•ื•ืื” ืฉืœ ื”ืจืฉืื•ืช ืื•ื‘ื™ื™ืงื˜.

ื›ื“ื™ ืœืกืคืง ืืช ืžืกื“ ื”ื ืชื•ื ื™ื ื”ืฉื ื™, ืคืฉื•ื˜ ื”ื•ืกืฃ ืืช ื”ื”ื‘ื“ืœื™ื ืœืžืกื“ ื”ื ืชื•ื ื™ื ื”ืจืืฉื•ืŸ ืขืœ ื™ื“ื™ ืงืจื™ืื” ืืœ
ื˜ื™ืขื•ืŸ ื”ื—ื™ื‘ื•ืจ ื”ืžืชืื™ื. ืœื“ื•ื’ืžื”, ื›ื“ื™ ืœื”ืฉื•ื•ืช ืžืกื“ื™ ื ืชื•ื ื™ื ืขืœ ืžืืจื—ื™ื ืืœืคื ื•
bravo, ื”ืฉืชืžืฉ ื‘-"--dbhost=alpha,bravo". ืจืื” ื’ื ืืช ื”ื“ื•ื’ืžืื•ืช ืฉืœื”ืœืŸ.

ืื ื ื™ืชืŸ ืจืง ืžืืจื— ื‘ื•ื“ื“, ื”ื”ื ื—ื” ื”ื™ื ืฉืื ื• ืขื•ืฉื™ื ื“ื•ื— "ืžื‘ื•ืกืก ื–ืžืŸ". ื”
ื‘ืคืขื ื”ืจืืฉื•ื ื” ื–ื” ืžื•ืคืขืœ ืชืžื•ื ืช ืžืฆื‘ ืฉืœ ื›ืœ ื”ืคืจื™ื˜ื™ื ื‘ืžืกื“ ื”ื ืชื•ื ื™ื ื ืฉืžืจืช ื‘-local
ืงื•ึนื‘ึถืฅ. ื›ืืฉืจ ืืชื” ืžืคืขื™ืœ ืื•ืชื• ืฉื•ื‘, ืชืžื•ื ืช ื”ืžืฆื‘ ื”ื–ื• ื ืงืจืืช ื•ื”ื•ืคื›ืช ืœ"ืžืกื“ ื ืชื•ื ื™ื ืžืก' 2" ื•ื–ื”ื•
ื‘ื”ืฉื•ื•ืื” ืœืžืกื“ ื”ื ืชื•ื ื™ื ื”ื ื•ื›ื—ื™.

ื›ื“ื™ ืœื”ื—ืœื™ืฃ ืืช ื”ืงื•ื‘ืฅ ื”ื™ืฉืŸ ื”ืžืื•ื—ืกืŸ ื‘ื’ืจืกื” ื”ื—ื“ืฉื”, ื”ืฉืชืžืฉ ื‘ืืจื’ื•ืžื ื˜ --replace.

ื›ื“ื™ ืœืืคืฉืจ ืฆื™ืœื•ืžื™ ืžืฆื‘ ื‘ื ืงื•ื“ื•ืช ื–ืžืŸ ืฉื•ื ื•ืช, ืืชื” ื™ื›ื•ืœ ืœื”ืฉืชืžืฉ ื‘ืืจื’ื•ืžื ื˜ "--suffix" ื›ื“ื™ ืœื™ืฆื•ืจ
ืฉืžื•ืช ื”ืงื‘ืฆื™ื ื”ื™ื™ื—ื•ื“ื™ื™ื ืœื›ืœ ื”ืคืขืœื”. ืจืื” ืืช ื”ื“ื•ื’ืžืื•ืช ืœืžื˜ื”.

ื“ื•ื’ืžื” 1: ื•ื“ื ืฉืฉื ื™ ืžืกื“ื™ ื ืชื•ื ื™ื ืขืœ ื›ื•ื›ื‘ ื•ืงื• ืžืืจื—ื™ื ื–ื”ื™ื:

check_postgres_same_schema --dbhost=star,line

ื“ื•ื’ืžื” 2: ื–ื”ื” ืœืงื•ื“ื, ืืš ืืœ ืชื›ืœื•ืœ ื˜ืจื™ื’ืจื™ื ืขื "ืกืœื•ื ื™" ื‘ืฉืžื

check_postgres_same_schema --dbhost=star,line --filter="notrigger=slony"

ื“ื•ื’ืžื” 3: ื–ื”ื” ืœืงื•ื“ื, ืื‘ืœ ื’ื ืืœ ืชื›ืœื•ืœ ืืช ื›ืœ ื”ืื™ื ื“ืงืกื™ื

check_postgres_same_schema --dbhost=star,line --filter="notrigger=slony noindexes"

ื“ื•ื’ืžื” 4: ื‘ื“ื•ืง ื”ื‘ื“ืœื™ื ืขื‘ื•ืจ ืžืกื“ ื”ื ืชื•ื ื™ื "battlestar" ื‘ื™ืฆื™ืื•ืช ืฉื•ื ื•ืช

check_postgres_same_schema --dbname=battlestar --dbport=5432,5544

ื“ื•ื’ืžื” 5: ืฆื•ืจ ืงื•ื‘ืฅ ืชืžื•ื ืช ืžืฆื‘ ื™ื•ืžื™ ื•ืฉื‘ื•ืขื™

check_postgres_same_schema --dbname=cylon --suffix=ื™ื•ืžื™
check_postgres_same_schema --dbname=cylon --suffix=weekly

ื“ื•ื’ืžื” 6: ื”ืคืขืœ ื”ืฉื•ื•ืื” ื”ื™ืกื˜ื•ืจื™ืช, ื•ืœืื—ืจ ืžื›ืŸ ื”ื—ืœืฃ ืืช ื”ืงื•ื‘ืฅ

check_postgres_same_schema --dbname=cylon --suffix=daily --replace

ืจืฆืฃ
("Symlink: check_postgres_sequence") ื‘ื•ื“ืง ื›ืžื” ืžืงื•ื ื ืฉืืจ ื‘ื›ืœ ื”ืจืฆืคื™ื ื‘-
ืžืื’ืจ ืžื™ื“ืข. ื–ื” ื ืžื“ื“ ื›ืื—ื•ื– ืžืกืš ื”ืขืจื›ื™ื ื”ืืคืฉืจื™ื™ื ืฉื ืขืฉื” ื‘ื”ื ืฉื™ืžื•ืฉ
ืขื‘ื•ืจ ื›ืœ ืจืฆืฃ. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ืฆืจื™ื›ื•ืช ืœื”ืชื‘ื˜ื ื›
ืื—ื•ื–ื™ื. ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื 85% ืขื‘ื•ืจ ื”ืื–ื”ืจื” ื• 95% ืขื‘ื•ืจ ื”ืงืจื™ื˜ื™ื™ื. ืืชื” ื™ื›ื•ืœ
ื”ืฉืชืžืฉ ื‘--include ื•--exclude ื›ื“ื™ ืœืฉืœื•ื˜ ื‘ืื™ืœื• ืจืฆืคื™ื ื™ืฉ ืœื‘ื“ื•ืง. ืฉื™ืžื• ืœื‘ ืฉื–ื”
ืฆ'ืง ืื›ืŸ ืžืกื‘ื™ืจ ื—ืจื™ื’ื•ืช ืขืจืš ื ืžื•ืš ื• ืชื•ึนืกึถืคึถืช by ืขืจื›ื™ื, ืื‘ืœ ืœื ืื›ืคืช ืœื• ืื
ืจืฆืฃ ืžื•ื’ื“ืจ ืœืžื—ื–ื•ืจ ืื• ืœื.

ื”ืคืœื˜ ืขื‘ื•ืจ Nagios ื ื•ืชืŸ ืืช ืฉื ื”ืจืฆืฃ, ื”ืื—ื•ื– ื‘ืฉื™ืžื•ืฉ ื•ื”ืžืกืคืจ
ืฉืœ 'ืฉื™ื—ื•ืช' ืฉื ื•ืชืจื•, ื”ืžืฆื™ื™ืŸ ื›ืžื” ืคืขืžื™ื ื ื•ืกืคื•ืช ื ื™ืชืŸ ืœืงืจื•ื ืœ- Nextval ื‘ืจืฆืฃ ื–ื”
ืœืคื ื™ ืฉื ื›ื ืกื™ื ืœืขืจืš ื”ืžืงืกื™ืžืœื™.

ื”ืคืœื˜ ืขื‘ื•ืจ MRTG ืžื—ื–ื™ืจ ืืช ื”ืื—ื•ื– ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ื‘ื›ืœ ื”ืจืฆืคื™ื ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”,
ื•ื”ืฉื ืฉืœ ื›ืœ ืจืฆืฃ ืขื ื”ืื—ื•ื– ื”ื–ื” ื‘ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช, ืžื•ืคืจื“ื™ื ื‘ืกื™ืžืŸ "|"
(ืฆื™ื ื•ืจ) ืื ื™ืฉ ื™ื•ืชืจ ืžืจืฆืฃ ืื—ื“ ื‘ืื—ื•ื– ื–ื”.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ืื ืจืฆืคื™ื ื›ืœืฉื”ื ืžืชืงืจื‘ื™ื ืœ-95% ืžืœืื™ื.

check_postgres_sequence --dbport=5432 --warning=95%

ื“ื•ื’ืžื” 2: ื‘ื“ื•ืง ืฉื”ืจืฆืฃ ื‘ืฉื "orders_id_seq" ืื™ื ื• ื™ื•ืชืจ ืžื—ืฆื™ ืžืœื.

check_postgres_sequence --dbport=5432 --critical=50% --include=orders_id_seq

settings_checksum
("Symlink: check_postgres_settings_checksum") ื‘ื•ื“ืง ืฉื›ืœ ื”ื”ื’ื“ืจื•ืช ืฉืœ Postgres ื”ืŸ
ื–ื”ื” ืœืคืขื ื”ืื—ืจื•ื ื” ืฉื‘ื“ืงืช. ื–ื” ื ืขืฉื” ืขืœ ื™ื“ื™ ื”ืคืงืช ืกื›ื•ื ื‘ื™ืงื•ืจืช ืฉืœ ืจืฉื™ืžื” ืžืžื•ื™ื ืช
ืฉืœ ืงื‘ื™ืขืช ืฉืžื•ืช ื•ืขืจื›ื™ื”ื. ืฉื™ื ืœื‘ ืฉื™ื›ื•ืœ ืœื”ื™ื•ืช ืœืžืฉืชืžืฉื™ื ืฉื•ื ื™ื ื‘ืื•ืชื• ืžืกื“ ื ืชื•ื ื™ื
ืกื›ื•ืžื™ ื‘ื™ืงื•ืจืช ืฉื•ื ื™ื, ืขืงื‘ ื”ืฉื™ืžื•ืฉ ื‘-ALTER USER, ื•ื‘ืฉืœ ื”ืขื•ื‘ื“ื” ืฉืžืฉืชืžืฉื™-ืขืœ ืจื•ืื™ื ื™ื•ืชืจ
ื”ื’ื“ืจื•ืช ืžืืฉืจ ืžืฉืชืžืฉื™ื ืจื’ื™ืœื™ื. ืื• ืืช --ืึทื–ื”ึธืจึธื” ืื• --ืงืจื™ื˜ื™ ื”ืืคืฉืจื•ืช ืฆืจื™ื›ื” ืœื”ื™ื•ืช
ื ืชื•ืŸ, ืื‘ืœ ืœื ืฉื ื™ื”ื. ื”ืขืจืš ืฉืœ ื›ืœ ืื—ื“ ืžื”ื ื”ื•ื ืกื›ื•ื ื”ื‘ื“ื™ืงื”, ื”ืงืกื“ืฆื™ืžืœื™ ื‘ืŸ 32 ืชื•ื•ื™ื
ืขืจืš. ืืชื” ื™ื›ื•ืœ ืœืจื•ืฅ ืขื ื”ืืคืฉืจื•ืช ื”ืžื™ื•ื—ื“ืช "--critical=0" ื›ื“ื™ ืœื’ืœื•ืช ืงื™ื™ื
ืกื›ื•ื ื‘ื“ื™ืงื”.

ืคืขื•ืœื” ื–ื• ื“ื•ืจืฉืช ืืช ื”ืžื•ื“ื•ืœ Digest::MD5.

ื“ื•ื’ืžื” 1: ืžืฆื ืืช ืกื›ื•ื ื”ื‘ื“ื™ืงื” ื”ืจืืฉื•ื ื™ ืขื‘ื•ืจ ืžืกื“ ื”ื ืชื•ื ื™ื ื‘ื™ืฆื™ืื” 5555 ื‘ืืžืฆืขื•ืช ืžืฉืชืžืฉ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ
(ื‘ื“ืจืš ื›ืœืœ postgres)

check_postgres_settings_checksum --port=5555 --critical=0

ื“ื•ื’ืžื” 2: ื•ื“ื ืฉืฉื•ื ื”ื’ื“ืจื•ืช ืœื ื”ืฉืชื ื• ื•ื”ื–ื”ื™ืจ ืื ื›ืŸ, ื‘ืืžืฆืขื•ืช ืกื›ื•ื ื”ื‘ื“ื™ืงื” ืž
ืžึตืขึทืœ.

check_postgres_settings_checksum --port=5555 --warning=cd2f3b5e129dc2b4f5c0f6d8d2e64231

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ 1 ืื• 0 ื”ืžืฆื‘ื™ืข ืขืœ ื”ืฆืœื—ื” ืฉืœ ื›ื™ืฉืœื•ืŸ ื‘ื”ืชืืžื” ืฉืœ ืกื›ื•ื ื”ื‘ื“ื™ืงื”.
ื™ืฉ ืœืกืคืง ืกื›ื•ื ื‘ื™ืงื•ืจืช ื›ืืจื’ื•ืžื ื˜ "--mrtg". ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืชืžื™ื“ ื ื•ืชื ืช ืืช ื”
ืกื›ื•ื ื‘ื“ื™ืงื” ื ื•ื›ื—ื™.

slony_status
("Symlink: check_postgres_slony_status") ื‘ื•ื“ืง ืกื˜ื˜ื•ืก ืฉืœ ืืฉื›ื•ืœ ืกืœื•ื ื™ ืขืœ ื™ื“ื™
ืžืกืชื›ืœ ืขืœ ื”ืชื•ืฆืื•ืช ืฉืœ ืชืฆื•ื’ืช sl_status ืฉืœ ืกืœื•ื ื™. ื–ื” ืžื•ื—ื–ืจ ื›ืžืกืคืจ ืฉืœ
ืฉื ื™ื•ืช ืฉืœ "ื–ืžืŸ ืคื™ื’ื•ืจ". ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ืฆืจื™ื›ื•ืช ืœื”ืชื‘ื˜ื ื›ื–ืžื ื™ื.
ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ื”ื 60 ืฉื ื™ื•ืช ืขื‘ื•ืจ ื”ืื–ื”ืจื” ื• 300 ืฉื ื™ื•ืช ืขื‘ื•ืจ ื”ืงืจื™ื˜ื™ื™ื.

ื”ื˜ื™ืขื•ืŸ ื”ืื•ืคืฆื™ื•ื ืืœื™ --ืกื›ึตื™ืžึธื” ืฆื™ื™ื ื” ืืช ื”ืกื›ื™ืžื” ืฉืžืชื—ืชื™ื” ืžื•ืชืงืŸ ืกืœื•ื ื™. ืื ื–ื”
ืœื ื ืชื•ืŸ, ื”ืกื›ื™ืžื” ืชืงื‘ืข ืื•ื˜ื•ืžื˜ื™ืช ื‘ื›ืœ ืคืขื ืฉื‘ื“ื™ืงื” ื–ื• ืžื•ืคืขืœืช.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ืื ืกืœื•ื ื™ ื ืžืฆื ื‘ืคื™ื’ื•ืจ ืฉืœ ื™ื•ืชืจ ืž-20 ืฉื ื™ื•ืช

check_postgres_slony_status -- ืื–ื”ืจื” 20

ื“ื•ื’ืžื” 2: ืชืŸ ืงืจื™ื˜ื™ ืื ืกืœื•ื ื™, ื”ืžื•ืชืงืŸ ืชื—ืช ื”ืกื›ื™ืžื” "_slony", ื”ื•ื ืžืขืœ 10
ื“ืงื•ืช ื‘ืคื™ื’ื•ืจ

check_postgres_slony_status --schema=_slony --critical=600

ืกื™ื ื›ืจื•ืŸ ื–ืžืŸ
("symlink: check_postgres_timesync") ืžืฉื•ื•ื” ืืช ื–ืžืŸ ื”ืžืขืจื›ืช ื”ืžืงื•ืžื™ืช ืœืฉืขื” ืฉื“ื•ื•ื—ื”
ืขืœ ื™ื“ื™ ืžืกื“ ื ืชื•ื ื™ื ืื—ื“ ืื• ื™ื•ืชืจ. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ืžื™ื™ืฆื’ื•ืช ืืช ืžืกืคืจ
ืฉื ื™ื•ืช ื‘ื™ืŸ ืฉืชื™ ื”ืžืขืจื›ื•ืช ืœืคื ื™ ืžืชืŸ ื”ืชืจืื”. ืื ืืฃ ืื—ื“ ืžื”ื ืœื ืžืฆื•ื™ืŸ, ื”
ื ืขืฉื” ืฉื™ืžื•ืฉ ื‘ืขืจื›ื™ ื‘ืจื™ืจืช ืžื—ื“ืœ, ืฉื”ื '2' ื•-'5'. ืขืจืš ื”ืื–ื”ืจื” ืœื ื™ื›ื•ืœ ืœื”ื™ื•ืช ื’ื“ื•ืœ ืž
ื”ืขืจืš ื”ืงืจื™ื˜ื™. ื‘ืฉืœ ื”ืื•ืคื™ ื”ืœื ืžื“ื•ื™ืง ืฉืœ ื‘ื“ื™ืงื” ื–ื•, ืขืจื›ื™ื ืฉืœ '0' ืื• '1' ืื™ื ื
ืžื•ืžืœืฅ.

ื”ืžื—ืจื•ื–ืช ืฉื”ื•ื—ื–ืจื” ืžืฆื™ื’ื” ืืช ื”ืคืจืฉ ื”ื–ืžืŸ ื•ื›ืŸ ืืช ื”ื–ืžืŸ ืฉื ื›ืชื‘ ื‘ื›ืœ ืฆื“
ื”ื—ื•ืฆื”.

ื“ื•ื’ืžื” 1: ื‘ื“ื•ืง ืฉืžืกื“ื™ ื ืชื•ื ื™ื ืขืœ ื”ืžืืจื—ื™ื ankh, morpork ื•-klatch ืื™ื ื ื™ื•ืชืจ ืž-3
ืฉื ื™ื•ืช ื”ื ื—ื” ืžื”ื–ืžืŸ ื”ืžืงื•ืžื™:

check_postgres_timesync --host=ankh,morpork,klatch --critical=3

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืื—ื“ ืžื”ืฉื•ืจื” ื”ืจืืฉื•ื ื” ืืช ืžืกืคืจ ื”ืฉื ื™ื•ืช ื”ื”ืคืจืฉ ื‘ื™ืŸ
ื–ืžืŸ ืžืงื•ืžื™ ื•ื–ืžืŸ ืžืกื“ ื”ื ืชื•ื ื™ื. ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืžื—ื–ื™ืจื” ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื.

txn_idle
("ืกืžืœ ืงื™ืฉื•ืจ: check_postgres_txn_idle") ื‘ื•ื“ืง ืืช ื”ืžืกืคืจ ื•ืžืฉืš ื”ื–ืžืŸ ืฉืœ "ื‘ื˜ืœ ื‘
ื˜ืจื ื–ืงืฆื™ื”" ื‘ืžืกื“ ื ืชื•ื ื™ื ืื—ื“ ืื• ื™ื•ืชืจ. ืื™ืŸ ืฆื•ืจืš ืœื”ืคืขื™ืœ ื–ืืช ื™ื•ืชืจ ืžืคืขื ืื—ืช
ืขืœ ืื•ืชื• ืืฉื›ื•ืœ ืžืกื“ ื ืชื•ื ื™ื. ื ื™ืชืŸ ืœืกื ืŸ ืžืกื“ื™ ื ืชื•ื ื™ื ื‘ืืžืฆืขื•ืช ื” --ืœึดื›ืœื•ึนืœ ื•
--ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ื‘ืกื™ืกื™" ืœืžื˜ื” ืœืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื”ืฉืžื™ื™ื --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ื ื™ืชื ื•ืช ื›ื™ื—ื™ื“ื•ืช ื–ืžืŸ, ืžืกืคืจื™ื ืฉืœืžื™ื ื‘ืกื™ืžืŸ, ืื•
ืžืกืคืจื™ื ืฉืœืžื™ื ืขื‘ื•ืจ ื™ื—ื™ื“ื•ืช ื–ืžืŸ, ื•ื™ืฉ ืœืกืคืง ืืช ืฉื ื™ื”ื (ืื™ืŸ ื‘ืจื™ืจื•ืช ืžื—ื“ืœ). ื™ื—ื™ื“ื•ืช ืชืงืคื•ืช
ื”ื 'ืฉื ื™ื•ืช', 'ื“ืงื•ืช', 'ืฉืขื•ืช' ืื• 'ื™ืžื™ื'. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื›ืชื‘ ื‘ื™ื—ื™ื“ ืื• ืžืงื•ืฆืจ
ืจืง ืœืื•ืช ื”ืจืืฉื•ื ื”. ืื ืœื ื ื™ืชื ื•ืช ื™ื—ื™ื“ื•ืช ื•ื”ืžืกืคืจื™ื ืœื ืžืกื•ืžื ื™ื, ื”ื™ื—ื™ื“ื•ืช
ืžื ื™ื—ื™ื ืฉื”ื ืฉื ื™ื•ืช.

ืคืขื•ืœื” ื–ื• ื“ื•ืจืฉืช Postgres 8.3 ื•ืžืขืœื”.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ืื ื—ื™ื‘ื•ืจ ื›ืœืฉื”ื• ื”ื™ื” ืคืขื™ืœ ื‘ืขืกืงื” ื‘ืžืฉืš ื™ื•ืชืจ ืž-15
ืฉื ื™ื•ืช:

check_postgres_txn_idle --port=5432 --warning='15 ืฉื ื™ื•ืช'

ื“ื•ื’ืžื” 2: ืชืŸ ืื–ื”ืจื” ืื ื™ืฉ 50 ืขืกืงืื•ืช ืื• ื™ื•ืชืจ

check_postgres_txn_idle --port=5432 --warning='+50'

ื“ื•ื’ืžื” 3: ืชืŸ ืงืจื™ื˜ื™ ืื 5 ื—ื™ื‘ื•ืจื™ื ืื• ื™ื•ืชืจ ืœื ื”ื™ื• ืคืขื™ืœื™ื ื‘ืขืกืงื” ื‘ืžืฉืš ื™ื•ืชืจ
ืž-10 ืฉื ื™ื•ืช:

check_postgres_txn_idle --port=5432 --critical='5 ืœืžืฉืš 10 ืฉื ื™ื•ืช'

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ื–ืžืŸ ื‘ืฉื ื™ื•ืช ืฉื”ื˜ืจื ื–ืงืฆื™ื” ื”ืกืจืง ื”ืืจื•ื›ื” ื‘ื™ื•ืชืจ ื”ื™ื™ืชื”
ืจืฅ. ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืžื—ื–ื™ืจื” ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ื•ืžื™ื“ืข ืื—ืจ ืขืœ
ื”ืขืกืงื” ื”ืืจื•ื›ื” ื‘ื™ื•ืชืจ.

txn_time
("symlink: check_postgres_txn_time") ื‘ื•ื“ืง ืืช ืื•ืจืš ื”ืขืกืงืื•ืช ื”ืคืชื•ื—ื•ืช ื‘ืื—ืช ืื• ื™ื•ืชืจ
ืžืกื“ื™ ื ืชื•ื ื™ื. ืื™ืŸ ืฆื•ืจืš ืœื”ืคืขื™ืœ ืคืงื•ื“ื” ื–ื• ื™ื•ืชืจ ืžืคืขื ืื—ืช ื‘ื›ืœ ืืฉื›ื•ืœ ืžืกื“ ื ืชื•ื ื™ื.
ื ื™ืชืŸ ืœืกื ืŸ ืžืกื“ื™ ื ืชื•ื ื™ื ืขืœ ื™ื“ื™ ืฉื™ืžื•ืฉ ื‘- --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ืืคืฉืจื•ื™ื•ืช. ืจืื” ืืช "ื‘ืกื™ืก
ืกืขื™ืฃ ืกื™ื ื•ืŸ" ืœืคืจื˜ื™ื ื ื•ืกืคื™ื. ื ื™ืชืŸ ื’ื ืœืกื ืŸ ืืช ื‘ืขืœ ื”ืขืกืงื”, ืœืคื™
ืฉื™ืžื•ืฉ --includeuser ื• --excludeuser ืืคืฉืจื•ื™ื•ืช. ืขื™ื™ืŸ ื‘ืกืขื™ืฃ "ืกื™ื ื•ืŸ ืฉื ืžืฉืชืžืฉ".
ืœืงื‘ืœืช ืคืจื˜ื™ื ื ื•ืกืคื™ื.

ื”ืขืจื›ื™ื ืื• ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ื”ืŸ ื™ื—ื™ื“ื•ืช ื–ืžืŸ, ื•ื™ืฉ ืœืกืคืง ืื•ืชืŸ
(ืœืœื ื‘ืจื™ืจืช ืžื—ื“ืœ). ื™ื—ื™ื“ื•ืช ื—ื•ืงื™ื•ืช ื”ืŸ 'ืฉื ื™ื•ืช', 'ื“ืงื•ืช', 'ืฉืขื•ืช' ืื• 'ื™ืžื™ื'. ื›ืœ ืื—ื“ ื™ื›ื•ืœ ืœื”ื™ื•ืช
ื›ืชื•ื‘ ื‘ื™ื—ื™ื“ ืื• ื‘ืงื™ืฆื•ืจ ืœืื•ืช ื”ืจืืฉื•ื ื” ื‘ืœื‘ื“. ืื ืœื ื ื™ืชื ื•ืช ื™ื—ื™ื“ื•ืช, ื”
ื”ื”ื ื—ื” ื”ื™ื ืฉื”ื™ื—ื™ื“ื•ืช ื”ืŸ ืฉื ื™ื•ืช.

ืคืขื•ืœื” ื–ื• ื“ื•ืจืฉืช Postgres 8.3 ื•ืžืขืœื”.

ื“ื•ื’ืžื” 1: ืชืŸ ืงืจื™ื˜ื™ ืื ืขืกืงื” ื›ืœืฉื”ื™ ื”ื™ื™ืชื” ืคืชื•ื—ื” ื‘ืžืฉืš ื™ื•ืชืจ ืž-10 ื“ืงื•ืช:

check_postgres_txn_time --port=5432 --critical='10 ื“ืงื•ืช'

ื“ื•ื’ืžื” 1: ืื–ื”ืจื” ืื ืœืžืฉืชืžืฉ 'ืžื—ืกืŸ' ื™ืฉ ืขืกืงื” ืคืชื•ื—ื” ืžืขืœ 30 ืฉื ื™ื•ืช

check_postgres_txn_time --port-5432 --warning=30s --includeuser=ืžื—ืกืŸ

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ื–ืžืŸ ื”ืžืจื‘ื™ ื‘ืฉื ื™ื•ืช ืฉืขืกืงื” ื”ื™ื™ืชื” ืคืชื•ื—ื” ื‘-
ืฉื•ืจื” ืจืืฉื•ื ื”. ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ื ื•ืชื ืช ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื.

txn_wraparound
("Symlink: check_postgres_txn_wraparound") ื‘ื•ื“ืง ื›ืžื” ืงืจื•ื‘ ืœืขืกืงื” ื”ืžืงื™ืคื” ืื—ืช
ืื• ื™ื•ืชืจ ืžืกื“ื™ ื ืชื•ื ื™ื ืžืงื‘ืœื™ื. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ืืคืฉืจื•ื™ื•ืช ืžืฆื™ื™ื ื•ืช ืืช ื”ืžืกืคืจ
ืฉืœ ื”ืขืกืงืื•ืช ืฉื ืขืฉื•, ื•ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ ืฉืœื ื—ื™ื•ื‘ื™. ืื ืื—ืช ืžื”ืืคืฉืจื•ื™ื•ืช ืœื ื ื™ืชื ืช, ื”
ื ืขืฉื” ืฉื™ืžื•ืฉ ื‘ืขืจื›ื™ ื‘ืจื™ืจืช ืžื—ื“ืœ ืฉืœ 1.3 ื•-1.4 ืžื™ืœื™ืืจื“. ืื™ืŸ ืฆื•ืจืš ืœื”ืคืขื™ืœ ืืช ื”ืคืงื•ื“ื” ื”ื–ื• ื™ื•ืชืจ
ืžืคืขื ืื—ืช ื‘ื›ืœ ืืฉื›ื•ืœ ืžืกื“ ื ืชื•ื ื™ื. ืœื“ื™ื•ืŸ ืžืคื•ืจื˜ ื™ื•ืชืจ ืขืœ ืžื” ื”ืžืกืคืจ ื”ื–ื”
ืžื™ื™ืฆื’ ื•ืžื” ืœืขืฉื•ืช ื‘ืงืฉืจ ืœื–ื”, ื‘ืงืจ ื‘ื“ืฃ
<http://www.postgresql.org/docs/current/static/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND>

ื”ืื–ื”ืจื” ื•ื”ืขืจื›ื™ื ื”ืงืจื™ื˜ื™ื™ื ื™ื›ื•ืœื™ื ืœื”ื™ื•ืช ื‘ืขืœื™ ืงื• ื“ื’ืฉ ื‘ืžืกืคืจ ืœืงืจื™ืื•ืช, ื›ืžื• Perl
ืขื•ืฉื”.

ื“ื•ื’ืžื” 1: ื‘ื“ื•ืง ืืช ืขืจื›ื™ ื‘ืจื™ืจืช ื”ืžื—ื“ืœ ืขื‘ื•ืจ ืžืกื“ ื”ื ืชื•ื ื™ื ืฉืœ localhost

check_postgres_txn_wraparound --host=localhost

ื“ื•ื’ืžื” 2: ื‘ื“ื•ืง ืืช ื™ืฆื™ืื” 6000 ื•ืชืŸ ืขืจืš ืงืจื™ื˜ื™ ื›ืืฉืจ ื ืคื’ืขื• 1.7 ืžื™ืœื™ืืจื“ ืขืกืงืื•ืช:

check_postgres_txn_wraparound --port=6000 --critical=1_700_000_000

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื—ื–ื™ืจ ืืช ื”ืžืกืคืจ ื”ื’ื‘ื•ื” ื‘ื™ื•ืชืจ ืฉืœ ืขืกืงืื•ืช ืขื‘ื•ืจ ื›ืœ ืžืกื“ื™ ื”ื ืชื•ื ื™ื ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”,
ื‘ืขื•ื“ ืฉื•ืจื” 4 ืžืฆื™ื™ื ืช ื‘ืื™ื–ื” ืžืกื“ ื ืชื•ื ื™ื ืžื“ื•ื‘ืจ.

ื’ืจืกื”
("Symlink: check_postgres_version") ื‘ื•ื“ืง ืฉื”ื’ืจืกื” ื”ื ื“ืจืฉืช ืฉืœ Postgres ื”ื™ื
ืจืฅ. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื”ืืคืฉืจื•ื™ื•ืช (ื ื“ืจืฉ ืจืง ืื—ืช) ื—ื™ื™ื‘ื•ืช ืœื”ื™ื•ืช ื‘ืคื•ืจืžื˜
ืฉื™ or XYZ ืื™ืคื” X ื”ื•ื ืžืกืคืจ ื”ื’ืจืกื” ื”ืขื™ืงืจื™, Y ื”ื•ื ืžืกืคืจ ื”ื’ืจืกื” ื”ืžืฉื ื™, ื• Z is
ื”ืชื™ืงื•ืŸ.

ื“ื•ื’ืžื” 1: ืชืŸ ืื–ื”ืจื” ืื ืžืกื“ ื”ื ืชื•ื ื™ื ื‘ื™ืฆื™ืื” 5678 ืื™ื ื• ื’ืจืกื” 8.4.10:

check_postgres_version --port=5678 -w=8.4.10

ื“ื•ื’ืžื” 2: ืชืŸ ืื–ื”ืจื” ืื ืžืกื“ื™ ื ืชื•ื ื™ื ื›ืœืฉื”ื ืขืœ ืขืžืง ืžืืจื—, ืชื‘ื•ืื” ืื• ืฉืžืฉ ืื™ื ื 8.3:

check_postgres_version -H valley,grain,sunshine --critical=8.3

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื“ื•ื•ื— ืขืœ 1 ืื• 0 ื”ืžืฆื™ื™ืŸ ื”ืฆืœื—ื” ืื• ื›ื™ืฉืœื•ืŸ ื‘ืฉื•ืจื” ื”ืจืืฉื•ื ื”. ื”
ื”ืฉื•ืจื” ื”ืจื‘ื™ืขื™ืช ืžืฆื™ื™ื ืช ืืช ื”ื’ืจืกื” ื”ื ื•ื›ื—ื™ืช. ื™ืฉ ืœืกืคืง ืืช ื”ื’ืจืกื” ื‘ืืžืฆืขื•ืช "--mrtg"
ืื•ึนืคึผึฐืฆึดื™ึธื”.

wal_files
("Symlink: check_postgres_wal_files") ื‘ื•ื“ืง ื›ืžื” ืงื‘ืฆื™ WAL ืงื™ื™ืžื™ื ื‘- pg_xlog
ืกืคืจื™ื™ื”, ืฉื ืžืฆืืช ืžื—ื•ืฅ ืฉืœืš data_directory, ืœืคืขืžื™ื ื›ืงื™ืฉื•ืจ ืกื™ืžืŸ ืœืื—ืจ
ื“ื™ืกืง ืคื™ื–ื™ ืžื˜ืขืžื™ ื‘ื™ืฆื•ืขื™ื. ืคืขื•ืœื” ื–ื• ื—ื™ื™ื‘ืช ืœื”ื™ื•ืช ืžื•ืคืขืœืช ื›ืžืฉืชืžืฉ-ืขืœ, ื›ื“ื™ ืœืขืฉื•ืช ื–ืืช
ืœื’ืฉืช ืœืชื•ื›ืŸ ืฉืœ pg_xlog ืžึทื“ืจึดื™ืš. ื”ื’ืจืกื” ื”ืžื™ื ื™ืžืœื™ืช ืœืฉื™ืžื•ืฉ ื‘ืคืขื•ืœื” ื–ื• ื”ื™ื
Postgres 8.1. ื” --ืึทื–ื”ึธืจึธื” ื• --ืงืจื™ื˜ื™ ื”ืืคืฉืจื•ื™ื•ืช ื”ืŸ ืคืฉื•ื˜ ืžืกืคืจ ื”ืงื‘ืฆื™ื ื‘-
pg_xlog ืžึทื“ืจึดื™ืš. ืœืื™ื–ื” ืžืกืคืจ ืœื”ื’ื“ื™ืจ ืืช ื–ื” ื™ืฉืชื ื”, ืื‘ืœ ื”ื ื—ื™ื” ื›ืœืœื™ืช ื”ื™ื ืœืฉื™ื
ืžืกืคืจ ืžืขื˜ ื’ื‘ื•ื” ืžืžื” ืฉื™ืฉ ื‘ื“ืจืš ื›ืœืœ, ื›ื“ื™ ืœืชืคื•ืก ื‘ืขื™ื•ืช ืžื•ืงื“ื.

ื‘ื“ืจืš ื›ืœืœ, ืงื‘ืฆื™ WAL ื ืกื’ืจื™ื ื•ืœืื—ืจ ืžื›ืŸ ื ืขืฉื” ื‘ื”ื ืฉื™ืžื•ืฉ ื—ื•ื–ืจ, ืืš ืขืกืงื” ืคืชื•ื—ื” ืœืื•ืจืš ื–ืžืŸ, ืื• ื
ืคื’ื•ื ืคืงื•ื“ื”_ืืจื›ื™ื•ืŸ script, ืขืœื•ืœ ืœื’ืจื•ื ืœ-Postgres ืœื™ืฆื•ืจ ื™ื•ืชืจ ืžื“ื™ ืงื‘ืฆื™ื. ื‘ืกื•ืคื• ืฉืœ ื“ื‘ืจ,
ื–ื” ื™ื’ืจื•ื ืœื“ื™ืกืง ืฉื”ื ื ืžืฆืื™ื ื‘ื• ืœื”ื™ื’ืžืจ ืžืงื•ื, ื•ื‘ืฉืœื‘ ื–ื” Postgres ื™ืขืฉื” ื–ืืช
ืœื›ื‘ื•ืช.

ื“ื•ื’ืžื” 1: ื‘ื“ื•ืง ืฉืžืกืคืจ ืงื‘ืฆื™ WAL ื”ื•ื 20 ืื• ืคื—ื•ืช ื‘ืžืืจื— "pluto"

check_postgres_wal_files --host=pluto --critical=20

ืขื‘ื•ืจ ืคืœื˜ MRTG, ืžื“ื•ื•ื— ืขืœ ืžืกืคืจ ืงื‘ืฆื™ WAL ื‘ืฉื•ืจื” 1.

ืœื‘ื ื•ืช ืžื—ื“ืฉ_ืงื™ืฉื•ืจื™ื ืกื™ืžื ื™ื
rebuild_symlinks_force
ืคืขื•ืœื” ื–ื• ืื™ื ื” ื“ื•ืจืฉืช ืืจื’ื•ืžื ื˜ื™ื ืื—ืจื™ื, ื•ืื™ื ื” ืžืชื—ื‘ืจืช ืœืฉื•ื ืžืกื“ื™ ื ืชื•ื ื™ื, ืืœื ืคืฉื•ื˜
ื™ื•ืฆืจ ืกื™ืžืœื™ื ืงื™ื ื‘ืกืคืจื™ื™ื” ื”ื ื•ื›ื—ื™ืช ืขื‘ื•ืจ ื›ืœ ืคืขื•ืœื”, ื‘ื˜ื•ืคืก
check_postgres_. ืื ื”ืงื•ื‘ืฅ ื›ื‘ืจ ืงื™ื™ื, ื”ื•ื ืœื ื™ื•ื—ืœืฃ. ืื
ื”ืคืขื•ืœื” ื”ื™ื rebuild_symlinks_force, ื•ืื– ืกื™ืžืœื™ื ืงื™ื ื™ื•ื—ืœืคื•. ื”ืืคืฉืจื•ืช
--symlinks ื”ื™ื ื“ืจืš ืงืฆืจื” ื™ื•ืชืจ ืœื•ืžืจ --action=rebuild_symlinks

ื‘ืกื™ืกื™ ืกื™ื ื•ืŸ


ื”ืืคืฉืจื•ื™ื•ืช --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ื ื™ืชืŸ ืœืฉืœื‘ ื›ื“ื™ ืœื”ื’ื‘ื™ืœ ืื™ืœื• ื“ื‘ืจื™ื ื ื‘ื“ืงื™ื,
ื‘ื”ืชืื ืœืคืขื•ืœื”. ื ื™ืชืŸ ืœืกื ืŸ ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื ื‘ืขืช ืฉื™ืžื•ืฉ ื‘ื›ืชื•ื‘ืช ื”ื‘ืื”
ืคืขื•ืœื•ืช: backends, database_size, locks, query_time, txn_idle ื•-txn_time. ื”ืฉื ืฉืœ
ื ื™ืชืŸ ืœืกื ืŸ ืงืฉืจ ื‘ืขืช ืฉื™ืžื•ืฉ ื‘ืคืขื•ืœื•ืช ื”ื‘ืื•ืช: bloat, index_size,
table_size, relation_size, last_vacuum, last_autovacuum, last_analyze, ื•
last_autoanalyze. ื ื™ืชืŸ ืœืกื ืŸ ืฉื ืฉืœ ื”ื’ื“ืจื” ื‘ืขืช ืฉื™ืžื•ืฉ ื‘- settings_checksum
ืคืขื•ืœื”. ื ื™ืชืŸ ืœืกื ืŸ ืฉื ืฉืœ ืžืขืจื›ืช ืงื‘ืฆื™ื ื‘ืขืช ืฉื™ืžื•ืฉ ื‘ืคืขื•ืœืช disk_space.

ืื ื ื™ืชื ืช ืจืง ืืคืฉืจื•ืช ืœื›ืœื•ืœ, ืื– ืจืง ื”ืขืจื›ื™ื ื”ืชื•ืืžื™ื ื™ืกื•ืžื ื•.
ืขื ื–ืืช, ืื ื ื™ืชืŸ ื’ื ืœื ืœื›ืœื•ืœ ื•ื’ื ืœื›ืœื•ืœ, ื”ื”ื›ืœืœื” ืžืชื‘ืฆืขืช ืชื—ื™ืœื”, ื•ื”ื”ื›ืœืœื”
ืœืื—ืจ ืžื›ืŸ, ืœื”ื—ื–ื™ืจ ื“ื‘ืจื™ื ืฉืื•ืœื™ ืœื ื ื›ืœืœื•. ืฉื ื™ื”ื --ืœึดื›ืœื•ึนืœ ื• --ืœื ืœื›ืœื•ืœ ื™ื›ื•ืœ
ื ื™ืชืŸ ืžืกืคืจ ืคืขืžื™ื, ื•/ืื• ื›ืจืฉื™ืžื•ืช ืžื•ืคืจื“ื•ืช ื‘ืคืกื™ืงื™ื. ื˜ื™ืœื“ื” ืžื•ื‘ื™ืœ ื™ืชืื™ื ืœ
ื”ืžื™ืœื” ื”ื‘ืื” ื›ื‘ื™ื˜ื•ื™ ืจื’ื•ืœืจื™.

ื›ื“ื™ ืœื”ืชืื™ื ืกื›ื™ืžื”, ืกื™ื™ื ืืช ืžื•ื ื— ื”ื—ื™ืคื•ืฉ ื‘ื ืงื•ื“ื” ืื—ืช. ื ื™ืชืŸ ืœื”ืฉืชืžืฉ ื‘ื˜ื™ืœื“ื™ื ืžื•ื‘ื™ืœื™ื
ื’ื ืœืกื›ื™ืžื•ืช.

ื”ื™ื–ื”ืจ ื‘ืขืช ืฉื™ืžื•ืฉ ื‘ืกื™ื ื•ืŸ: ื›ืœืœ ื”ื›ืœืœื” ื‘ืงืฆื” ื”ืื—ื•ืจื™, ืœืžืฉืœ, ืขืฉื•ื™
ืื™ืŸ ืœื“ื•ื•ื— ืขืœ ื‘ืขื™ื•ืช ืœื ืจืง ื‘ื’ืœืœ ืฉืœื‘ืกื™ืก ื”ื ืชื•ื ื™ื ื”ืชื•ืื ืœื ื”ื™ื• ืงืฆื” ืื—ื•ืจื™, ืืœื ื‘ื’ืœืœ ืฉืืชื”
ืื™ื•ืช ืฉื’ื•ื™ ืืช ืฉื ืžืกื“ ื”ื ืชื•ื ื™ื!

ื“ื•ื’ืžืื•ืช:

ื‘ื•ื“ืง ืจืง ืคืจื™ื˜ื™ื ื‘ืฉื pg_class:

--include=pg_class

ื‘ื•ื“ืง ืจืง ืคืจื™ื˜ื™ื ื”ืžื›ื™ืœื™ื ืืช ื”ืื•ืชื™ื•ืช 'pg_':

--include=~pg_

ื‘ื“ื•ืง ืจืง ืคืจื™ื˜ื™ื ืฉืžืชื—ื™ืœื™ื ื‘-'pg_':

--include=~^pg_

ืืœ ืชื›ืœื•ืœ ืืช ื”ืคืจื™ื˜ ื‘ืฉื 'ืžื‘ื—ืŸ':

--exclude=ืžื‘ื—ืŸ

ืืœ ืชื›ืœื•ืœ ืืช ื›ืœ ื”ืคืจื™ื˜ื™ื ื”ืžื›ื™ืœื™ื ืืช ื”ืื•ืชื™ื•ืช 'ืžื‘ื—ืŸ:

--exclude=~test

ืืœ ืชื›ืœื•ืœ ืืช ื›ืœ ื”ืคืจื™ื˜ื™ื ื‘ืกื›ื™ืžื” 'pg_catalog':

--exclude='pg_catalog.'

ืืœ ืชื›ืœื•ืœ ืืช ื›ืœ ื”ืคืจื™ื˜ื™ื ื”ืžื›ื™ืœื™ื ืืช ื”ืื•ืชื™ื•ืช 'ace', ืืš ืืคืฉืจ ืืช ื”ืคืจื™ื˜ 'faceoff':

--exclude=~ace --include=faceoff

ืืœ ืชื›ืœื•ืœ ืืช ื›ืœ ื”ืคืจื™ื˜ื™ื ืฉืžืชื—ื™ืœื™ื ื‘ืื•ืชื™ื•ืช 'pg_', ื”ืžื›ื™ืœื•ืช ืืช ื”ืื•ืชื™ื•ืช 'slon', ืื•
ืืฉืจ ื ืงืจืื™ื 'sql_settings' ืื• 'green'. ื‘ื“ื•ืง ื‘ืžื™ื•ื—ื“ ืคืจื™ื˜ื™ื ืขื ื”ืื•ืชื™ื•ืช
'prod' ื‘ืฉืžื•ืชื™ื”ื, ื•ืชืžื™ื“ ื‘ื“ื•ืง ืืช ื”ืคืจื™ื˜ ื‘ืฉื 'pg_relname':

--exclude=~^pg_,~slon,sql_settings --exclude=green --include=~prod,pg_relname

ืžืฉืชืžืฉ ืฉืึตื ืกื™ื ื•ืŸ


ื”ืืคืฉืจื•ื™ื•ืช --includeuser ื• --excludeuser ื ื™ืชืŸ ืœื”ืฉืชืžืฉ ื‘ืคืขื•ืœื•ืช ืžืกื•ื™ืžื•ืช ืจืง ื›ื“ื™ ืœื‘ื—ื•ืŸ
ืื•ื‘ื™ื™ืงื˜ื™ ืžืกื“ ื ืชื•ื ื™ื ื‘ื‘ืขืœื•ืช (ืื• ืœื ื‘ื‘ืขืœื•ืช) ืžืฉืชืžืฉ ืื—ื“ ืื• ื™ื•ืชืจ. ื --includeuser ืื•ึนืคึผึฐืฆึดื™ึธื”
ืชืžื™ื“ ื’ื•ื‘ืจ ืขืœ ื --excludeuser ืื•ึนืคึผึฐืฆึดื™ึธื”. ืืชื” ื™ื›ื•ืœ ืœืชืช ืœื›ืœ ืืคืฉืจื•ืช ื™ื•ืชืจ ืžืคืขื ืื—ืช ืขื‘ื•ืจ
ืžืฉืชืžืฉื™ื ืžืจื•ื‘ื™ื, ืื• ืฉืืชื” ื™ื›ื•ืœ ืœืชืช ืจืฉื™ืžื” ืžื•ืคืจื“ืช ื‘ืคืกื™ืงื™ื. ื”ืคืขื•ืœื•ืช ืฉืžืฉืชืžืฉื•ืช ื›ืจื’ืข
ื”ืืคืฉืจื•ื™ื•ืช ื”ืืœื” ื”ืŸ:

ื’ื•ื“ืœ_ื‘ืกื™ืก ื”ื ืชื•ื ื™ื
ื ื™ืชื•ื—_ืื—ืจื•ืŸ
last_autoanalyze
ื•ืืงื•ื_ืื—ืจื•ืŸ
ื•ืืงื•ื_ืื•ื˜ื•ืžื˜ื™ ืื—ืจื•ืŸ
ืฉืื™ืœืชื”_ื–ืžืŸ
ื’ื•ื“ืœ_ื™ื—ืก
txn_time

ื“ื•ื’ืžืื•ืช:

ื‘ื“ื•ืง ืจืง ืคืจื™ื˜ื™ื ืฉื‘ื‘ืขืœื•ืช ื”ืžืฉืชืžืฉ ื‘ืฉื greg:

--includeuser=greg

ื‘ื“ื•ืง ืจืง ืคืจื™ื˜ื™ื ืฉื‘ื‘ืขืœื•ืช ื•ื•ื˜ืกื•ืŸ ืื• ืงืจื™ืง:

--includeuser=watson,crick

ื‘ื“ื•ืง ืจืง ืคืจื™ื˜ื™ื ื‘ื‘ืขืœื•ืช ืงืจื™ืง, ืคืจื ืงืœื™ืŸ, ื•ื•ื˜ืกื•ืŸ ืื• ื•ื™ืœืงื™ื ืก:

--includeuser=watson --includeuser=ืคืจื ืงืœื™ืŸ --includeuser=crick,wilkins

ืกืžืŸ ืืช ื›ืœ ื”ืคืจื™ื˜ื™ื ืžืœื‘ื“ ืืœื” ื”ืฉื™ื™ื›ื™ื ืœืžืฉืชืžืฉ ืกืงื•ื˜:

--excludeuser=scott

ืžื‘ื—ืŸ MODE


ื›ื“ื™ ืœืขื–ื•ืจ ื‘ื”ื’ื“ืจืช ื“ื‘ืจื™ื, ื ื™ืชืŸ ืœื”ืคืขื™ืœ ืชื•ื›ื ื™ืช ื–ื• ื‘"ืžืฆื‘ ื‘ื“ื™ืงื”" ืขืœ ื™ื“ื™ ืฆื™ื•ืŸ ื”
--ืžึดื‘ึฐื—ึธืŸ ืื•ึนืคึผึฐืฆึดื™ึธื”. ื–ื” ื™ื‘ืฆืข ื›ืžื” ื‘ื“ื™ืงื•ืช ื‘ืกื™ืกื™ื•ืช ื›ื“ื™ ืœื•ื•ื“ื ืฉื‘ืกื™ืกื™ ื”ื ืชื•ื ื™ื ื™ื›ื•ืœื™ื ืœื”ื™ื•ืช
ื™ืฆื™ืจืช ืงืฉืจ, ื•ื›ื™ ืชื ืื™ื ืžื•ืงื“ืžื™ื ืžืกื•ื™ืžื™ื ืœื›ืœ ืคืขื•ืœื” ืžืชืงื™ื™ืžื™ื, ื›ื’ื•ืŸ ื”ืื ื”ืžืฉืชืžืฉ ื›ืŸ
ืžืฉืชืžืฉ-ืขืœ, ืื ื”ื’ืจืกื” ืฉืœ Postgres ื—ื“ืฉื” ืžืกืคื™ืง, ื•ืื stats_row_level ืžื•ืคืขืœืช.

ื”ืฉืชืžืฉ ื‘-check_postgres_relation_sizep ื‘ืื™ื ื˜ืจื ื˜ ื‘ืืžืฆืขื•ืช ืฉื™ืจื•ืชื™ onworks.net


ืฉืจืชื™ื ื•ืชื—ื ื•ืช ืขื‘ื•ื“ื” ื‘ื—ื™ื ื

ื”ื•ืจื“ ืืคืœื™ืงืฆื™ื•ืช Windows & Linux

  • 1
    XMLTV
    XMLTV
    XMLTV ื”ื™ื ืงื‘ื•ืฆื” ืฉืœ ืชื•ื›ื ื™ื•ืช ืœืขื™ื‘ื•ื“
    ืจืฉื™ืžื•ืช ื˜ืœื•ื•ื™ื–ื™ื” (tvguide) ื•ืขื–ืจื” ื‘ื ื™ื”ื•ืœ
    ืฆืคื™ื™ื” ื‘ื˜ืœื•ื•ื™ื–ื™ื” ืฉืœืš, ืื—ืกื•ืŸ ืจื™ืฉื•ืžื™ื ื‘-
    ืคื•ืจืžื˜ ืžื‘ื•ืกืก XML. ื™ืฉ ื›ืœื™ ืขื–ืจ ื›ื“ื™
    ืขืฉื” ...
    ื”ื•ืจื“ ืืช XMLTV
  • 2
    strikr
    strikr
    ืคืจื•ื™ืงื˜ ืชื•ื›ื ื” ื—ื•ืคืฉื™ืช ืฉืœ Strikr. ื—ืคืฆื™ื
    ืฉื•ื—ืจืจ ืชื—ืช 'ืžื‘ื•ืกืก ื›ื•ื•ื ื•ืช'
    ืจื™ืฉื™ื•ืŸ ื›ืคื•ืœ: AGPLv3 (ืงื”ื™ืœื”) ื•
    CC-BY-NC-ND 4.0 ื‘ื™ื ืœืื•ืžื™
    (ืžึดืกึฐื—ึธืจึดื™)...
    ื”ื•ืจื“ ืืช strikr
  • 4
    GIFLIB
    GIFLIB
    giflib ื”ื™ื ืกืคืจื™ื™ื” ืœืงืจื™ืื” ื•
    ื›ืชื™ื‘ืช ืชืžื•ื ื•ืช GIF. ื–ื” API ื•-ABI
    ืชื•ืื libungif ืฉื”ื™ื” ื‘
    ืฉื™ืžื•ืฉ ืจื—ื‘ ืชื•ืš ื“ื—ื™ืกืช LZW
    ื”ืืœื’ื•ืจื™ืชื ื”ื™ื”...
    ื”ื•ืจื“ ืืช GIFLIB
  • 5
    Alt-F
    Alt-F
    Alt-F ืžืกืคืง ืงื•ื“ ื—ื•ืคืฉื™ ื•ืคืชื•ื—
    ืงื•ืฉื—ื” ื—ืœื•ืคื™ืช ืขื‘ื•ืจ ื”-DLINK
    DNS-320/320L/321/323/325/327L and
    DNR-322L. ืœ-Alt-F ื™ืฉ Samba ื•-NFS;
    ืชื•ืžืš ื‘-ext2/3/4...
    ื”ื•ืจื“ ืืช Alt-F
  • 6
    usm
    usm
    Usm ื”ื™ื ื—ื‘ื™ืœืช Slackware ืžืื•ื—ื“ืช
    ืžื ื”ืœ ืฉืžื˜ืคืœ ื‘ืื•ื˜ื•ืžื˜
    ืคืชืจื•ืŸ ืชืœื•ืช. ื–ื” ืžืื—ื“
    ืžืื’ืจื™ ื—ื‘ื™ืœื•ืช ืฉื•ื ื™ื ื›ื•ืœืœ
    slackware, slacky, p...
    ื”ื•ืจื“ ืืช usm
  • ืขื•ื“ ยป

ืคืงื•ื“ื•ืช ืœื™ื ื•ืงืก

Ad