From 11cc14fd00af1364bf91e42731673d22146283c8 Mon Sep 17 00:00:00 2001
From: Greg Sabino Mullane check_postgres.pl - a Postgres monitoring script for Nagios, MRTG, Cacti, and others This documents describes check_postgres.pl version 2.18.0 This documents describes check_postgres.pl version 2.19.0
If specified, check if server in production mode is performed (--datadir is required).
+The option is only relevant for ( Example:
NAME
@@ -329,6 +330,16 @@ ignored and "Server in standby mode" with OK status will be returned i
postgres@db$./check_postgres.pl --action=version --warning=8.1 --datadir /var/lib/postgresql/8.3/main/ --assume-standby-mode
POSTGRES_VERSION OK: Server in standby mode | time=0.00
+symlink: check_postgres_checkpoint
).
+ postgres@db$./check_postgres.pl --action=checkpoint --datadir /var/lib/postgresql/8.3/main/ --assume-prod
+ POSTGRES_CHECKPOINT OK: Last checkpoint was 72 seconds ago | age=72;;300 mode=MASTER
+--datadir
argument. It returns the number of seconds since the
was run, as determined by parsing the call to pg_controldata
. Because of this, the
pg_controldata executable must be available in the current path. Alternatively, you can
set the environment variable PGCONTROLDATA
to the exact location of the pg_controldata
-executable, or you can specify PGBINDIR
as the directory that it lives in.
PGBINDIR
as the directory that it lives in.
+It is also possible to use the special options --assume-prod or
+--assume-standby-mode, if the mode found is not the one expected, a CRITICAL is emitted.
At least one warning or critical argument must be set.
This action requires the Date::Parse module.
For MRTG or simple output, returns the number of seconds.
+
(symlink: check_postgres_cluster-id
) Checks that the Database System Identifier
+provided by pg_controldata is the same as last time you checked. This must run on the same
+server as the database that is being checked (e.g. the -h flag will not work).
+Either the --warning or the --critical option should be given, but not both. The value
+of each one is the cluster identifier, an integer value. You can run with the special --critical=0
option
+to find out an existing cluster identifier.
Example 1: Find the initial identifier
++ check_postgres_cluster_id --critical=0 --datadir=/var//lib/postgresql/9.0/main+
Example 2: Make sure the cluster is the same and warn if not, using the result from above.
++ check_postgres_cluster_id --critical=5633695740047915135+
For MRTG output, returns a 1 or 0 indicating success of failure of the identifier to match. A
+identifier must be provided as the --mrtg
argument. The fourth line always gives the
+current identifier.
+
(symlink: check_postgres_commitratio
) Checks the commit ratio of all databases and complains when they are too low.
There is no need to run this command more than once per database cluster.
@@ -1250,7 +1281,7 @@ time, and default to '2 minutes' and '5 minutes' respectively. Valid units
are 'seconds', 'minutes', 'hours', or 'days'. Each may be written singular or
abbreviated to just the first letter. If no units are given, the unit is
assumed to be seconds.
This action requires Postgres 8.3 or better.
+This action requires Postgres 8.1 or better.
Example 1: Give a warning if any query has been running longer than 3 minutes, and a critical if longer than 5 minutes.
check_postgres_query_time --port=5432 --warning='3 minutes' --critical='5 minutes'@@ -1723,6 +1754,32 @@ feature requests, and commit notices, send email to HISTORY
Items not specifically attributed are by GSM (Greg Sabino Mullane).
+ Add the --assume-prod option (Cédric Villemain)+
+ Add the cluster_id check (Cédric Villemain)+
+ Improve settings_checksum and checkpoint tests (Cédric Villemain)+
+ Do no do an inner join to pg_user when checking database size + (Greg Sabino Mullane; reported by Emmanuel Lesouef)+
+ Use the full path when getting sequence information for same_schema. + (Greg Sabino Mullane; reported by Cindy Wise)+
+ Fix the formula for calculating xlog positions (Euler Taveira de Oliveira)+
+ Better ordering of output for bloat check - make indexes as important + as tables (Greg Sabino Mullane; reported by Jens Wilke)+
+ Show the dbservice if it was used at top of same_schema output + (Mike Blackwell)+
+ Better installation paths (Greg Sabino Mullane, per bug 53)+