From 2b7ad25bc1e0ec4809fe4e1d175bfcc9360aabcf Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 11 Feb 2010 11:03:44 -0500 Subject: [PATCH] Version 2.14.0 ready --- META.yml | 4 +- Makefile.PL | 2 +- SIGNATURE | 22 +++++---- check_postgres.pl | 2 +- check_postgres.pl.asc | 6 +-- check_postgres.pl.html | 103 ++++++++++++++++++++++++++--------------- 6 files changed, 85 insertions(+), 54 deletions(-) diff --git a/META.yml b/META.yml index 5a867a731..e03919a57 100644 --- a/META.yml +++ b/META.yml @@ -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 @@ -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"; diff --git a/SIGNATURE b/SIGNATURE index c7df93ccc..018fa478f 100644 --- a/SIGNATURE +++ b/SIGNATURE @@ -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 - 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 @@
  • prepared_txns
  • query_runtime
  • query_time
  • +
  • replicate_row
  • same_schema
  • sequence
  • -
  • replicate_row
  • +
  • slony_status
  • txn_time
  • txn_idle
  • rebuild_symlinks
  • @@ -104,7 +105,7 @@

    NAME

    check_postgres.pl - a Postgres monitoring script for Nagios, MRTG, Cacti, and others

    -

    This documents describes check_postgres.pl version 2.13.2

    +

    This documents describes check_postgres.pl version 2.14.0


    @@ -1017,6 +1018,44 @@ assumed to be seconds.

    line gives the name of the database.

    +

    replicate_row

    +

    (symlink: check_postgres_replicate_row) 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 --warning and --critical 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.

    +

    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 repinfo option, and should +contain the following options, separated by commas: table name, primary key, key id, +column, first value, second value.

    +

    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.

    +
    +  check_postgres_replicate_row --host=alpha --dbname=sales --host2=beta 
    +  --dbname2=sales --warning=10 --repinfo=orders,id,3,salesrep,slon,nols
    +

    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.

    +
    + check_postgres_replicate_row --host=green --port2=5455 --host2=red,blue,yellow
    +  --critical=5 --repinfo=receipt,receipt_id,9,zone,north,south
    +

    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.

    +

    +

    same_schema

    (symlink: check_postgres_same_schema) 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.

    check_postgres_sequence --dbport=5432 --critical=50% --include=orders_id_seq

    -

    replicate_row

    -

    (symlink: check_postgres_replicate_row) 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 --warning and --critical 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.

    -

    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 repinfo option, and should -contain the following options, separated by commas: table name, primary key, key id, -column, first value, second value.

    -

    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.

    +

    slony_status

    +

    (symlink: check_postgres_slony_status) 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 --warning and --critical options should be expressed as times. The default values +are 60 seconds for the warning and 300 seconds for the critical.

    +

    The optional argument --schema 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.

    +

    Example 1: Give a warning if any Slony is lagged by more than 20 seconds

    -  check_postgres_replicate_row --host=alpha --dbname=sales --host2=beta 
    -  --dbname2=sales --warning=10 --repinfo=orders,id,3,salesrep,slon,nols
    -

    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.

    + check_postgres_slony_status --warning 20 +

    Example 2: Give a critical if Slony, installed under the schema "_slony", is over 10 minutes lagged

    - check_postgres_replicate_row --host=green --port2=5455 --host2=red,blue,yellow
    -  --critical=5 --repinfo=receipt,receipt_id,9,zone,north,south
    -

    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.

    + check_postgres_slony_sytatus --schema=_slony --critical=600

    txn_time

    @@ -1446,8 +1462,21 @@ feature requests, and commit notices, send email to HISTORY

    Items not specifically attributed are by Greg Sabino Mullane.

    +
    Version 2.14.0 (February 11, 2010)
    + +
    +
    +  Added the 'slony_status' action.
    +  Changed the logfile sleep from 0.5 to 1, as 0.5 gets rounded to 0 on some boxes!
    +
    Version 2.13.2 (February 4, 2010)
    +
    +
    +  Allow timeout option to be used for logtime 'sleep' time.
    +
    +
    Version 2.13.2 (February 4, 2010)
    +
       Show offending database for query_time action.
    @@ -1464,7 +1493,7 @@ feature requests, and commit notices, send email to Version 2.13.0 (January 29, 2010)
    +
    Version 2.13.0 (January 29, 2010)
    -- 
    2.39.5