@@ -1331,46 +1331,58 @@ <h2><a name="query_time"><strong>query_time</strong></a></h2>
1331
1331
check_postgres_query_time --port=5432 --includeuser=don --warning=20s</ pre >
1332
1332
< p > For MRTG output, returns the length in seconds of the longest running query on the first line. The fourth
1333
1333
line gives the name of the database.</ p >
1334
+
1334
1335
< p >
1335
1336
</ p >
1337
+
1336
1338
< h2 > < a name ="replicate_row "> < strong > replicate_row</ strong > </ a > </ h2 >
1339
+
1337
1340
< p > (< code > symlink: check_postgres_replicate_row</ code > ) Checks that master-slave replication is working to one or more slaves.
1341
+
1338
1342
The slaves are specified the same as the normal databases, except with
1339
1343
the number 2 at the end of them, so "--port2" instead of "--port", etc.
1340
1344
The values or the < em > --warning</ em > and < em > --critical</ em > options are units of time, and
1341
1345
at least one must be provided (no defaults). Valid units are 'seconds', 'minutes', 'hours',
1342
1346
or 'days'. Each may be written singular or abbreviated to just the first letter.
1343
1347
If no units are given, the units are assumed to be seconds.</ p >
1348
+
1344
1349
< p > This check updates a single row on the master, and then measures how long it
1345
1350
takes to be applied to the slaves. To do this, you need to pick a table that
1346
1351
is being replicated, then find a row that can be changed, and is not going
1347
1352
to be changed by any other process. A specific column of this row will be changed
1348
1353
from one value to another. All of this is fed to the < code > repinfo</ code > option, and should
1349
1354
contain the following options, separated by commas: table name, primary key, key id,
1350
1355
column, first value, second value.</ p >
1356
+
1351
1357
< p > Example 1: Slony is replicating a table named 'orders' from host 'alpha' to
1352
1358
host 'beta', in the database 'sales'. The primary key of the table is named
1353
1359
id, and we are going to test the row with an id of 3 (which is historical and
1354
1360
never changed). There is a column named 'salesrep' that we are going to toggle
1355
1361
from a value of 'slon' to 'nols' to check on the replication. We want to throw
1356
1362
a warning if the replication does not happen within 10 seconds.</ p >
1363
+
1357
1364
< pre >
1358
1365
check_postgres_replicate_row --host=alpha --dbname=sales --host2=beta
1359
1366
--dbname2=sales --warning=10 --repinfo=orders,id,3,salesrep,slon,nols</ pre >
1367
+
1360
1368
< p > Example 2: Bucardo is replicating a table named 'receipt' from host 'green'
1361
1369
to hosts 'red', 'blue', and 'yellow'. The database for both sides is 'public'.
1362
1370
The slave databases are running on port 5455. The primary key is named 'receipt_id',
1363
1371
the row we want to use has a value of 9, and the column we want to change for the
1364
1372
test is called 'zone'. We'll toggle between 'north' and 'south' for the value of
1365
1373
this column, and throw a critical if the change is not on all three slaves within 5 seconds.</ p >
1374
+
1366
1375
< pre >
1367
1376
check_postgres_replicate_row --host=green --port2=5455 --host2=red,blue,yellow
1368
1377
--critical=5 --repinfo=receipt,receipt_id,9,zone,north,south</ pre >
1378
+
1369
1379
< p > For MRTG output, returns on the first line the time in seconds the replication takes to finish.
1370
1380
The maximum time is set to 4 minutes 30 seconds: if no replication has taken place in that long
1371
1381
a time, an error is thrown.</ p >
1382
+
1372
1383
< p >
1373
1384
</ p >
1385
+
1374
1386
< h2 > < a name ="same_schema "> < strong > same_schema</ strong > </ a > </ h2 >
1375
1387
< p > (< code > symlink: check_postgres_same_schema</ code > ) Verifies that two or more databases are identical as far as their
1376
1388
schema (but not the data within). This is particularly handy for making sure your slaves have not
0 commit comments