From: Greg Sabino Mullane
This documents describes check_postgres.pl version 1.6.1
+This documents describes check_postgres.pl version 1.7.0
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+
check_postgres_txn_time)
Items not specifically attributed are by Greg Sabino Mullane.
Add --replicate_row action
+Add --symlinks option as a shortcut to --action=rebuild_symlinks
@@ -1090,7 +1143,7 @@ is needed by the check_disk_space action.Fix problem with too eager creation of custom pgpass file.
Add example Nagios configuration settings (Brian A. Seklecki)
@@ -1211,7 +1264,7 @@ in your pg_xlog directory.The index bloat size optimization is still very rough.
+The index bloat size optimization is rough.
Some actions may not work on older versions of Postgres (before 8.0).
Please report any problems to greg@endpoint.com.