diff options
author | Greg Sabino Mullane | 2011-01-03 16:41:26 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2011-01-03 16:41:26 +0000 |
commit | 5a1c3af7dfeb7f836a1fd677ead9968ef8ddc247 (patch) | |
tree | d59747bb332f77b42ca37e0d993a1553e9b5cd32 | |
parent | 658956b2a0dd323b23e687d025a98bb72ed03f7f (diff) |
Bump version to 2.15.4
-rw-r--r-- | META.yml | 4 | ||||
-rw-r--r-- | Makefile.PL | 2 | ||||
-rwxr-xr-x | check_postgres.pl | 4 | ||||
-rw-r--r-- | check_postgres.pl.asc | 6 | ||||
-rw-r--r-- | check_postgres.pl.html | 242 |
5 files changed, 141 insertions, 117 deletions
@@ -1,6 +1,6 @@ --- #YAML:1.0 name : check_postgres.pl -version : 2.15.2 +version : 2.15.4 abstract : Postgres monitoring script author: - Greg Sabino Mullane <[email protected]> @@ -30,7 +30,7 @@ recommends: provides: check_postgres: file : check_postgres.pl - version : 2.15.2 + version : 2.15.4 keywords: - Postgres diff --git a/Makefile.PL b/Makefile.PL index 4727f148e..867cf10dc 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,7 +6,7 @@ use strict; use warnings; use 5.006001; -my $VERSION = '2.15.2'; +my $VERSION = '2.15.4'; if ($VERSION =~ /_/) { print "WARNING! This is a test version ($VERSION) and should not be used in production!\n"; diff --git a/check_postgres.pl b/check_postgres.pl index 9607a07b2..467f50494 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -30,7 +30,7 @@ $Data::Dumper::Varname = 'POSTGRES'; $Data::Dumper::Indent = 2; $Data::Dumper::Useqq = 1; -our $VERSION = '2.15.3'; +our $VERSION = '2.15.4'; use vars qw/ %opt $PSQL $res $COM $SQL $db /; @@ -7180,7 +7180,7 @@ sub check_archive_ready { B<check_postgres.pl> - a Postgres monitoring script for Nagios, MRTG, Cacti, and others -This documents describes check_postgres.pl version 2.15.3 +This documents describes check_postgres.pl version 2.15.4 =head1 SYNOPSIS diff --git a/check_postgres.pl.asc b/check_postgres.pl.asc index 046dec4aa..962d062ee 100644 --- a/check_postgres.pl.asc +++ b/check_postgres.pl.asc @@ -1,6 +1,6 @@ -----BEGIN PGP SIGNATURE----- -iEYEABEDAAYFAk0aX+QACgkQvJuQZxSWSsjMYQCeNxKMblKN0oY17iqBNuJGwy2C -QlEAoPyoDt4N6afeYrXZGcQNrMnrMrYq -=a8P+ +iEYEABEDAAYFAk0czRQACgkQvJuQZxSWSshi9wCfX2BAaXRNIJ1SlaLeASQeUWSQ +nZcAoIoKIzZQALWQ7EyP44bZwbT4jH9Q +=kjex -----END PGP SIGNATURE----- diff --git a/check_postgres.pl.html b/check_postgres.pl.html index 55f33f74a..90343326c 100644 --- a/check_postgres.pl.html +++ b/check_postgres.pl.html @@ -37,6 +37,7 @@ <li><a href="#actions">ACTIONS</a></li> <ul> + <li><a href="#archive_ready"><strong>archive_ready</strong></a></li> <li><a href="#autovac_freeze"><strong>autovac_freeze</strong></a></li> <li><a href="#backends"><strong>backends</strong></a></li> <li><a href="#bloat"><strong>bloat</strong></a></li> @@ -52,10 +53,10 @@ <li><a href="#index_size"><strong>index_size</strong></a></li> <li><a href="#table_size"><strong>table_size</strong></a></li> <li><a href="#relation_size"><strong>relation_size</strong></a></li> - <li><a href="#last_vacuum"><strong>last_vacuum</strong></a></li> - <li><a href="#last_autovacuum"><strong>last_autovacuum</strong></a></li> <li><a href="#last_analyze"><strong>last_analyze</strong></a></li> + <li><a href="#last_vacuum"><strong>last_vacuum</strong></a></li> <li><a href="#last_autoanalyze"><strong>last_autoanalyze</strong></a></li> + <li><a href="#last_autovacuum"><strong>last_autovacuum</strong></a></li> <li><a href="#listener"><strong>listener</strong></a></li> <li><a href="#locks"><strong>locks</strong></a></li> <li><a href="#logfile"><strong>logfile</strong></a></li> @@ -78,17 +79,16 @@ <li><a href="#replicate_row"><strong>replicate_row</strong></a></li> <li><a href="#same_schema"><strong>same_schema</strong></a></li> <li><a href="#sequence"><strong>sequence</strong></a></li> - <li><a href="#slony_status"><strong>slony_status</strong></a></li> - <li><a href="#txn_time"><strong>txn_time</strong></a></li> - <li><a href="#txn_idle"><strong>txn_idle</strong></a></li> - <li><a href="#rebuild_symlinks"><strong>rebuild_symlinks</strong></a></li> - <li><a href="#rebuild_symlinks_force"><strong>rebuild_symlinks_force</strong></a></li> <li><a href="#settings_checksum"><strong>settings_checksum</strong></a></li> + <li><a href="#slony_status"><strong>slony_status</strong></a></li> <li><a href="#timesync"><strong>timesync</strong></a></li> + <li><a href="#txn_idle"><strong>txn_idle</strong></a></li> + <li><a href="#txn_time"><strong>txn_time</strong></a></li> <li><a href="#txn_wraparound"><strong>txn_wraparound</strong></a></li> - <li><a href="#wal_files"><strong>wal_files</strong></a></li> - <li><a href="#archive_ready"><strong>archive_ready</strong></a></li> <li><a href="#version"><strong>version</strong></a></li> + <li><a href="#wal_files"><strong>wal_files</strong></a></li> + <li><a href="#rebuild_symlinks"><strong>rebuild_symlinks</strong></a></li> + <li><a href="#rebuild_symlinks_force"><strong>rebuild_symlinks_force</strong></a></li> </ul> <li><a href="#basic_filtering">BASIC FILTERING</a></li> @@ -116,7 +116,7 @@ <hr /> <h1><a name="name">NAME</a></h1> <p><strong>check_postgres.pl</strong> - a Postgres monitoring script for Nagios, MRTG, Cacti, and others</p> -<p>This documents describes check_postgres.pl version 2.15.2</p> +<p>This documents describes check_postgres.pl version 2.15.4</p> <p> </p> <hr /> @@ -443,6 +443,23 @@ critical is an effective way to turn warnings off and always give a critical.</p <p>The current supported actions are:</p> <p> </p> +<h2><a name="archive_ready"><strong>archive_ready</strong></a></h2> +<p>(<code>symlink: check_postgres_archive_ready</code>) Checks how many WAL files with extension <em class="file">.ready</em> +exist in the <em class="file">pg_xlog/archive_status</em> directory, which is found +off of your <strong>data_directory</strong>. This action must be run as a superuser, in order to access the +contents of the <em class="file">pg_xlog/archive_status</em> directory. The minimum version to use this action is +Postgres 8.1. The <em>--warning</em> and <em>--critical</em> options are simply the number of +<em class="file">.ready</em> files in the <em class="file">pg_xlog/archive_status</em> directory. +Usually, these values should be low, turning on the archive mechanism, we usually want it to +archive WAL files as fast as possible.</p> +<p>If the archive command fail, number of WAL in your <em class="file">pg_xlog</em> directory will grow until +exhausting all the disk space and force PostgreSQL to stop immediately.</p> +<p>Example 1: Check that the number of ready WAL files is 10 or less on host "pluto"</p> +<pre> + check_postgres_archive_ready --host=pluto --critical=10</pre> +<p>For MRTG output, reports the number of ready WAL files on line 1.</p> +<p> +</p> <h2><a name="autovac_freeze"><strong>autovac_freeze</strong></a></h2> <p>(<code>symlink: check_postgres_autovac_freeze</code>) Checks how close each database is to the Postgres <strong>autovacuum_freeze_max_age</strong> setting. This action will only work for databases version 8.2 or higher. The <em>--warning</em> and @@ -846,18 +863,18 @@ will be given. To prevent this, it is recommended that you set the and relation as the fourth line.</p> <p> </p> -<h2><a name="last_vacuum"><strong>last_vacuum</strong></a></h2> +<h2><a name="last_analyze"><strong>last_analyze</strong></a></h2> <p> </p> -<h2><a name="last_autovacuum"><strong>last_autovacuum</strong></a></h2> +<h2><a name="last_vacuum"><strong>last_vacuum</strong></a></h2> <p> </p> -<h2><a name="last_analyze"><strong>last_analyze</strong></a></h2> +<h2><a name="last_autoanalyze"><strong>last_autoanalyze</strong></a></h2> <p> </p> -<h2><a name="last_autoanalyze"><strong>last_autoanalyze</strong></a></h2> -<p>(symlinks: <code>check_postgres_last_vacuum</code>, <code>check_postgres_last_autovacuum</code>, <code>check_postgres_last_analyze</code>, and -<code>check_postgres_last_autoanalyze</code>) +<h2><a name="last_autovacuum"><strong>last_autovacuum</strong></a></h2> +<p>(symlinks: <code>check_postgres_last_analyze</code>, <code>check_postgres_last_vacuum</code>, +<code>check_postgres_last_autoanalyze</code>, and <code>check_postgres_last_autovacuum</code>) 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 target database is version 8.3 or greater, or that the version is 8.2 and the @@ -1226,6 +1243,27 @@ if there are more than one sequence at that percentage.</p> check_postgres_sequence --dbport=5432 --critical=50% --include=orders_id_seq</pre> <p> </p> +<h2><a name="settings_checksum"><strong>settings_checksum</strong></a></h2> +<p>(<code>symlink: check_postgres_settings_checksum</code>) Checks 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 <em>--warning</em> or the <em>--critical</em> 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> +<p>This action requires the Digest::MD5 module.</p> +<p>Example 1: Find the initial checksum for the database on port 5555 using the default user (usually postgres)</p> +<pre> + check_postgres_settings_checksum --port=5555 --critical=0</pre> +<p>Example 2: Make sure no settings have changed and warn if so, using the checksum from above.</p> +<pre> + check_postgres_settings_checksum --port=5555 --warning=cd2f3b5e129dc2b4f5c0f6d8d2e64231</pre> +<p>For MRTG output, returns a 1 or 0 indicating success of failure of the checksum to match. A +checksum must be provided as the <code>--mrtg</code> argument. The fourth line always gives the +current checksum.</p> +<p> +</p> <h2><a name="slony_status"><strong>slony_status</strong></a></h2> <p>(<code>symlink: check_postgres_slony_status</code>) Checks in the status of a Slony cluster by looking at the results of Slony's sl_status view. This is returned as the number of seconds of "lag time". @@ -1241,27 +1279,18 @@ not given, the schema will be determined automatically each time this check is r check_postgres_slony_status --schema=_slony --critical=600</pre> <p> </p> -<h2><a name="txn_time"><strong>txn_time</strong></a></h2> -<p>(<code>symlink: check_postgres_txn_time</code>) 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 -<em>--include</em> and <em>--exclude</em> 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 <em>--includeuser</em> and <em>--excludeuser</em> options. -See the <a href="#user_name_filtering">USER NAME FILTERING</a> section for more details.</p> -<p>The values or the <em>--warning</em> and <em>--critical</em> 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> -<p>This action requires Postgres 8.3 or better.</p> -<p>Example 1: Give a critical if any transaction has been open for more than 10 minutes:</p> -<pre> - check_postgres_txn_time --port=5432 --critical='10 minutes'</pre> -<p>Example 1: Warn if user 'warehouse' has a transaction open over 30 seconds</p> +<h2><a name="timesync"><strong>timesync</strong></a></h2> +<p>(<code>symlink: check_postgres_timesync</code>) Compares the local system time with the time reported by one or more databases. +The <em>--warning</em> and <em>--critical</em> 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> +<p>The string returned shows the time difference as well as the time on each side written out.</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> <pre> - check_postgres_txn_time --port-5432 --warning=30s --includeuser=warehouse</pre> -<p>For MRTG output, returns the maximum time in seconds a transaction has been open on the -first line. The fourth line gives the name of the database.</p> + check_postgres_timesync --host=ankh,morpork,klatch --critical=3</pre> +<p>For MRTG output, returns one the first line the number of seconds difference between the local +time and the database time. The fourth line returns the name of the database.</p> <p> </p> <h2><a name="txn_idle"><strong>txn_idle</strong></a></h2> @@ -1282,51 +1311,27 @@ the 'stats_command_string' parameter must be set to 'on'.</p> line returns the name of the database.</p> <p> </p> -<h2><a name="rebuild_symlinks"><strong>rebuild_symlinks</strong></a></h2> -<p> -</p> -<h2><a name="rebuild_symlinks_force"><strong>rebuild_symlinks_force</strong></a></h2> -<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. The option --symlinks is a shorter way of saying ---action=rebuild_symlinks</p> -<p> -</p> -<h2><a name="settings_checksum"><strong>settings_checksum</strong></a></h2> -<p>(<code>symlink: check_postgres_settings_checksum</code>) Checks 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 <em>--warning</em> or the <em>--critical</em> 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> -<p>This action requires the Digest::MD5 module.</p> -<p>Example 1: Find the initial checksum for the database on port 5555 using the default user (usually postgres)</p> -<pre> - check_postgres_settings_checksum --port=5555 --critical=0</pre> -<p>Example 2: Make sure no settings have changed and warn if so, using the checksum from above.</p> +<h2><a name="txn_time"><strong>txn_time</strong></a></h2> +<p>(<code>symlink: check_postgres_txn_time</code>) 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 +<em>--include</em> and <em>--exclude</em> 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 <em>--includeuser</em> and <em>--excludeuser</em> options. +See the <a href="#user_name_filtering">USER NAME FILTERING</a> section for more details.</p> +<p>The values or the <em>--warning</em> and <em>--critical</em> 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> +<p>This action requires Postgres 8.3 or better.</p> +<p>Example 1: Give a critical if any transaction has been open for more than 10 minutes:</p> <pre> - check_postgres_settings_checksum --port=5555 --warning=cd2f3b5e129dc2b4f5c0f6d8d2e64231</pre> -<p>For MRTG output, returns a 1 or 0 indicating success of failure of the checksum to match. A -checksum must be provided as the <code>--mrtg</code> argument. The fourth line always gives the -current checksum.</p> -<p> -</p> -<h2><a name="timesync"><strong>timesync</strong></a></h2> -<p>(<code>symlink: check_postgres_timesync</code>) Compares the local system time with the time reported by one or more databases. -The <em>--warning</em> and <em>--critical</em> 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> -<p>The string returned shows the time difference as well as the time on each side written out.</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> + check_postgres_txn_time --port=5432 --critical='10 minutes'</pre> +<p>Example 1: Warn if user 'warehouse' has a transaction open over 30 seconds</p> <pre> - check_postgres_timesync --host=ankh,morpork,klatch --critical=3</pre> -<p>For MRTG output, returns one the first line the number of seconds difference between the local -time and the database time. The fourth line returns the name of the database.</p> + check_postgres_txn_time --port-5432 --warning=30s --includeuser=warehouse</pre> +<p>For MRTG output, returns the maximum time in seconds a transaction has been open on the +first line. The fourth line gives the name of the database.</p> <p> </p> <h2><a name="txn_wraparound"><strong>txn_wraparound</strong></a></h2> @@ -1347,6 +1352,21 @@ it, please visit the page while line 4 indicates which database it is.</p> <p> </p> +<h2><a name="version"><strong>version</strong></a></h2> +<p>(<code>symlink: check_postgres_version</code>) Checks that the required version of Postgres is running. The +<em>--warning</em> and <em>--critical</em> 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> +<p>Example 1: Give a warning if the database on port 5678 is not version 8.4.10:</p> +<pre> + check_postgres_version --port=5678 -w=8.4.10</pre> +<p>Example 2: Give a warning if any databases on hosts valley,grain, or sunshine is not 8.3:</p> +<pre> + check_postgres_version -H valley,grain,sunshine --critical=8.3</pre> +<p>For MRTG output, reports a 1 or a 0 indicating success or failure on the first line. The +fourth line indicates the current version. The version must be provided via the <code>--mrtg</code> option.</p> +<p> +</p> <h2><a name="wal_files"><strong>wal_files</strong></a></h2> <p>(<code>symlink: check_postgres_wal_files</code>) 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 @@ -1366,36 +1386,16 @@ out of space, at which point Postgres will shut down.</p> <p>For MRTG output, reports the number of WAL files on line 1.</p> <p> </p> -<h2><a name="archive_ready"><strong>archive_ready</strong></a></h2> -<p>(<code>symlink: check_postgres_archive_ready</code>) Checks how many WAL files with extension <em class="file">.ready</em> -exist in the <em class="file">pg_xlog/archive_status</em> directory, which is found -off of your <strong>data_directory</strong>. This action must be run as a superuser, in order to access the -contents of the <em class="file">pg_xlog/archive_status</em> directory. The minimum version to use this action is -Postgres 8.1. The <em>--warning</em> and <em>--critical</em> options are simply the number of -<em class="file">.ready</em> files in the <em class="file">pg_xlog/archive_status</em> directory. -Usually, these values should be low, turning on the archive mechanism, we usually want it to -archive WAL files as fast as possible.</p> -<p>If the archive command fail, number of WAL in your <em class="file">pg_xlog</em> directory will grow until -exhausting all the disk space and force PostgreSQL to stop immediatly.</p> -<p>Example 1: Check that the number of ready WAL files is 10 or less on host "pluto"</p> -<pre> - check_postgres_archive_ready --host=pluto --critical=10</pre> -<p>For MRTG output, reports the number of ready WAL files on line 1.</p> +<h2><a name="rebuild_symlinks"><strong>rebuild_symlinks</strong></a></h2> <p> </p> -<h2><a name="version"><strong>version</strong></a></h2> -<p>(<code>symlink: check_postgres_version</code>) Checks that the required version of Postgres is running. The -<em>--warning</em> and <em>--critical</em> 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> -<p>Example 1: Give a warning if the database on port 5678 is not version 8.4.10:</p> -<pre> - check_postgres_version --port=5678 -w=8.4.10</pre> -<p>Example 2: Give a warning if any databases on hosts valley,grain, or sunshine is not 8.3:</p> -<pre> - check_postgres_version -H valley,grain,sunshine --critical=8.3</pre> -<p>For MRTG output, reports a 1 or a 0 indicating success or failure on the first line. The -fourth line indicates the current version. The version must be provided via the <code>--mrtg</code> option.</p> +<h2><a name="rebuild_symlinks_force"><strong>rebuild_symlinks_force</strong></a></h2> +<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. The option --symlinks is a shorter way of saying +--action=rebuild_symlinks</p> <p> </p> <hr /> @@ -1567,13 +1567,37 @@ feature requests, and commit notices, send email to <a href="mailto:check_postgr <h1><a name="history">HISTORY</a></h1> <p>Items not specifically attributed are by Greg Sabino Mullane.</p> <dl> -<dt><strong><a name="version_2_15_1" class="item"><strong>Version 2.15.1</strong></a></strong></dt> +<dt><strong><a name="version_2_15_4" class="item"><strong>Version 2.15.4</strong></a></strong></dt> + +<dd> +<pre> + Fix warning when using symlinks + (Greg Sabino Mullane, reported by Peter Eisentraut in bug #63)</pre> +</dd> +<dt><strong><a name="version_2_15_3_december_30_2010" class="item"><strong>Version 2.15.3</strong> December 30, 2010</a></strong></dt> + +<dd> +<pre> + Show OK for no matching txn_idle entries.</pre> +</dd> +<dt><strong><a name="version_2_15_2_december_28_2010" class="item"><strong>Version 2.15.2</strong> December 28, 2010</a></strong></dt> + +<dd> +<pre> + Better formatting of sizes in the bloat action output.</pre> +<pre> + Remove duplicate perfs in bloat action output.</pre> +</dd> +<dt><strong><a name="version_2_15_1_december_27_2010" class="item"><strong>Version 2.15.1</strong> December 27, 2010</a></strong></dt> <dd> <pre> Fix problem when examining items in pg_settings (Greg Sabino Mullane)</pre> +<pre> + For connection test, return critical, not unknown, on FATAL errors + (Greg Sabino Mullane, reported by Peter Eisentraut in bug #62)</pre> </dd> -<dt><strong><a name="version_2_15_0" class="item"><strong>Version 2.15.0</strong></a></strong></dt> +<dt><strong><a name="version_2_15_0_november_8_2010" class="item"><strong>Version 2.15.0</strong> November 8, 2010</a></strong></dt> <dd> <pre> |