diff options
author | Greg Sabino Mullane | 2010-02-11 16:03:44 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2010-02-11 16:03:44 +0000 |
commit | 2b7ad25bc1e0ec4809fe4e1d175bfcc9360aabcf (patch) | |
tree | 41cf35315d95f6f9dae7ec06fb785caba1219b7b | |
parent | 6c3551e0a42a9338618ab5921423a1106e50465f (diff) |
Version 2.14.0 ready
-rw-r--r-- | META.yml | 4 | ||||
-rw-r--r-- | Makefile.PL | 2 | ||||
-rw-r--r-- | SIGNATURE | 22 | ||||
-rwxr-xr-x | check_postgres.pl | 2 | ||||
-rw-r--r-- | check_postgres.pl.asc | 6 | ||||
-rw-r--r-- | check_postgres.pl.html | 103 |
6 files changed, 85 insertions, 54 deletions
@@ -1,6 +1,6 @@ --- #YAML:1.0 name : check_postgres.pl -version : 2.13.2 +version : 2.14.0 abstract : Postgres monitoring script author: - Greg Sabino Mullane <greg@endpoint.com> @@ -30,7 +30,7 @@ recommends: provides: check_postgres: file : check_postgres.pl - version : 2.13.2 + version : 2.14.0 keywords: - Postgres diff --git a/Makefile.PL b/Makefile.PL index 56a7bee7e..f571de585 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,7 +6,7 @@ use strict; use warnings; use 5.006001; -my $VERSION = '2.13.2'; +my $VERSION = '2.14.0'; if ($VERSION =~ /_/) { print "WARNING! This is a test version ($VERSION) and should not be used in production!\n"; @@ -15,16 +15,16 @@ not run its Makefile.PL or Build.PL. Hash: RIPEMD160 SHA1 de1474d7cbc69698971954ffb80760269b218e1f .gitignore -SHA1 8038f2f318fb0eedaf0f1431b44dd6ece5203d2f .perlcriticrc -SHA1 902994783e0b80da76d02dff10978a3ef6645f7c MANIFEST +SHA1 34704b2a862f8ea670ed335230affc9ef3e3acb9 .perlcriticrc +SHA1 19f7436035c2dd1b1edc7bfdc138409d872338b0 MANIFEST SHA1 92f9e28d28d95763cce24d588b19262efc7218f7 MANIFEST.SKIP -SHA1 7ed143ab707b5da4cf94ba646f3d75ec6e3c54d3 META.yml -SHA1 945f5b414af3daa60bef2d92d6f18c9b071c4b31 Makefile.PL +SHA1 a7836851e1b720d874ab1e3a3d8bfe292d823f36 META.yml +SHA1 0ead49d130f1461a496f7229d7045ee4b9003121 Makefile.PL SHA1 709742a5933a43cc3e82ee935cd63a45f176adda README SHA1 6a627ce3f10fd9993b65210733d6098ef6a42dca TODO -SHA1 b3321912976e65089d1639ad5836f154a4381419 check_postgres.pl -SHA1 06d2a05f5d9848df12915c44ba3027fc27cdaa78 check_postgres.pl.asc -SHA1 79dc27091ef50b620fd0489df7657d8f5bdbd357 check_postgres.pl.html +SHA1 54fa182fe52823058cec64dcc7c3bd07cd09bf56 check_postgres.pl +SHA1 8bdb1ecfb303944074adfec2ab07f8be28103963 check_postgres.pl.asc +SHA1 d65da965fc3c42b101ffaf3c9f868a9b996d421a check_postgres.pl.html SHA1 c3d239c75a507a0b4d5a245ea82fb2e7fe2869cd t/00_basic.t SHA1 a29dcbcc2e34d409ad30e8f87b9c4c09db877c4e t/00_signature.t SHA1 b3b833488dca6a766aa185c2457d361a978103cb t/00_test_tester.t @@ -45,6 +45,7 @@ SHA1 a83a869ac0d8a934b91a95b94c33b232a5d586ff t/02_last_vacuum.t SHA1 82faf8abcd0855361047154073f05111c9d0209f t/02_listener.t SHA1 ef95e89d40c052c240c77fbca654150480d61c08 t/02_locks.t SHA1 b948f94b3404b772d02850f48a70e19a76169791 t/02_logfile.t +SHA1 aac72bd216c1914a5598d7f8008d45eab03dc288 t/02_new_version_bc.t SHA1 a4d49989f13ef9d13a89cdea869e10e5c59d3d1a t/02_new_version_cp.t SHA1 b01d529b9e61fbeb63a3ea41e33c308fe2df2be8 t/02_new_version_pg.t SHA1 1faaad7c164d9588e77afd64b8e6c3bbbd243f6e t/02_prepared_txns.t @@ -55,6 +56,7 @@ SHA1 7f9e6725cba6c1418beb0847e49ab8eb9c409f60 t/02_replicate_row.t SHA1 c28d1dc9805201263409c393e6e0930424837791 t/02_same_schema.t SHA1 921e5627011cfaa923ee9df26e8bb90c16cb1dd0 t/02_sequence.t SHA1 f498f14c7b05792e18b99ef7d6c91592682d29b6 t/02_settings_checksum.t +SHA1 a014c09fac27a23ddc81cda78e9b67defe0d3fd3 t/02_slony_status.t SHA1 4c14da6c23eb14e450bd7b0af722fdc0cb97aae7 t/02_timesync.t SHA1 da12da419f0adb356687ec1465ff7e32f2364c12 t/02_txn_idle.t SHA1 af3eb039379b29b9a88749f478299265a87fd084 t/02_txn_time.t @@ -67,7 +69,7 @@ SHA1 96e6e5da3e1f6753a469e7afc8cf070024b33b23 t/99_cleanup.t SHA1 058e1b59e21c039b6c79f0be3e1a6c2dbcbd5add t/CP_Testing.pm -----BEGIN PGP SIGNATURE----- -iEYEAREDAAYFAktrkPUACgkQvJuQZxSWSshg4gCfXMqu+IdklcHsoMnlRzPU2v8V -6VUAnjCfgx73ekXmuImI3dmz2PuUI6Mf -=ksvv +iEYEAREDAAYFAkt0KGkACgkQvJuQZxSWSsiPMACggMzdzcdaElmcfE7piKySSyr3 +o74AoLNlFbNei7TcDEhD8UsLRbGv+qHQ +=C/Xg -----END PGP SIGNATURE----- diff --git a/check_postgres.pl b/check_postgres.pl index 927ba6b8d..88ff49762 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -6585,7 +6585,7 @@ sub show_dbstats { B<check_postgres.pl> - a Postgres monitoring script for Nagios, MRTG, Cacti, and others -This documents describes check_postgres.pl version 2.13.3 +This documents describes check_postgres.pl version 2.14.0 =head1 SYNOPSIS diff --git a/check_postgres.pl.asc b/check_postgres.pl.asc index ad4312157..666a5ccae 100644 --- a/check_postgres.pl.asc +++ b/check_postgres.pl.asc @@ -1,6 +1,6 @@ -----BEGIN PGP SIGNATURE----- -iEYEABEDAAYFAktrkLsACgkQvJuQZxSWSsipoQCfdCwbnVn2/U1nrOgN/tnmjx/Y -11QAmgOeW2AKYOKFPjmmpiefpLWUxmaw -=J05q +iEYEABEDAAYFAkt0KGYACgkQvJuQZxSWSsjPFgCfQUysAtW1k3yCJiHpGf7eOaKU +Ye4AnA7dVovV35aHZ0vrzcRV39i9fg+s +=zJIi -----END PGP SIGNATURE----- diff --git a/check_postgres.pl.html b/check_postgres.pl.html index 091036fe0..980d640a8 100644 --- a/check_postgres.pl.html +++ b/check_postgres.pl.html @@ -65,9 +65,10 @@ <li><a href="#prepared_txns"><strong>prepared_txns</strong></a></li> <li><a href="#query_runtime"><strong>query_runtime</strong></a></li> <li><a href="#query_time"><strong>query_time</strong></a></li> + <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="#replicate_row"><strong>replicate_row</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> @@ -104,7 +105,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.13.2</p> +<p>This documents describes check_postgres.pl version 2.14.0</p> <p> </p> <hr /> @@ -1017,6 +1018,44 @@ assumed to be seconds.</p> line gives the name of the database.</p> <p> </p> +<h2><a name="replicate_row"><strong>replicate_row</strong></a></h2> +<p>(<code>symlink: check_postgres_replicate_row</code>) Checks that master-slave replication is working to one or more slaves. +The slaves are specified the same as the normal databases, except with +the number 2 at the end of them, so "--port2" instead of "--port", etc. +The values or the <em>--warning</em> and <em>--critical</em> options are units of time, and +at least one must be provided (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 units are assumed to be seconds.</p> +<p>This check updates a single row on the master, and then measures how long it +takes to be applied to the slaves. To do this, you need to pick a table that +is being replicated, then find a row that can be changed, and is not going +to be changed by any other process. A specific column of this row will be changed +from one value to another. All of this is fed to the <code>repinfo</code> option, and should +contain the following options, separated by commas: table name, primary key, key id, +column, first value, second value.</p> +<p>Example 1: Slony is replicating a table named 'orders' from host 'alpha' to +host 'beta', in the database 'sales'. The primary key of the table is named +id, and we are going to test the row with an id of 3 (which is historical and +never changed). There is a column named 'salesrep' that we are going to toggle +from a value of 'slon' to 'nols' to check on the replication. We want to throw +a warning if the replication does not happen within 10 seconds.</p> +<pre> + check_postgres_replicate_row --host=alpha --dbname=sales --host2=beta + --dbname2=sales --warning=10 --repinfo=orders,id,3,salesrep,slon,nols</pre> +<p>Example 2: Bucardo is replicating a table named 'receipt' from host 'green' +to hosts 'red', 'blue', and 'yellow'. The database for both sides is 'public'. +The slave databases are running on port 5455. The primary key is named 'receipt_id', +the row we want to use has a value of 9, and the column we want to change for the +test is called 'zone'. We'll toggle between 'north' and 'south' for the value of +this column, and throw a critical if the change is not on all three slaves within 5 seconds.</p> +<pre> + check_postgres_replicate_row --host=green --port2=5455 --host2=red,blue,yellow + --critical=5 --repinfo=receipt,receipt_id,9,zone,north,south</pre> +<p>For MRTG output, returns on the first line the time in seconds the replication takes to finish. +The maximum time is set to 4 minutes 30 seconds: if no replication has taken place in that long +a time, an error is thrown.</p> +<p> +</p> <h2><a name="same_schema"><strong>same_schema</strong></a></h2> <p>(<code>symlink: check_postgres_same_schema</code>) Verifies that two databases are identical as far as their schema (but not the data within). This is particularly handy for making sure your slaves have not @@ -1099,42 +1138,19 @@ 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="replicate_row"><strong>replicate_row</strong></a></h2> -<p>(<code>symlink: check_postgres_replicate_row</code>) Checks that master-slave replication is working to one or more slaves. -The slaves are specified the same as the normal databases, except with -the number 2 at the end of them, so "--port2" instead of "--port", etc. -The values or the <em>--warning</em> and <em>--critical</em> options are units of time, and -at least one must be provided (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 units are assumed to be seconds.</p> -<p>This check updates a single row on the master, and then measures how long it -takes to be applied to the slaves. To do this, you need to pick a table that -is being replicated, then find a row that can be changed, and is not going -to be changed by any other process. A specific column of this row will be changed -from one value to another. All of this is fed to the <code>repinfo</code> option, and should -contain the following options, separated by commas: table name, primary key, key id, -column, first value, second value.</p> -<p>Example 1: Slony is replicating a table named 'orders' from host 'alpha' to -host 'beta', in the database 'sales'. The primary key of the table is named -id, and we are going to test the row with an id of 3 (which is historical and -never changed). There is a column named 'salesrep' that we are going to toggle -from a value of 'slon' to 'nols' to check on the replication. We want to throw -a warning if the replication does not happen within 10 seconds.</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". +The <em>--warning</em> and <em>--critical</em> options should be expressed as times. The default values +are <strong>60 seconds</strong> for the warning and <strong>300 seconds</strong> for the critical.</p> +<p>The optional argument <em>--schema</em> indicated the schema that Slony is installed under. If it is +not given, the schema will be determined automatically each time this check is run.</p> +<p>Example 1: Give a warning if any Slony is lagged by more than 20 seconds</p> <pre> - check_postgres_replicate_row --host=alpha --dbname=sales --host2=beta - --dbname2=sales --warning=10 --repinfo=orders,id,3,salesrep,slon,nols</pre> -<p>Example 2: Bucardo is replicating a table named 'receipt' from host 'green' -to hosts 'red', 'blue', and 'yellow'. The database for both sides is 'public'. -The slave databases are running on port 5455. The primary key is named 'receipt_id', -the row we want to use has a value of 9, and the column we want to change for the -test is called 'zone'. We'll toggle between 'north' and 'south' for the value of -this column, and throw a critical if the change is not on all three slaves within 5 seconds.</p> + check_postgres_slony_status --warning 20</pre> +<p>Example 2: Give a critical if Slony, installed under the schema "_slony", is over 10 minutes lagged</p> <pre> - check_postgres_replicate_row --host=green --port2=5455 --host2=red,blue,yellow - --critical=5 --repinfo=receipt,receipt_id,9,zone,north,south</pre> -<p>For MRTG output, returns on the first line the time in seconds the replication takes to finish. -The maximum time is set to 4 minutes 30 seconds: if no replication has taken place in that long -a time, an error is thrown.</p> + check_postgres_slony_sytatus --schema=_slony --critical=600</pre> <p> </p> <h2><a name="txn_time"><strong>txn_time</strong></a></h2> @@ -1446,10 +1462,23 @@ 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="0" class="item"><strong>Version 2.14.0</strong> (February 11, 2010)</a></strong></dt> + +<dd> +<pre> + Added the 'slony_status' action. + Changed the logfile sleep from 0.5 to 1, as 0.5 gets rounded to 0 on some boxes!</pre> +</dd> <dt><strong><a name="2" class="item"><strong>Version 2.13.2</strong> (February 4, 2010)</a></strong></dt> <dd> <pre> + Allow timeout option to be used for logtime 'sleep' time.</pre> +</dd> +<dt><strong><strong>Version 2.13.2</strong> (February 4, 2010)</strong></dt> + +<dd> +<pre> Show offending database for query_time action. Apply perflimit to main output for sequence action. Add 'noowner' option to same_schema action. @@ -1464,7 +1493,7 @@ feature requests, and commit notices, send email to <a href="mailto:check_postgr Added "nolanguage" as a filter for the same_schema option. Don't track "generic" table constraints (e.. $1, $2) using same_schema</pre> </dd> -<dt><strong><a name="0" class="item"><strong>Version 2.13.0</strong> (January 29, 2010)</a></strong></dt> +<dt><strong><strong>Version 2.13.0</strong> (January 29, 2010)</strong></dt> <dd> <pre> |