[check_postgres] some more checks

Cédric Villemain cedric.villemain.debian at gmail.com
Fri Nov 4 14:25:02 UTC 2011


Hello

I've seen the recent assume-standby-mode option.
I've added an assume-production-mode in the same spirit.

Purpose is to use it with --action=checkpoint. It ouputs CRITICAL if
the mode found is not the mode assumed.

ex:
check_postgres.pl --assume-production-mode --action=checkpoint -c
100000 --datadir=/var/lib/postgresql/9.0/main
POSTGRES_CHECKPOINT OK:  Last checkpoint was 75931 seconds ago |
age=75931;;100000 mode=MASTER

check_postgres.pl --assume-standby-mode --action=checkpoint -c 100000
--datadir=/var/lib/postgresql/9.0/main
POSTGRES_CHECKPOINT CRITICAL:  Last checkpoint was 75984 seconds ago |
age=75984;;100000 mode=UNKNOWN

I've also added a --action=cluster_identifier which purpose is to
check that the Database sys ident provied by pg_controldata is the one
expected. It ouputs critical if the number is not the same ( a bit
like --action=checksum).

POSTGRES_CLUSTER_IDENTIFIER CRITICAL:  system_ident: 5633695740047915135
POSTGRES_CLUSTER_IDENTIFIER OK:  system_ident: 5633695740047915135


With those additions, checks against warm standby (and file based
replication cluster) looks safer.

Before sending the patchs (I still have to write documentation), is
there some comments on the proposal ?


-- 
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation


More information about the Check_postgres mailing list