=head1 VERSION
-This documents describes check_postgres.pl version 1.5.0
+This documents describes B<check_postgres.pl> version 1.5.0
=head1 SYNOPSIS
for more details.
Example 1: Give a warning when the number of connections on host quirm reaches 120, and a critical if it reaches 140.
+
check_postgres_backends --host=quirm --warning=120 --critical=150
Example 2: Give a critical when we reach 75% of our max_connections setting on hosts lancre or lancre2.
+
check_postgres_backends --warning='75%' --critical='75%' --host=lancre,lancre2
Example 3: Give a warning when there are only 10 more connection slots left on host plasmid, and a critical
when we have only 5 left.
+
check_postgres_backends --warning=-10 --critical=-5 --host=plasmid
Example 4: Check all databases except those with "test" in their name, but allow ones that are named "pg_greatest". Connect as port 5432 on the first two hosts, and as port 5433 on the third one. We want to always throw a critical when we reach 30 or more connections.
+
check_postgres_backends --dbhost=hong,kong --dbhost=fooey --dbport=5432 --dbport=5433 --warning=30 --critical=30 --exclude="~test" --include="pg_greatest,~prod"
=item B<bloat> (symlink: C<check_postgres_bloat>)
should give a rough idea of how bloated things are.
Example 1: Warn if any table on port 5432 is over 100 MB bloated, and critical if over 200 MB
+
check_postgres_bloat --port=5432 --warning='100 M', --critical='200 M'
Example 2: Give a critical if table 'orders' on host 'sami' has more than 10 megs of bloat
+
check_postgres_bloat --host=sami --include=orders --critical='10 MB'
=item B<connection> (symlink: check_postgres_connection)
showing both raw bytes and a "pretty" version of the size.
Example 1: Warn if any database on host flagg is over 1 TB in size, and critical if over 1.1 TB.
+
check_postgres_database_size --host=flagg --warning='1 TB' --critical='1.1 t'
Example 2: Give a critical if the database template1 on port 5432 is over 10 MB.
+
check_postgres_database_size --port=5432 --include=template1 --warning='10MB' --critical='10MB'
Example 3: Give a warning if any database on host 'tardis' owned by the user 'tom' is over 5 GB
+
check_postgres_database_size --host=tardis --includeuser=tom --warning='5 GB' --critical='10 GB'
=item B<disk_space> (symlink: C<check_postgres_disk_space>)
This command checks the following things to determine all of the different
physical disks being used by Postgres.
-=over 4
-
-=item B<data_directory>
-
-The disk that the main data directory is on.
+B<data_directory> - The disk that the main data directory is on.
-=item B<log directory>
+B<log directory> - The disk that the log files are on.
-The disk that the log files are on.
+B<WAL file directory> - The disk that the write-ahead logs are on (e.g. symlinked pg_xlog)
-=item B<WAL file directory>
-
-The disk that the write-ahead logs are on (e.g. symlinked pg_xlog)
-
-=item B<tablespaces>
-
-Each tablespace that is on a separate disk
-
-=back
+B<tablespaces> - Each tablespace that is on a separate disk.
The output shows the total size used and available on each disk, as well as
the percentage, ordered by highest to lowest percentage used. Each item above
maps to a file system: these can be included or excluded. See the
-L</"BASIC FILTERING" section for more details.
+L</"BASIC FILTERING"> section for more details.
Example 1: Make sure that no file system is over 90% for the database on port 5432.
+
check_postgres_disk_space --port=5432 --warning='90%' --critical="90%'
Example 2: Check that all file systems starting with /dev/sda are smaller than 10 GB and 11 GB (warning and critical)
+
check_postgres_disk_space --port=5432 --warning='10 GB' --critical='11 GB' --include="~^/dev/sda"
=item B<index_size> (symlink: C<check_postgres_index_size>)
C<ORDER BY size DESC LIMIT (perflimit)>.
Example 1: Give a critical if any table is larger than 600MB on host burrick.
+
check_postgres_table_size --critical='600 MB' --warning='600 MB' --host=burrick
Example 2: Warn if the table products is over 4 GB in size, and give a critical at 4.5 GB.
+
check_postgres_table_size --host=burrick --warning='4 GB' --critical='4.5 GB' --include=products
Example 3: Warn if any index not owned by postgres goes over 500 MB.
+
check_postgres_index_size --port=5432 --excludeuser=postgres -w 500MB -c 600MB
=item B<last_analyze> (symlink: C<check_postgres_last_analyze>)
Example 1: Warn if any table has not been vacuumed in 3 days, and give a
critical at a week, for host wormwood
+
check_last_vacuum --host=wormwood --warning='3d' --critical='7d'
Example 2: Same as above, but skip tables belonging to the users 'eve' or 'mallory'
+
check_last_vacuum --host=wormwood --warning='3d' --critical='7d' --excludeusers=eve,mallory
=item B<listener> (symlink: C<check_postgres_listener>)
check.
Example 1: Give a warning if nobody is listening for the string bucardo_mcp_ping on ports 5555 and 5556
+
check_postgres_listener --port=5555,5556 --warning=bucardo_mcp_ping
Example 2: Give a critical if there are no active LISTEN requests matching 'grimm' on database oskar
+
check_postgres_listener --db oskar --critical=~grimm
=item B<locks> (symlink: C<check_postgres_locks>)
items separated by semicolons.
Example 1: Warn if the number of locks is 100 or more, and critical if 200 or more, on host garrett
+
check_postgres_locks --host=garrett --warning=100 --critical=200
-Example 2: On the host artemus, warn if 200 or more locks exist, and give a critical if over 250 total locks exist,
-or if over 20 exclusive locks exist, or if over 5 connections are waiting for a lock.
+Example 2: On the host artemus, warn if 200 or more locks exist, and give a critical if over 250 total locks exist, or if over 20 exclusive locks exist, or if over 5 connections are waiting for a lock.
+
check_postgres_locks --host=artemus --warning=200 --critical="total=250;waiting=5;exclusive=20"
=item B<logfile> (symlink: C<check_postgres_logfile>)
options should I<not> be used.
Example 1: On port 5432, ensure the logfile is being written to the file /home/greg/pg8.2.log
+
check_postgres_logfile --port=5432 --logfile=/home/greg/pg8.2.log
Example 2: Same as above, but raise a warning, not a critical
+
check_postgres_logfile --port=5432 --logfile=/home/greg/pg8.2.log -w 1
=item B<query_runtime> (symlink: C<check_postgres_query_runtime>)
of a single word (or schema.word), with optional parens at the end.
Example 1: Give a critical if the function named "speedtest" fails to run in 10 seconds or less.
+
check_postgres_query_runtime --queryname='speedtest()' --critical=10 --warning=10
=item B<query_time> (symlink: C<check_postgres_query_time>)
assumed to be seconds.
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'
Example 2: Using default values (2 and 5 minutes), check all databases except those starting with 'template'.
+
check_postgres_query_time --port=5432 --exclude=~^template
Example 3: Warn if user 'don' has a query running over 20 seconds
+
check_postgres_query_time --port=5432 --inclucdeuser=don --warning=20s
=item B<txn_time> (symlink: C<check_postgres_txn_time>)
This action requires Postgres 8.3 or better.
Example 1: Give a critical if any transaction has been open for more than 10 minutes:
+
check_postgres_txn_time --port=5432 --critical='10 minutes'
Example 1: Warn if user 'warehouse' has a transaction open over 30 seconds
+
check_postgres_txn_time --port-5432 --warning=30s --includeuser=warehouse
=item B<txn_idle> (symlink: C<check_postgres_txn_idle>)
This action requires Postgres 8.3 or better.
Example 1: Give a warning if any connection has been idle in transaction for more than 15 seconds:
+
check_postgres_txn_idle --port=5432 --warning='15 seconds'
=item B<rebuild_symlinks>
This action requires the Digest::MD5 module.
Example 1: Find the initial checksum for the database on port 5555 using the default user (usually postgres)
+
check_postgres_settings_checksum --port=5555 --critical=0
Example 2: Make sure no settings have changed and warn if so, using the checksum from above.
+
check_postgres_settings_checksum --port=5555 --warning=cd2f3b5e129dc2b4f5c0f6d8d2e64231
=item B<timesync> (symlink: C<check_postgres_timesync>)
The string returned shows the time difference as well as the time on each side written out.
Example 1: Check that databases on hosts ankh, morpork, and klatch are no more than 3 seconds off from the local time:
+
check_postgres_timesync --host=ankh,morpork.klatch --critical=3
=item B<txn_wraparound> (symlink: C<check_postgres_txn_wraparound>)
The warning and value can have underscores in the number for legibility, as Perl does.
Example 1: Check the default values for the localhost database
+
check_postgres_txn_wraparound --host=localhost
Example 2: Check port 6000 and give a critical at 1.7 billion transactions left:
+
check_postgres_txn_wraparound --port=6000 --critical=1_700_000_000t
=item B<wal_files> (symlink: C<check_postgres_wal_files>)
out of space, at which point Postgres will shut down.
Example 1: Check that the number of WAL files is 20 or less on host "pluto"
+
check_postgres_txn_wraparound --host=pluto --critical=20
=item B<version> (symlink: C<check_version>)
Checks that the required version of Postgres is running. The
B<--warning> and B<--critical> options (only one is required) must be of
-the format B<X.Y> or B<X.Y.Z> where X is the major version number,
-Y is the minor version number, and Z is the revision.
+the format B<X.Y> or B<X.Y.Z> where B<X> is the major version number,
+B<Y> is the minor version number, and B<Z> is the revision.
Example 1: Give a warning if the database on port 5678 is not version 8.4.10:
+
check_postgres_version --port=5678 -w=8.4.10
Example 2: Give a warning if any databases on hosts valley,grain, or sunshine is not 8.3:
+
check_postgres_version -H valley,grain,sunshine --critical=8.3
=back
Examples:
+Only checks items named pg_class:
+
--include=pg_class
- Only checks items named pg_class
+
+Only checks items containing the letters 'pg_':
--include=~pg_
- Only checks items containing the letters 'pg_'
+
+Only check items beginning with 'pg_':
--include=~^pg_
- Only check items beginning with 'pg_'
+
+Exclude the item named 'test':
--exclude=test
- Exclude the item named 'test'
+
+Exclude all items containing the letters 'test:
--exclude=~test
- Exclude all items containing the letters 'test
+
+Exclude all items containing the letters 'ace', but allow the item 'faceoff':
--exclude=~ace --include=faceoff
- Exclude all items containing the letters 'ace', but allow the item 'faceoff'
+
+Exclude all items which start with the letters 'pg_', which contain the letters 'slon',
+or which are named 'sql_settings' or 'green'. Specifically check items with the letters 'prod' in their names, and always check the item named 'pg_relname':
--exclude=~^pg_,~slon,sql_settings --exclude=green --include=~prod,pg_relname
- Exclude all items which start with the letters 'pg_', which contain the letters 'slon', or which are named
- 'sql_settings' or 'green'. Specifically check items with the letters 'prod' in their names, and always
- check the item named 'pg_relname'.
=head1 USER NAME FILTERING
Examples:
+Only check items owned by the user named greg:
+
--includeuser=greg
- Only check items owned by the user named greg
+
+Only check items owned by either watson or crick:
--includeuser=watson,crick
- Only check items owned by either watson or crick
+
+Only check items owned by crick,franklin, watson, or wilkins:
--includeuser=watson --includeuser=franklin --includeuser=crick,wilkins
- Only check items owned by crick,franklin, watson, or wilkins
+
+Check all items except for those belonging to the user scott:
--excludeuser=scott
- Check all items except for those belonging to the user scott
=head1 TEST MODE
=head1 DEPENDENCIES
-=over 4
-
-=item Access to a working version of psql
-
-=item Some very standard Perl modules:
+Access to a working version of psql, and the following very standard Perl modules:
=over 4
-=item L<Cwd>
+=item B<Cwd>
-=item L<Getopt::Long>
+=item B<Getopt::Long>
-=item L<File::Basename>
+=item B<File::Basename>
-=item L<File::Temp>
+=item B<File::Temp>
-=item L<Time::HiRes> (if C<$opt{showtime}> is set to true, which is the default)
+=item B<Time::HiRes> (if C<$opt{showtime}> is set to true, which is the default)
=back
-=back
-
-The B<settings_checksum> action requires the L<Digest::MD5> module.
+The B<settings_checksum> action requires the B<Digest::MD5> module.
Some actions require access to external programs. If psql is not explicitly
specified, the command B<which> is used to find it. The program B</bin/df>
=head1 DEVELOPMENT
Development happens using the git system. You can clone the latest version by doing:
+
git-clone http://bucardo.org/check_postgres.git
=head1 HISTORY
=over 4
-=item B<Version 1.5.0>
+=item B<Version 1.5.0> (April 16, 2008)
Add the --includeuser and --excludeuser options. Documentation cleanup.
Minor documentation fixes.
-=item B<Version 1.4.0>
+=item B<Version 1.4.0> (April 2, 2008)
Have check_wal_files use pg_ls_dir (idea by Robert Treat).
Have txn_idle use query_start, not xact_start.
-=item B<Version 1.3.0>
+=item B<Version 1.3.0> (March 23, 2008)
Add in txn_idle and txn_time actions.
-=item B<Version 1.2.0>
+=item B<Version 1.2.0> (February 21, 2008)
Add the check_wal_files method, which counts the number of WAL files
in your pg_xlog directory.
Switch vacuum and analyze date output to use 'DD', not 'D'. (Glyn Astill)
-=item B<Version 1.1.0>
+=item B<Version 1.1.0> (December 16, 2008)
-Fixes, enhancements, and performance tracking, December 2007
+Fixes, enhancements, and performance tracking.
Add performance data tracking via --showperf and --perflimit
<li><a href="#database_connection_options">DATABASE CONNECTION OPTIONS</a></li>
<li><a href="#other_options">OTHER OPTIONS</a></li>
<li><a href="#actions">ACTIONS</a></li>
- <li><a href="#inclusion_and_exclusion">INCLUSION AND EXCLUSION</a></li>
+ <li><a href="#basic_filtering">BASIC FILTERING</a></li>
+ <li><a href="#user_name_filtering">USER NAME FILTERING</a></li>
<li><a href="#test_mode">TEST MODE</a></li>
<li><a href="#dependencies">DEPENDENCIES</a></li>
<li><a href="#development">DEVELOPMENT</a></li>
</p>
<hr />
<h1><a name="version">VERSION</a></h1>
-<p>This documents describes check_postgres.pl version 1.4.2</p>
+<p>This documents describes <strong>check_postgres.pl</strong> version 1.5.0</p>
<p>
</p>
<hr />
<hr />
<h1><a name="website">WEBSITE</a></h1>
<p>The latest news and documentation can always be found at:</p>
-<p><a href="http://bucardo.org/nagios_postgres/">http://bucardo.org/nagios_postgres/</a></p>
+<p><a href="http://bucardo.org/check_postgres/">http://bucardo.org/check_postgres/</a></p>
<p>
</p>
<hr />
<h1><a name="other_options">OTHER OPTIONS</a></h1>
<p>Other common options include:</p>
<dl>
+<dt><strong><a name="output_val" class="item"><strong>--output=VAL</strong></a></strong>
+
+<dd>
+<p>Determines the format of the output, for use in various programs. The default is 'nagios'. No
+other systems are supported yet.</p>
+</dd>
+</li>
<dt><strong><a name="psql_path" class="item"><strong>PSQL=PATH</strong></a></strong>
<dd>
-<p>Tells the script where to find the psql program. Useful if you have more than one version of the psql executable
-around, or if it is not in your path. Note that this option is in all uppercase. By default, this option is
-<em>not allowed</em>. To enable it, you must change the <code>$NO_PSQL_OPTION</code> near the top of the script to 0. Avoid using
-this option if you can, and instead hard-code your psql location into the <code>$PSQL</code> variable, also near the top
-of the script.</p>
+<p>Tells the script where to find the psql program. Useful if you have more than
+one version of the psql executable on your system, or if there is no psql program
+in your path. Note that this option is in all uppercase. By default, this option
+is <em>not allowed</em>. To enable it, you must change the <code>$NO_PSQL_OPTION</code> near the
+top of the script to 0. Avoid using this option if you can, and instead hard-code
+your psql location into the <code>$PSQL</code> variable, also near the top of the script.</p>
</dd>
</li>
<dt><strong><a name="t_val_or_timeout_val" class="item"><strong>-t VAL</strong> or <strong>--timeout=VAL</strong></a></strong>
<dd>
-<p>Sets the timeout in seconds after which the script will abort whatever it is doing and return an UNKNOWN
-status. The timeout is per Postgres cluster, not for the entire script. The default value is 10; the units
-are always in seconds.</p>
+<p>Sets the timeout in seconds after which the script will abort whatever it is doing
+and return an UNKNOWN status. The timeout is per Postgres cluster, not for the entire
+script. The default value is 10; the units are always in seconds.</p>
</dd>
</li>
<dt><strong><a name="h_or_help" class="item"><strong>-h</strong> or <strong>--help</strong></a></strong>
<dt><strong><a name="v_or_verbose" class="item"><strong>-v</strong> or <strong>--verbose</strong></a></strong>
<dd>
-<p>Set the verbosity level. Can call more than once to boost the level. Setting it to three or higher (in other words,
-issuing <code>-v -v -v</code>) turns on debugging information for this program which is sent to stderr.</p>
+<p>Set the verbosity level. Can call more than once to boost the level. Setting it to three
+or higher (in other words, issuing <code>-v -v -v</code>) turns on debugging information for this
+program which is sent to stderr.</p>
</dd>
</li>
<dt><strong><a name="test" class="item"><strong>--test</strong></a></strong>
<dt><strong><a name="showperf_val" class="item"><strong>--showperf=VAL</strong></a></strong>
<dd>
-<p>Determines if we output performance data in standard Nagios format (at end of string, after a pipe symbol, using
-name=value). VAL should be 0 or 1. The default is 1.</p>
+<p>Determines if we output performance data in standard Nagios format
+(at end of string, after a pipe symbol, using name=value).
+VAL should be 0 or 1. The default is 1.</p>
</dd>
</li>
<dt><strong><a name="perflimit_i" class="item"><strong>--perflimit=i</strong></a></strong>
<dd>
-<p>Sets a limit s to how many items of interest are reported back when using the <strong>showperf</strong> option. This only has
-an effect for actions that return a large number of items, such as <strong>table_size</strong>. The default is 0, or no limit.
-Be careful when using this with --include or --exclude, as those restrictions are done after the query has
-been run, and thus your limit may not include the items you want.</p>
+<p>Sets a limit s to how many items of interest are reported back when using the
+<strong>showperf</strong> option. This only has an effect for actions that return a large
+number of items, such as <strong>table_size</strong>. The default is 0, or no limit. Be
+careful when using this with the <strong>--include</strong> or <strong>--exclude</strong> options, as
+those restrictions are done <em>after</em> the query has been run, and thus your
+limit may not include the items you want.</p>
</dd>
</li>
<dt><strong><a name="showtime_val" class="item"><strong>--showtime=VAL</strong></a></strong>
<dd>
-<p>Determines if the time taken to run each query is shown in the output. VAL should be 0 or 1. The default is 1.
-No effect unless showperf is on.</p>
+<p>Determines if the time taken to run each query is shown in the output. VAL
+should be 0 or 1. The default is 1. No effect unless <strong>showperf</strong> is on.</p>
</dd>
</li>
<dt><strong><a name="action_name" class="item"><strong>--action=NAME</strong></a></strong>
<dd>
-<p>States what action we are running as. Required unless using a symlinked file, in which case the name of the file
-is used to figure out the action.</p>
+<p>States what action we are running. Required unless using a symlinked file,
+in which case the name of the file is used to figure out the action.</p>
</dd>
</li>
</dl>
<p>or use a program named:</p>
<pre>
check_postgres_timesync</pre>
-<p>All the symlinks are created for you if use the action "build_symlinks":</p>
+<p>All the symlinks are created for you in the current directory
+if use the action "build_symlinks":</p>
<pre>
perl check_postgres.pl --action="build_symlinks"</pre>
<p>If the file name already exists, it will not be overwritten. If the file exists
and is a symlink, you can force it to overwrite by using "build_symlinks_force"</p>
-<p>Most actions take a --warning and an -critical option, indicating at what point we change from OK to WARNING
-and then to CRITICAL. Note that because criticals are always checked first, setting the warning equal to the
+<p>Most actions take a <strong>--warning</strong> and an <strong>--critical</strong> option, indicating at what
+point we change from OK to WARNING, and what point we go to CRITICAL. Note that
+because criticals are always checked first, setting the warning equal to the
critical is an effective way to turn warnings off and always give a critical.</p>
<p>The current supported actions are:</p>
<dl>
<dt><strong><a name="backends" class="item"><strong>backends</strong> (symlink: <code>check_postgres_backends</code>)</a></strong>
<dd>
-<p>Checks the current number of connections for one or more databases, and optionally comparing it to the maximum
-allowed, which is determined by the 'max_connections' setting. The warning and option can take one of three forms.
-First, a simple number can be given, which represents the number of connections at which the alert will be given.
-This choice does not use the max_connections setting. Second, the percentage of available connections can be given.
-Third, a negative number can be given which represents the number of connections left until max_connections is
-reached. The default values for warning and critical are '90%' and '95%'. This action also supports the use of the
-include and exclude options to filter out specific databases: see the INCLUDES section below for more detail.</p>
+<p>Checks the current number of connections for one or more databases, and optionally
+compares it to the maximum allowed, which is determined by the
+Postgres configuration variable <strong>max_connections</strong>. The <strong>--warning</strong> and
+<strong>--critical</strong> options can take one of three forms. First, a simple number can be
+given, which represents the number of connections at which the alert will be
+given. This choice does not use the <strong>max_connections</strong> setting. Second, the
+percentage of available connections can be given. Third, a negative number can
+be given which represents the number of connections left until <strong>max_connections</strong>
+is reached. The default values for <strong>--warning</strong> and <strong>--critical</strong> are '90%' and '95%'.
+You can also filter the databases by use of the
+<strong>--include</strong> and <strong>--exclude</strong> options. See the <a href="#basic_filtering">BASIC FILTERING</a> section
+for more details.</p>
+</dd>
+<dd>
+<p>Example 1: Give a warning when the number of connections on host quirm reaches 120, and a critical if it reaches 140.</p>
</dd>
<dd>
-<p>Example 1: Give a warning when the number of connections on host quirm reaches 120, and a critical if it reaches 140.
- check_postgres_backends --host=quirm --warning=120 --critical=150</p>
+<pre>
+ check_postgres_backends --host=quirm --warning=120 --critical=150</pre>
+</dd>
+<dd>
+<p>Example 2: Give a critical when we reach 75% of our max_connections setting on hosts lancre or lancre2.</p>
</dd>
<dd>
-<p>Example 2: Give a critical when we reach 75% of our max_connections setting on hosts lancre or lancre2.
- check_postgres_backends --warning='75%' --critical='75%' --host=lancre,lancre2</p>
+<pre>
+ check_postgres_backends --warning='75%' --critical='75%' --host=lancre,lancre2</pre>
</dd>
<dd>
<p>Example 3: Give a warning when there are only 10 more connection slots left on host plasmid, and a critical
-when we have only 5 left.
- check_postgres_backends --warning=-10 --critical=-5 --host=plasmid</p>
+when we have only 5 left.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_backends --warning=-10 --critical=-5 --host=plasmid</pre>
</dd>
<dd>
<p>Example 4: Check all databases except those with "test" in their name, but allow ones that are named "pg_greatest". Connect as port 5432 on the first two hosts, and as port 5433 on the third one. We want to always throw a critical when we reach 30 or more connections.</p>
<dt><strong><a name="bloat" class="item"><strong>bloat</strong> (symlink: <code>check_postgres_bloat</code>)</a></strong>
<dd>
-<p>Checks the amount of bloat in tables and indexes. This action requires that stats collection be enabled on the
-target databases, and that ANALYZE is run frequently as well. The --include and --exclude options can be used to
-filter out which tables to look at: see the INCLUDE section below for more details. The --warning and --critical
-option must be specified in sizes. Valid units are bytes, kilobytes, megabytes, gigabytes, terabytes, and exabytes.
-You can abbreviate all of those with the first letter. Items without units are assumed to be 'bytes'. The default values
-are '1 GB' and '5 GB'. The number represents the number of "wasted bytes", or the difference between what is actually
-used by the table and index, and what we compute it should be.</p>
+<p>Checks the amount of bloat in tables and indexes. (Bloat is generally the amount
+of dead unused space taken up in a table or index. This space is usually reclaimed
+by use of the VACUUM command.) This action requires that stats collection be
+enabled on the target databases, and requires that ANALYZE is run frequently.
+The <strong>--include</strong> and <strong>--exclude</strong> options can be used to filter out which tables
+to look at. See the <a href="#basic_filtering">BASIC FILTERING</a> section for more details.</p>
+</dd>
+<dd>
+<p>The <strong>--warning</strong> and <strong>--critical</strong> options must be specified as sizes.
+Valid units are bytes, kilobytes, megabytes, gigabytes, terabytes, and exabytes.
+You can abbreviate all of those with the first letter. Items without units are
+assumed to be 'bytes'. The default values are '1 GB' and '5 GB'. The value
+represents the number of "wasted bytes", or the difference between what is actually
+used by the table and index, and what we compute that it should be.</p>
+</dd>
+<dd>
+<p>Note that this action has two hard-coded values to avoid false alarms on
+smaller relations. Tables must have at least 10 pages, and indexes at least 15,
+before they can be considered by this test. If you really want to adjust these
+values, you can look for the variables <strong>$MINPAGES</strong> and <strong>$MINIPAGES</strong> at the top of the
+<code>check_bloat</code> subroutine.</p>
+</dd>
+<dd>
+<p>Please note that the values computed by this action are not precise, and
+should be used as a guideline only. Great effort was made to estimate the
+correct size of a table, but in the end it is only an estimate. The correct
+index size is even more of a guess than the correct table size, but both
+should give a rough idea of how bloated things are.</p>
</dd>
<dd>
-<p>Note that this action has two hard-coded values to avoid false alarms on smaller relations. Tables must have at
-least 10 pages, and indexes at least 15, before they can be considered by this test. If you really want to adjust
-these values, you can look for the variables $MINPAGES and $MINIPAGES at the top of the check_bloat subroutine.</p>
+<p>Example 1: Warn if any table on port 5432 is over 100 MB bloated, and critical if over 200 MB</p>
</dd>
<dd>
-<p>Please note that the values computed by this action are not precise, and should be used as a guideline only. Great
-effort was made to estimate the correct size of a table, but in the end it is only an estimate. The correct index size is
-much more of a guess than the correct table size, but both should give a rough idea of how bloated they are.</p>
+<pre>
+ check_postgres_bloat --port=5432 --warning='100 M', --critical='200 M'</pre>
</dd>
<dd>
-<p>Example 1: Warn if any table on port 5432 is over 100 MB bloated, and critical if over 200 MB
- check_postgres_bloat --port=5432 --warning='100 M', --critical='200 M'</p>
+<p>Example 2: Give a critical if table 'orders' on host 'sami' has more than 10 megs of bloat</p>
</dd>
<dd>
-<p>Example 2: Give a critical if table 'orders' on host 'sami' has more than 10 megs of bloat
- check_postgres_bloat --host=sami --include=orders --critical='10 MB'</p>
+<pre>
+ check_postgres_bloat --host=sami --include=orders --critical='10 MB'</pre>
</dd>
</li>
<dt><strong><a name="connection" class="item"><strong>connection</strong> (symlink: check_postgres_connection)</a></strong>
<dd>
<p>Simply connects, issues a 'SELECT version()', and leaves.
-Takes no --warning or --critical options.</p>
+Takes no <strong>--warning</strong> or <strong>--critical</strong> options.</p>
</dd>
</li>
<dt><strong><a name="database_size" class="item"><strong>database_size</strong> (symlink: <code>check_postgres_database_size</code>)</a></strong>
<dd>
-<p>Checks the size of all databases and complains when they are too big. Makes no sense to run this more than once
-per cluster. Databases can be filtered with the --include and --exclude options: See the INCLUDE section below for more
-detail. The warning and critical can be specified as bytes, kilobytes, megabytes, gigabytes, terabytes, or exabytes.
-Each may be abbreviated to the first letter as well. If no unit is given, the unit is assumed to be bytes.
-There are not defaults for this action: the warning and critical must be specified. The warning cannot be greater than
-the critical. The output returns all databases sorted by size largest first, with both bytes and a "pretty" form
-returned.</p>
+<p>Checks the size of all databases and complains when they are too big.
+There is no need to run this command more than once per database cluster.
+Databases can be filtered with
+the <strong>--include</strong> and <strong>--exclude</strong> options. See the <a href="#basic_filtering">BASIC FILTERING</a> section
+for more details.
+They can also be filtered by the owner of the database with the
+<strong>--includeuser</strong> and <strong>--excludeuser</strong> options.
+See the <a href="#user_name_filtering">USER NAME FILTERING</a> section for more details.</p>
</dd>
<dd>
-<p>Example 1: Warn if any database on host flagg is over 1 TB in size, and critical if over 1.1 TB.
- check_postgres_database_size --host=flagg --warning='1 TB' --critical='1.1 t'</p>
+<p>The warning and critical options can be specified as bytes, kilobytes, megabytes,
+gigabytes, terabytes, or exabytes. Each may be abbreviated to the first letter as well.
+If no unit is given, the units are assumed to be bytes. There are not defaults for this
+action: the warning and critical must be specified. The warning value cannot be greater
+than the critical value. The output returns all databases sorted by size largest first,
+showing both raw bytes and a "pretty" version of the size.</p>
</dd>
<dd>
-<p>Example 2: Give a critical if the database template1 on port 5432 is over 10 MB.
- check_postgres_database_size --port=5432 --include=template1 --warning='10MB' --critical='10MB'</p>
+<p>Example 1: Warn if any database on host flagg is over 1 TB in size, and critical if over 1.1 TB.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_database_size --host=flagg --warning='1 TB' --critical='1.1 t'</pre>
+</dd>
+<dd>
+<p>Example 2: Give a critical if the database template1 on port 5432 is over 10 MB.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_database_size --port=5432 --include=template1 --warning='10MB' --critical='10MB'</pre>
+</dd>
+<dd>
+<p>Example 3: Give a warning if any database on host 'tardis' owned by the user 'tom' is over 5 GB</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_database_size --host=tardis --includeuser=tom --warning='5 GB' --critical='10 GB'</pre>
</dd>
</li>
<dt><strong><a name="disk_space" class="item"><strong>disk_space</strong> (symlink: <code>check_postgres_disk_space</code>)</a></strong>
<dd>
-<p>Checks on the available physical disk space used by Postgres. This action requires that you have the executable "/bin/df"
-available to report on disk sizes, and it requires that it be run as a superuser, so it can examine the 'data_directory'
-setting inside of Postgres. The --warning and --critical options are given in either sizes or percentages. If using sizes,
-the standard unit types are allowed: bytes, kilobytes, gigabytes, megabytes, gigabytes, terabytes, or exabytes. Each
-may be abbreviated to the first letter only; no units at all indicates 'bytes'. The default values are '90%' and '95%'.</p>
+<p>Checks on the available physical disk space used by Postgres. This action requires
+that you have the executable "/bin/df" available to report on disk sizes, and it
+also needs to be run as a superuser, so it can examine the <strong>data_directory</strong>
+setting inside of Postgres. The <strong>--warning</strong> and <strong>--critical</strong> options are
+given in either sizes or percentages. If using sizes, the standard unit types
+are allowed: bytes, kilobytes, gigabytes, megabytes, gigabytes, terabytes, or
+exabytes. Each may be abbreviated to the first letter only; no units at all
+indicates 'bytes'. The default values are '90%' and '95%'.</p>
</dd>
<dd>
-<p>This command checks the following things to determine all of the different physical disks being used by Postgres.</p>
+<p>This command checks the following things to determine all of the different
+physical disks being used by Postgres.</p>
</dd>
-<dl>
-<dt><strong><a name="data_directory" class="item"><strong>data_directory</strong></a></strong>
-
<dd>
-<p>The disk that the main data directory is on.</p>
+<p><strong>data_directory</strong> - The disk that the main data directory is on.</p>
</dd>
-</li>
-<dt><strong><a name="log_directory" class="item"><strong>log directory</strong></a></strong>
-
<dd>
-<p>The disk that the log files are on.</p>
+<p><strong>log directory</strong> - The disk that the log files are on.</p>
</dd>
-</li>
-<dt><strong><a name="wal_file_directory" class="item"><strong>WAL file directory</strong></a></strong>
-
<dd>
-<p>The disk that the write-ahead logs are on (e.g. symlinked pg_xlog)</p>
+<p><strong>WAL file directory</strong> - The disk that the write-ahead logs are on (e.g. symlinked pg_xlog)</p>
+</dd>
+<dd>
+<p><strong>tablespaces</strong> - Each tablespace that is on a separate disk.</p>
+</dd>
+<dd>
+<p>The output shows the total size used and available on each disk, as well as
+the percentage, ordered by highest to lowest percentage used. Each item above
+maps to a file system: these can be included or excluded. See the
+<a href="#basic_filtering">BASIC FILTERING</a> section for more details.</p>
+</dd>
+<dd>
+<p>Example 1: Make sure that no file system is over 90% for the database on port 5432.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_disk_space --port=5432 --warning='90%' --critical="90%'</pre>
+</dd>
+<dd>
+<p>Example 2: Check that all file systems starting with /dev/sda are smaller than 10 GB and 11 GB (warning and critical)</p>
</dd>
-</li>
-<dt><strong><a name="tablespaces" class="item"><strong>tablespaces</strong></a></strong>
-
<dd>
-<p>Each tablespace that is on a separate disk</p>
+<pre>
+ check_postgres_disk_space --port=5432 --warning='10 GB' --critical='11 GB' --include="~^/dev/sda"</pre>
</dd>
</li>
-</dl>
-<p>The output shows the total size used and available on each disk, as well as the percentage, ordered by highest to lowest
-percentage used. Each item above maps to a file system: these can be included or excluded: see the INCLUDE section below
-for more information on the --include and --exclude options.</p>
-<p>Example 1: Make sure that no file system is over 90% for the database on port 5432.
- check_postgres_disk_space --port=5432 --warning='90%' --critical="90%'</p>
-<p>Example 2: Check that all file systems starting with /dev/sda are smaller than 10 GB and 11 GB (warning and critical)
- check_postgres_disk_space --port=5432 --warning='10 GB' --critical='11 GB' --include=~^/dev/sda</p>
<dt><strong><a name="index_size" class="item"><strong>index_size</strong> (symlink: <code>check_postgres_index_size</code>)</a></strong>
<dt><strong><a name="table_size" class="item"><strong>table_size</strong> (symlink: <code>check_postgres_table_size</code>)</a></strong>
<dt><strong><a name="relation_size" class="item"><strong>relation_size</strong> (symlink: <code>check_postgres_relation_size</code>)</a></strong>
<dd>
-<p>The actions table_size and index_size are simply variations of the relation_size index, which checks for a relation
-that has grown too big. Relations (in other words, tables and indexes) can be filtered with the --include and
---exclude options: See the INCLUDE section below for more detail. The warning and critical are given in file sizes, and
-can have units of bytes, kilobytes, megabytes, gigabytes, terabytes, or exabytes. Each can be abbreviated to the
-first letter, only. If no units are given, bytes is assumed. There are no default values: both warning and critical
+<p>The actions <strong>table_size</strong> and <strong>index_size</strong> are simply variations of the
+<strong>relation_size</strong> action, which checks for a relation that has grown too big.
+Relations (in other words, tables and indexes) can be filtered with the
+<strong>--include</strong> and <strong>--exclude</strong> options. See the <a href="#basic_filtering">BASIC FILTERING</a> section
+for more details. Relations can also be filtered by the user that owns them,
+by using the <strong>--includeuser</strong> and <strong>--excludeuser</strong> options.
+See the <a href="#user_name_filtering">USER NAME FILTERING</a> section for more details.</p>
+</dd>
+<dd>
+<p>The values for the <strong>--warning</strong> and <strong>--critical</strong> options are file sizes, and
+may have units of bytes, kilobytes, megabytes, gigabytes, terabytes, or exabytes.
+Each can be abbreviated to the first letter. If no units are given, bytes are
+assumed. There are no default values: both the warning and the critical option
must be given. The return text shows the size of the largest relation found.</p>
</dd>
<dd>
-<p>If the <strong>showperf</strong> option is enabled, <em>all</em> of the relations with their sizes will be given. To prevent this, is
-is recommended that you set the <strong>perflimit</strong>, which will cause the query to do a <code>ORDER BY size DESC LIMIT (perflimit)</code>.</p>
+<p>If the <strong>--showperf</strong> option is enabled, <em>all</em> of the relations with their sizes
+will be given. To prevent this, it is recommended that you set the
+<strong>--perflimit</strong> option, which will cause the query to do a
+<code>ORDER BY size DESC LIMIT (perflimit)</code>.</p>
+</dd>
+<dd>
+<p>Example 1: Give a critical if any table is larger than 600MB on host burrick.</p>
</dd>
<dd>
-<p>Example 1: Give a critical if any table is larger than 600MB on host burrick.
- check_postgres_table_size --critical='600 MB' --warning='600 MB' --host=burrick</p>
+<pre>
+ check_postgres_table_size --critical='600 MB' --warning='600 MB' --host=burrick</pre>
+</dd>
+<dd>
+<p>Example 2: Warn if the table products is over 4 GB in size, and give a critical at 4.5 GB.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_table_size --host=burrick --warning='4 GB' --critical='4.5 GB' --include=products</pre>
</dd>
<dd>
-<p>Example 2: Warn if the table products is over 4 GB in size, and give a critical at 4.5 GB.
- check_postgres_table_size --host=burrick --warning='4 GB' --critical='4.5 GB' --include=products</p>
+<p>Example 3: Warn if any index not owned by postgres goes over 500 MB.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_index_size --port=5432 --excludeuser=postgres -w 500MB -c 600MB</pre>
</dd>
</li>
<dt><strong><a name="last_analyze" class="item"><strong>last_analyze</strong> (symlink: <code>check_postgres_last_analyze</code>)</a></strong>
<dt><strong><a name="last_vacuum" class="item"><strong>last_vacuum</strong> (symlink: <code>check_postgres_last_vacuum</code>)</a></strong>
<dd>
-<p>Checks how long it has been since vacuum (or analyze) was last run on each table in one or more databases. This requires
-that stats_rows_level is enabled, and the target database must be version 8.2 or higher. Tables can be excluded and
-included: see the INCLUDE section below for details. The units for --warning and --critical are times. Valid units are
-seconds, minutes, hours, and days; all can be abbreviated to the first letter. If no units are given, 'seconds' is assumed.
-The default values are '1 day' and '2 days'. Please note that there are cases in which this field does not get
-automatically populated. If certain tables are giving you problems, make sure that they have dead rows to vacuum,
+<p>Checks how long it has been since vacuum (or analyze) was last run on each
+table in one or more databases. Use of these actions requires that the Postgres
+configuration variable <strong>stats_rows_level</strong> is enabled, and that the target
+database is version 8.2 or higher. Tables can be filtered with the
+<strong>--include</strong> and <strong>--exclude</strong> options. See the <a href="#basic_filtering">BASIC FILTERING</a> section
+for more details.
+Tables can also be filtered by their owner by use of the
+<strong>--includeuser</strong> and <strong>--excludeuser</strong> options.
+See the <a href="#user_name_filtering">USER NAME FILTERING</a> section for more details.</p>
+</dd>
+<dd>
+<p>The units for <strong>--warning</strong> and <strong>--critical</strong> are specified as times.
+Valid units are seconds, minutes, hours, and days; all can be abbreviated
+to the first letter. If no units are given, 'seconds' are assumed. The
+default values are '1 day' and '2 days'. Please note that there are cases
+in which this field does not get automatically populated. If certain tables
+are giving you problems, make sure that they have dead rows to vacuum,
or just exclude them from the test.</p>
</dd>
<dd>
-<p>Example 1: Warn if any table has not been vacuumed in 3 days, and give a critical at a week, for host wormwood
- check_last_vacuum --host=wormwood --warning='3d' --critical='7d'</p>
+<p>Example 1: Warn if any table has not been vacuumed in 3 days, and give a
+critical at a week, for host wormwood</p>
+</dd>
+<dd>
+<pre>
+ check_last_vacuum --host=wormwood --warning='3d' --critical='7d'</pre>
+</dd>
+<dd>
+<p>Example 2: Same as above, but skip tables belonging to the users 'eve' or 'mallory'</p>
+</dd>
+<dd>
+<pre>
+ check_last_vacuum --host=wormwood --warning='3d' --critical='7d' --excludeusers=eve,mallory</pre>
</dd>
</li>
<dt><strong><a name="listener" class="item"><strong>listener</strong> (symlink: <code>check_postgres_listener</code>)</a></strong>
check.</p>
</dd>
<dd>
-<p>Example 1: Give a warning if nobody is listening for the string bucardo_mcp_ping on ports 5555 and 5556
- check_postgres_listener --port=5555,5556 --warning=bucardo_mcp_ping</p>
+<p>Example 1: Give a warning if nobody is listening for the string bucardo_mcp_ping on ports 5555 and 5556</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_listener --port=5555,5556 --warning=bucardo_mcp_ping</pre>
</dd>
<dd>
-<p>Example 2: Give a critical if there are no active LISTEN requests matching 'grimm' on database oskar
- check_postgres_listener --db oskar --critical=~grimm</p>
+<p>Example 2: Give a critical if there are no active LISTEN requests matching 'grimm' on database oskar</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_listener --db oskar --critical=~grimm</pre>
</dd>
</li>
<dt><strong><a name="locks" class="item"><strong>locks</strong> (symlink: <code>check_postgres_locks</code>)</a></strong>
<dd>
-<p>Check the total number of locks on one or more databases. Makes no sense to run this more than once per cluster.
-Databases can be filtered with the --include and --exclude options: See the INCLUDE section below for more detail.
-The warning and critical can be specified as simple numbers, which represent the total number of locks, or they can
-be broken down by type of lock. Valid lock names are "total", "waiting", or a type of lock used by Postgres.
-These names are case-insensitive and do not need the "lock" part on the end, so 'exclusive' will match
-'ExclusiveLock'. The format is name=number, with different items separated by semicolons.</p>
+<p>Check the total number of locks on one or more databases. There is no
+need to run this more than once per database cluster. Databases can be filtered
+with the <strong>--include</strong> and <strong>--exclude</strong> options. See the <a href="#basic_filtering">BASIC FILTERING</a> section
+for more details.</p>
+</dd>
+<dd>
+<p>The <strong>--warning</strong> and <strong>--critical</strong> options can be specified as simple numbers,
+which represent the total number of locks, or they can be broken down by type of lock.
+Valid lock names are <code>'total'</code>, <code>'waiting'</code>, or the name of a lock type used by Postgres.
+These names are case-insensitive and do not need the "lock" part on the end,
+so <strong>exclusive</strong> will match 'ExclusiveLock'. The format is name=number, with different
+items separated by semicolons.</p>
</dd>
<dd>
-<p>Example 1: Warn if the number of locks is 100 or more, and critical if 200 or more, on host garrett
- check_postgres_locks --host=garrett --warning=100 --critical=200</p>
+<p>Example 1: Warn if the number of locks is 100 or more, and critical if 200 or more, on host garrett</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_locks --host=garrett --warning=100 --critical=200</pre>
</dd>
<dd>
-<p>Example 2: On the host artemus, warn if 200 or more locks exist, and give a critical if over 250 total locks exist,
-or if over 20 exclusive locks exist, or if over 5 connections are waiting for a lock.
- check_postgres_locks --host=artemus --warning=200 --critical="total=250;waiting=5;exclusive=20"</p>
+<p>Example 2: On the host artemus, warn if 200 or more locks exist, and give a critical if over 250 total locks exist, or if over 20 exclusive locks exist, or if over 5 connections are waiting for a lock.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_locks --host=artemus --warning=200 --critical="total=250;waiting=5;exclusive=20"</pre>
</dd>
</li>
<dt><strong><a name="logfile" class="item"><strong>logfile</strong> (symlink: <code>check_postgres_logfile</code>)</a></strong>
<dd>
-<p>Ensures that the logfile is in the expected location and is being logged to. This action issues a command that throws
-an error on each database it is checking, and ensures that the message shows up in the logs. It scans the various
-log_* settings inside of Postgres to figure out where the logs should be. If you are using syslog, it does a rough
-but not foolproof scan of /etc/syslog,conf. Alternatively, you can provide the name of the logfile with the --logfile
-option. This is especially useful if the logs have a custom rotation scheme driven be an external program. The
---logfile option supports the following escape characters: %Y %m %d %H, which represent the current year, month, date,
-and hour respectively. An error is always reported as critical unless the warning option has been passed in as a
-non-zero value. Other than that specific usage, the --warning and --critical options should not be used.</p>
+<p>Ensures that the logfile is in the expected location and is being logged to.
+This action issues a command that throws an error on each database it is
+checking, and ensures that the message shows up in the logs. It scans the
+various log_* settings inside of Postgres to figure out where the logs should be.
+If you are using syslog, it does a rough (but not foolproof) scan of
+<em class="file">/etc/syslog.conf</em>. Alternatively, you can provide the name of the logfile
+with the <strong>--logfile</strong> option. This is especially useful if the logs have a
+custom rotation scheme driven be an external program. The <strong>--logfile</strong> option
+supports the following escape characters: <code>%Y %m %d %H</code>, which represent
+the current year, month, date, and hour respectively. An error is always
+reported as critical unless the warning option has been passed in as a non-zero
+value. Other than that specific usage, the <code>--warning</code> and <code>--critical</code>
+options should <em>not</em> be used.</p>
</dd>
<dd>
-<p>Example 1: On port 5432, ensure the logfile is being written to the file /home/greg/pg8.2.log
- check_postgres_logfile --port=5432 --logfile=/home/greg/pg8.2.log</p>
+<p>Example 1: On port 5432, ensure the logfile is being written to the file /home/greg/pg8.2.log</p>
</dd>
<dd>
-<p>Example 2: Same as above, but raise a warning, not a critical
- check_postgres_logfile --port=5432 --logfile=/home/greg/pg8.2.log -w 1</p>
+<pre>
+ check_postgres_logfile --port=5432 --logfile=/home/greg/pg8.2.log</pre>
+</dd>
+<dd>
+<p>Example 2: Same as above, but raise a warning, not a critical</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_logfile --port=5432 --logfile=/home/greg/pg8.2.log -w 1</pre>
</dd>
</li>
<dt><strong><a name="query_runtime" class="item"><strong>query_runtime</strong> (symlink: <code>check_postgres_query_runtime</code>)</a></strong>
<dd>
-<p>Checks how long a specific query takes to run, by executing a "EXPLAIN ANALYZE" against it. The --warning and --critical
-options are the maximum amount of time the query should take. Valid units are seconds, minutes, and hours; any can be
-abbreviated to the first letter. If no units are given, 'seconds' is assumed. Both warning and critical must be given.
-The name of the view or function to be run must be passed in to the --queryname
-option. It must consist of a single word (or schema.word format), with optional parens at the end.</p>
+<p>Checks how long a specific query takes to run, by executing a "EXPLAIN ANALYZE"
+against it. The <strong>--warning</strong> and <strong>--critical</strong> options are the maximum amount of
+time the query should take. Valid units are seconds, minutes, and hours; any can be
+abbreviated to the first letter. If no units are given, 'seconds' are assumed.
+Both the warning and the critical option must be given. The name of the view or
+function to be run must be passed in to the <strong>--queryname</strong> option. It must consist
+of a single word (or schema.word), with optional parens at the end.</p>
+</dd>
+<dd>
+<p>Example 1: Give a critical if the function named "speedtest" fails to run in 10 seconds or less.</p>
</dd>
<dd>
-<p>Example 1: Give a critical if the function named "speedtest" fails to run in 10 seconds or less.
- check_postgres_query_runtime --queryname='speedtest()' --critical=10 --warning=10</p>
+<pre>
+ check_postgres_query_runtime --queryname='speedtest()' --critical=10 --warning=10</pre>
</dd>
</li>
<dt><strong><a name="query_time" class="item"><strong>query_time</strong> (symlink: <code>check_postgres_query_time</code>)</a></strong>
<dd>
-<p>Checks the length of running queries on one or more databases. It makes no sense to run this more than once
-on the same cluster (all databases are returned no matter where you connect from). Databases can be included or
-excluded with the --include and --exclude option: see the INCLUDE section below for more details. The warning and
-critical options are an amount of time, and default to '2 minutes' and '5 minutes'. 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.</p>
+<p>Checks the length of running queries on one or more databases. There is
+no need to run this more than once on the same database cluster.
+Databases can be filtered
+by using the <strong>--include</strong> and <strong>--exclude</strong> options. See the <a href="#basic_filtering">BASIC FILTERING</a>
+section for more details. You can also filter on the user running the
+query with the <strong>--includeuser</strong> and <strong>--excludeuser</strong> options.
+See the <a href="#user_name_filtering">USER NAME FILTERING</a> section for more details.</p>
+</dd>
+<dd>
+<p>The values for the <strong>--warning</strong> and <strong>--critical</strong> options are amounts of
+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.</p>
+</dd>
+<dd>
+<p>Example 1: Give a warning if any query has been running longer than 3 minutes, and a critical if longer than 5 minutes.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_query_time --port=5432 --warning='3 minutes' --critical='5 minutes'</pre>
+</dd>
+<dd>
+<p>Example 2: Using default values (2 and 5 minutes), check all databases except those starting with 'template'.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_query_time --port=5432 --exclude=~^template</pre>
</dd>
<dd>
-<p>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'</p>
+<p>Example 3: Warn if user 'don' has a query running over 20 seconds</p>
</dd>
<dd>
-<p>Example 2: Using default values (2 and 5 minutes), check all databases except those starting with 'template'.
- check_postgres_query_time --port=5432 --exclude=~^template</p>
+<pre>
+ check_postgres_query_time --port=5432 --inclucdeuser=don --warning=20s</pre>
</dd>
</li>
<dt><strong><a name="txn_time" class="item"><strong>txn_time</strong> (symlink: <code>check_postgres_txn_time</code>)</a></strong>
<dd>
-<p>Checks the length of open transactions on one or more databases. It makes no sense to run this more than once
-on the same cluster (all databases are returned no matter where you connect from). Databases can be included or
-excluded with the --include and --exclude option: see the INCLUDE section below for more details. The warning and
-critical options are an amount of time, and must be provided (no default). 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. Requires Postgres 8.3 or better.</p>
+<p>Checks the length of open transactions on one or more databases.
+There is no need to run this command more than once per database cluster.
+Databases can be filtered by use of the
+<strong>--include</strong> and <strong>--exclude</strong> options. See the <a href="#basic_filtering">BASIC FILTERING</a> section
+for more details. The owner of the transaction can also be filtered, by use of
+the <strong>--includeuser</strong> and <strong>--excludeuser</strong> options.
+See the <a href="#user_name_filtering">USER NAME FILTERING</a> section for more details.</p>
+</dd>
+<dd>
+<p>The values or the <strong>--warning</strong> and <strong>--critical</strong> options are units of time, and
+must be provided (no default). 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 units are assumed to be seconds.</p>
+</dd>
+<dd>
+<p>This action requires Postgres 8.3 or better.</p>
</dd>
<dd>
-<p>Example 1: Give a critical if any transaction has been open for more than 10 minutes:
- check_postgres_txn_time --port=5432 --critical='10 minutes'</p>
+<p>Example 1: Give a critical if any transaction has been open for more than 10 minutes:</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_txn_time --port=5432 --critical='10 minutes'</pre>
+</dd>
+<dd>
+<p>Example 1: Warn if user 'warehouse' has a transaction open over 30 seconds</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_txn_time --port-5432 --warning=30s --includeuser=warehouse</pre>
</dd>
</li>
<dt><strong><a name="txn_idle" class="item"><strong>txn_idle</strong> (symlink: <code>check_postgres_txn_idle</code>)</a></strong>
<dd>
-<p>Checks the length of "idle in transaction" queries on one or more databases. It makes no sense to run this more than once
-on the same cluster (all databases are returned no matter where you connect from). Databases can be included or
-excluded with the --include and --exclude option: see the INCLUDE section below for more details. The warning and
-critical options are an amount of time, and must be provided (no default). 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. Requires Postgres 8.3 or better.</p>
+<p>Checks the length of "idle in transaction" queries on one or more databases. There is
+no need to run this more than once on the same database cluster. Databases can be filtered
+by using the <strong>--include</strong> and <strong>--exclude</strong> options. See the <a href="#basic_filtering">BASIC FILTERING</a>
+section below for more details.</p>
+</dd>
+<dd>
+<p>The <strong>--warning</strong> and <strong>--critical</strong> options are given as units of time, and both must
+be provided (there are no defaults). 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 are assumed to be seconds.</p>
+</dd>
+<dd>
+<p>This action requires Postgres 8.3 or better.</p>
</dd>
<dd>
-<p>Example 1: Give a warning if any connection has been idle in transaction for more than 15 seconds:
- check_postgres_txn_idle --port=5432 --warning='15 seconds'</p>
+<p>Example 1: Give a warning if any connection has been idle in transaction for more than 15 seconds:</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_txn_idle --port=5432 --warning='15 seconds'</pre>
</dd>
</li>
<dt><strong><a name="rebuild_symlinks" class="item"><strong>rebuild_symlinks</strong></a></strong>
<dt><strong><a name="rebuild_symlinks_force" class="item"><strong>rebuild_symlinks_force</strong></a></strong>
<dd>
-<p>This action requires no other arguments, and does not create to any databases, but simply creates symlinks for
-each action, in the form "check_postgres_<action_name>". If the file already exists, it will not be overwritten.
-If the action is rebuild_symlinks_force, then symlinks will be overwritten.</p>
+<p>This action requires no other arguments, and does not connect to any databases,
+but simply creates symlinks in the current directory for each action, in the form
+<strong>check_postgres_<action_name></strong>.
+ If the file already exists, it will not be overwritten. If the action is rebuild_symlinks_force,
+then symlinks will be overwritten.</p>
</dd>
</li>
<dt><strong><a name="settings_checksum" class="item"><strong>settings_checksum</strong> (symlink: <code>check_postgres_settings_checksum</code>)</a></strong>
<dd>
-<p>Check that all the Postgres settings are the same as last time you checked. This is done by generating a checksum
-of a sorted list of setting names and their values. Note that different users in the same database may have
-different checksums, due to ALTER USER usage, and due to the fact that superusers see more settings than
-ordinary users. Either the --warning or the --critical should be given. but not both. The value of each one is
-the checksum, a 32-character hexadecimal value. You can run with the special --critical=0 option to find out
-an existing checksum.</p>
+<p>Check that all the Postgres settings are the same as last time you checked.
+This is done by generating a checksum of a sorted list of setting names and
+their values. Note that different users in the same database may have different
+checksums, due to ALTER USER usage, and due to the fact that superusers see more
+settings than ordinary users. Either the <strong>--warning</strong> or the <strong>--critical</strong> option
+should be given, but not both. The value of each one is the checksum, a
+32-character hexadecimal value. You can run with the special <code>--critical=0</code> option
+to find out an existing checksum.</p>
</dd>
<dd>
<p>This action requires the Digest::MD5 module.</p>
</dd>
<dd>
-<p>Example 1: Find the initial checksum for the database on port 5555 using the default user (usually postgres)
- check_postgres_settings_checksum --port=5555 --critical=0</p>
+<p>Example 1: Find the initial checksum for the database on port 5555 using the default user (usually postgres)</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_settings_checksum --port=5555 --critical=0</pre>
</dd>
<dd>
-<p>Example 2: Make sure no settings have changed and warn if so, using the checksum from above.
- check_postgres_settings_checksum --port=5555 --warning=cd2f3b5e129dc2b4f5c0f6d8d2e64231</p>
+<p>Example 2: Make sure no settings have changed and warn if so, using the checksum from above.</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_settings_checksum --port=5555 --warning=cd2f3b5e129dc2b4f5c0f6d8d2e64231</pre>
</dd>
</li>
<dt><strong><a name="timesync" class="item"><strong>timesync</strong> (symlink: <code>check_postgres_timesync</code>)</a></strong>
<dd>
-<p>Compares the local system time with the time reported by one or more databases. The warning and critical options represent
-the number of seconds at which the warning or critical should be given. If neither is specified, the default values
-are used, which are '2' and '5'. The warning cannot be greater than the critical. Due to the non-exact nature of this
-test, a value of '0' or '1' is not recommended.</p>
+<p>Compares the local system time with the time reported by one or more databases.
+The <strong>--warning</strong> and <strong>--critical</strong> options represent the number of seconds between
+the two systems before an alert is given. If neither is specified, the default values
+are used, which are '2' and '5'. The warning value cannot be greater than the critical
+value. Due to the non-exact nature of this test, values of '0' or '1' are not recommended.</p>
</dd>
<dd>
<p>The string returned shows the time difference as well as the time on each side written out.</p>
</dd>
<dd>
-<p>Example 1: Check that databases on hosts ankh, morpork, and klatch are no more than 3 seconds off from the local time:
- check_postgres_timesync --host=ankh,morpork.klatch --critical=3</p>
+<p>Example 1: Check that databases on hosts ankh, morpork, and klatch are no more than 3 seconds off from the local time:</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_timesync --host=ankh,morpork.klatch --critical=3</pre>
</dd>
</li>
<dt><strong><a name="txn_wraparound" class="item"><strong>txn_wraparound</strong> (symlink: <code>check_postgres_txn_wraparound</code>)</a></strong>
<dd>
-<p>Checks how close to transaction wraparound one or more databases are getting. The warning and critical indicate
-the number of transactions left and must be a positive integer. If either is not given, the default values of
-1.3 and 1.4 billion are used. It makes no sense to run this check more than once on a single cluster. For a more
-detailed discussion of what this number represents and what to do about it, please visit the page
+<p>Checks how close to transaction wraparound one or more databases are getting.
+The <strong>--warning</strong> and <strong>--critical</strong> options indicate the number of transactions
+left, and must be a positive integer. If either option is not given, the default
+values of 1.3 and 1.4 billion are used. There is no need to run this command
+more than once per database cluster. For a more detailed discussion of what this
+number represents and what to do about it, please visit the page
<a href="http://www.postgresql.org/docs/current/static/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND">http://www.postgresql.org/docs/current/static/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND</a></p>
</dd>
<dd>
<p>The warning and value can have underscores in the number for legibility, as Perl does.</p>
</dd>
<dd>
-<p>Example 1: Check the default values for the localhost database
- check_postgres_txn_wraparound --host=localhost</p>
+<p>Example 1: Check the default values for the localhost database</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_txn_wraparound --host=localhost</pre>
+</dd>
+<dd>
+<p>Example 2: Check port 6000 and give a critical at 1.7 billion transactions left:</p>
</dd>
<dd>
-<p>Example 2: Check port 6000 and give a critical at 1.7 billion transactions left:
- check_postgres_txn_wraparound --port=6000 --critical=1_700_000_000t</p>
+<pre>
+ check_postgres_txn_wraparound --port=6000 --critical=1_700_000_000t</pre>
</dd>
</li>
<dt><strong><a name="wal_files" class="item"><strong>wal_files</strong> (symlink: <code>check_postgres_wal_files</code>)</a></strong>
<dd>
-<p>Checks how many WAL files exist in the pg_xlog file, which is found off of your data directory, sometimes
-as a symlink to another disk for performance reasons. This must be run as a superuser, in order to
-access the contents of the pg_xlog directory. The minimum version to use this action is 8.1. The
-warning and critical are simply the number of files in the pg_xlog directory. What number to set this
-to will vary, but a general guideline is to put a number slightly higher than what is normally there,
-to catch problems early.</p>
+<p>Checks how many WAL files exist in the <em class="file">pg_xlog</em> directory, which is found
+off of your <strong>data_directory</strong>, sometimes as a symlink to another physical disk for
+performance reasons. This action must be run as a superuser, in order to access the
+contents of the <em class="file">pg_xlog</em> directory. The minimum version to use this action is
+Postgres 8.1. The <strong>--warning</strong> and <strong>--critical</strong> options are simply the number of
+files in the <em class="file">pg_xlog</em> directory. What number to set this to will vary, but a general
+guideline is to put a number slightly higher than what is normally there, to catch
+problems early.</p>
+</dd>
+<dd>
+<p>Normally, WAL files are closed and then re-used, but a long-running open
+transaction, or a faulty <strong>archive_command</strong> script, may cause Postgres to
+create too many files. Ultimately, this will cause the disk they are on to run
+out of space, at which point Postgres will shut down.</p>
</dd>
<dd>
-<p>Normally, WAL files are closed and then re-used, but a long-running open transaction, or a faulty
-log shipping method, may cause Postgres to create too many files. Ultimately, this will cause the
-disk they are on to run out of space, at which point Postgres will shut down.</p>
+<p>Example 1: Check that the number of WAL files is 20 or less on host "pluto"</p>
</dd>
<dd>
-<p>Example 1: Check that the number of WAL files is 20 or less on host "pluto"
- check_postgres_txn_wraparound --host=pluto --critical=20</p>
+<pre>
+ check_postgres_txn_wraparound --host=pluto --critical=20</pre>
</dd>
</li>
<dt><strong><a name="version" class="item"><strong>version</strong> (symlink: <code>check_version</code>)</a></strong>
<dd>
-<p>Checks that the required version of Postgres is running. The --warning and --critical arguments (only one is required)
-must be of the format X.Y or X.Y.Z where X is the major version number, Y is the minor version number, and Z is the
-revision.</p>
+<p>Checks that the required version of Postgres is running. The
+<strong>--warning</strong> and <strong>--critical</strong> options (only one is required) must be of
+the format <strong>X.Y</strong> or <strong>X.Y.Z</strong> where <strong>X</strong> is the major version number,
+<strong>Y</strong> is the minor version number, and <strong>Z</strong> is the revision.</p>
</dd>
<dd>
-<p>Example 1: Give a warning if the database on port 5678 is not version 8.4.10:
- check_postgres_version --port=5678 -w=8.4.10</p>
+<p>Example 1: Give a warning if the database on port 5678 is not version 8.4.10:</p>
</dd>
<dd>
-<p>Example 2: Give a warning if any databases on hosts valley,grain, or sunshine is not 8.3:
- check_postgres_version -H valley,grain,sunshine --critical=8.3</p>
+<pre>
+ check_postgres_version --port=5678 -w=8.4.10</pre>
+</dd>
+<dd>
+<p>Example 2: Give a warning if any databases on hosts valley,grain, or sunshine is not 8.3:</p>
+</dd>
+<dd>
+<pre>
+ check_postgres_version -H valley,grain,sunshine --critical=8.3</pre>
</dd>
</li>
</dl>
<p>
</p>
<hr />
-<h1><a name="inclusion_and_exclusion">INCLUSION AND EXCLUSION</a></h1>
-<p>The options --include and --exclude can be combined to limit which things are checked, depending on the action.
-The name of the database can be filtered when using the following actions:
+<h1><a name="basic_filtering">BASIC FILTERING</a></h1>
+<p>The options <strong>--include</strong> and <strong>--exclude</strong> can be combined to limit which
+things are checked, depending on the action. The name of the database can
+be filtered when using the following actions:
backends, database_size, last_vacuum, last_analyze, locks, and query_time.
The name of a relation can be filtered when using the following actions:
bloat, index_size, table_size, and relation_size.
The name of a setting can be filtered when using the settings_checksum action.
The name of a file system can be filtered when using the disk_space action.
The name of a setting can be filtered when using the settings_checksum action.</p>
-<p>If only an include option is given, then ONLY those entries that match will be checked. However, if given
-both exclude and include, the exclusion is done first, and the inclusion second to reinstate things that
-may have been excluded. Both --include and --exclude can be given multiple times, or as comma-separated lists.
-A leading tilde will match the following word as a regular expression.</p>
+<p>If only an include option is given, then ONLY those entries that match will be
+checked. However, if given both exclude and include, the exclusion is done first,
+and the inclusion after, to reinstate things that may have been excluded. Both
+<strong>--include</strong> and <strong>--exclude</strong> can be given multiple times,
+and/or as comma-separated lists. A leading tilde will match the following word
+as a regular expression.</p>
<p>Examples:</p>
+<p>Only checks items named pg_class:</p>
+<pre>
+ --include=pg_class</pre>
+<p>Only checks items containing the letters 'pg_':</p>
+<pre>
+ --include=~pg_</pre>
+<p>Only check items beginning with 'pg_':</p>
<pre>
- --include=pg_class
- Only checks items named pg_class</pre>
+ --include=~^pg_</pre>
+<p>Exclude the item named 'test':</p>
<pre>
- --include=~pg_
- Only checks items containing the letters 'pg_'</pre>
+ --exclude=test</pre>
+<p>Exclude all items containing the letters 'test:</p>
<pre>
- --include=~^pg_
- Only check items beginning with 'pg_'</pre>
+ --exclude=~test</pre>
+<p>Exclude all items containing the letters 'ace', but allow the item 'faceoff':</p>
+<pre>
+ --exclude=~ace --include=faceoff</pre>
+<p>Exclude all items which start with the letters 'pg_', which contain the letters 'slon',
+or which are named 'sql_settings' or 'green'. Specifically check items with the letters 'prod' in their names, and always check the item named 'pg_relname':</p>
+<pre>
+ --exclude=~^pg_,~slon,sql_settings --exclude=green --include=~prod,pg_relname</pre>
+<p>
+</p>
+<hr />
+<h1><a name="user_name_filtering">USER NAME FILTERING</a></h1>
+<p>The options <strong>--includeuser</strong> and <strong>--excludeuser</strong> can be used on some actions
+to only examine database objects owned by (or not owned by) one or more users.
+An <strong>--includeuser</strong> option always trumps an <strong>--excludeuser</strong> option. You can
+give each option more than once for multiple users, or you can give a
+comma-separated list. The actions that currently use these options are:</p>
+<dl>
+<dt><strong>database_size</strong>
+
+<dt><strong>last_analyze</strong>
+
+<dt><strong>last_vacuum</strong>
+
+<dt><strong>query_time</strong>
+
+<dt><strong>relation_size</strong>
+
+<dt><strong>txn_time</strong>
+
+</dl>
+<p>Examples:</p>
+<p>Only check items owned by the user named greg:</p>
<pre>
- --exclude=test
- Exclude the item named 'test'</pre>
+ --includeuser=greg</pre>
+<p>Only check items owned by either watson or crick:</p>
<pre>
- --exclude=~test
- Exclude all items containing the letters 'test</pre>
+ --includeuser=watson,crick</pre>
+<p>Only check items owned by crick,franklin, watson, or wilkins:</p>
<pre>
- --exclude=~ace --include=faceoff
- Exclude all items containing the letters 'ace', but allow the item 'faceoff'</pre>
+ --includeuser=watson --includeuser=franklin --includeuser=crick,wilkins</pre>
+<p>Check all items except for those belonging to the user scott:</p>
<pre>
- --exclude=~^pg_,~slon,sql_settings --exclude=green --include=~prod,pg_relname
- Exclude all items which start with the letters 'pg_', which contain the letters 'slon', or which are named
- 'sql_settings' or 'green'. Specifically check items with the letters 'prod' in their names, and always
- check the item named 'pg_relname'.</pre>
+ --excludeuser=scott</pre>
<p>
</p>
<hr />
<h1><a name="test_mode">TEST MODE</a></h1>
-<p>To help in setting things up, this program can be run in a "test mode" by specifying the --test option. This will
-perform some basic tests to make sure that the databases can be contacted, and that certain per-action prerequisites
-are met. Currently, we check that the user is a superuser if required by that action, and that the version of Postgres
-is new enough for those actions that depend on a specific version.</p>
+<p>To help in setting things up, this program can be run in a "test mode" by
+specifying the <strong>--test</strong> option. This will perform some basic tests to
+make sure that the databases can be contacted, and that certain per-action
+prerequisites are met. Currently, we check that the user is a superuser
+if required by that action, and that the version of Postgres is new enough
+for those actions that depend on a specific version.</p>
<p>
</p>
<hr />
<h1><a name="dependencies">DEPENDENCIES</a></h1>
+<p>Access to a working version of psql, and the following very standard Perl modules:</p>
<dl>
-<dt><strong><a name="access_to_a_working_version_of_psql" class="item">Access to a working version of psql</a></strong>
+<dt><strong><a name="cwd" class="item"><strong>Cwd</strong></a></strong>
-<dt><strong><a name="some_very_standard_perl_modules" class="item">Some very standard Perl modules:</a></strong>
+<dt><strong><a name="getopt_long" class="item"><strong>Getopt::Long</strong></a></strong>
-<dl>
-<dt><strong><a name="getopt_long" class="item">Getopt::Long</a></strong>
-
-<dt><strong><a name="file_basename" class="item">File::Basename</a></strong>
+<dt><strong><a name="file_basename" class="item"><strong>File::Basename</strong></a></strong>
-<dt><strong><a name="file_temp" class="item">File::Temp</a></strong>
+<dt><strong><a name="file_temp" class="item"><strong>File::Temp</strong></a></strong>
-<dt><strong><a name="hires" class="item">Time::HiRes (if opt{showtime} is set to true, which is the default)</a></strong>
+<dt><strong><a name="hires" class="item"><strong>Time::HiRes</strong> (if <code>$opt{showtime}</code> is set to true, which is the default)</a></strong>
</dl>
-</dl>
-<p>The 'settings_checksum' action requires the Digest::MD5 module.</p>
-<p>Some actions require access to external programs. If psql is not explicitly specified, the command
-'which' is used to find it. The program "/bin/df" is needed by the 'check_disk_space' action.</p>
+<p>The <strong>settings_checksum</strong> action requires the <strong>Digest::MD5</strong> module.</p>
+<p>Some actions require access to external programs. If psql is not explicitly
+specified, the command <strong>which</strong> is used to find it. The program <strong>/bin/df</strong>
+is needed by the <strong>check_disk_space</strong> action.</p>
<p>
</p>
<hr />
<h1><a name="development">DEVELOPMENT</a></h1>
-<p>Development happens using the git system. You can clone the latest version by doing:
- git-clone <a href="http://bucardo.org/nagios_postgres.git">http://bucardo.org/nagios_postgres.git</a></p>
+<p>Development happens using the git system. You can clone the latest version by doing:</p>
+<pre>
+ git-clone <a href="http://bucardo.org/check_postgres.git">http://bucardo.org/check_postgres.git</a></pre>
<p>
</p>
<hr />
<h1><a name="history">HISTORY</a></h1>
<p>Items not specifically attributed are by Greg Sabino Mullane.</p>
<dl>
-<dt><strong><a name="version_1_4_1" class="item"><strong>Version 1.4.1</strong></a></strong>
+<dt><strong><a name="0" class="item"><strong>Version 1.5.0</strong> (April 16, 2008)</a></strong>
+
+<dd>
+<p>Add the --includeuser and --excludeuser options. Documentation cleanup.</p>
+</dd>
+</li>
+<dt><strong><a name="version_1_4_3" class="item"><strong>Version 1.4.3</strong></a></strong>
<dd>
-<p>Fix bug preventing --dbpass argument from working (Robert Treat)</p>
+<p>Add in the 'output' concept for future support of non-Nagios programs.</p>
</dd>
</li>
-<dt><strong><a name="version_1_4_12" class="item"><strong>Version 1.4.1</strong></a></strong>
+<dt><strong><a name="version_1_4_2" class="item"><strong>Version 1.4.2</strong></a></strong>
+
+<dd>
+<p>Fix bug preventing --dbpass argument from working (Robert Treat).</p>
+</dd>
+</li>
+<dt><strong><a name="version_1_4_1" class="item"><strong>Version 1.4.1</strong></a></strong>
<dd>
<p>Minor documentation fixes.</p>
</dd>
</li>
-<dt><strong><a name="version_1_4_0" class="item"><strong>Version 1.4.0</strong></a></strong>
+<dt><strong><strong>Version 1.4.0</strong> (April 2, 2008)</strong>
<dd>
-<p>Have check_wal_files use pg_ls_dir (idea by Robert Treat)</p>
+<p>Have check_wal_files use pg_ls_dir (idea by Robert Treat).</p>
</dd>
<dd>
<p>For last_vacuum and last_analyze, respect autovacuum effects, add separate
-autovacuum checks (ideas by Robert Treat)</p>
+autovacuum checks (ideas by Robert Treat).</p>
</dd>
</li>
<dt><strong><a name="version_1_3_1" class="item"><strong>Version 1.3.1</strong></a></strong>
<dd>
-<p>Have txn_idle use query_start, not xact_start</p>
+<p>Have txn_idle use query_start, not xact_start.</p>
</dd>
</li>
-<dt><strong><a name="version_1_3_0" class="item"><strong>Version 1.3.0</strong></a></strong>
+<dt><strong><strong>Version 1.3.0</strong> (March 23, 2008)</strong>
<dd>
<p>Add in txn_idle and txn_time actions.</p>
</dd>
</li>
-<dt><strong><a name="version_1_2_0" class="item"><strong>Version 1.2.0</strong></a></strong>
+<dt><strong><strong>Version 1.2.0</strong> (February 21, 2008)</strong>
<dd>
<p>Add the check_wal_files method, which counts the number of WAL files
<p>Explicitly allow -v as an argument.</p>
</dd>
<dd>
-<p>Allow for a null syslog_facility in check_logfile</p>
+<p>Allow for a null syslog_facility in check_logfile.</p>
</dd>
</li>
<dt><strong><a name="version_1_1_2" class="item"><strong>Version 1.1.2</strong></a></strong>
<p>Switch vacuum and analyze date output to use 'DD', not 'D'. (Glyn Astill)</p>
</dd>
</li>
-<dt><strong><a name="version_1_1_0" class="item"><strong>Version 1.1.0</strong></a></strong>
+<dt><strong><strong>Version 1.1.0</strong> (December 16, 2008)</strong>
<dd>
-<p>Fixes, enhancements, and performance tracking, December 2007</p>
+<p>Fixes, enhancements, and performance tracking.</p>
</dd>
<dd>
<p>Add performance data tracking via --showperf and --perflimit</p>