[check_postgres] check_postgres_txn_time -H POSTCIBBDB -db pcibb --warning=60s --critical=120s -dbuser postgres -dbpass postgres --port=5434 --include=pcibb

David Christensen david at endpoint.com
Mon Jul 14 16:03:37 UTC 2014


On Jul 14, 2014, at 10:42 AM, Yehudah Edelstein <YEHUDAED at cellcom.co.il> wrote:

> Hi,
> 	At the end I got it to work by playing around with the quotes for thw warning and critical parameters:
> $pg/check_postgres_txn_time -H ${HST} -db ${INSTANCE} --warning="${WARN}"  --critical="${CRIT}" -dbuser postgres -dbpass ${pswd} --port=${port}  --include=${INSTANCE}  > ${TEMPFILE2}

That honestly sounds like it's unlikely related to the issue, and I'd suspect the long-running query text itself was causing output parsing issues, but since it is a transient issue probably sorted itself out when that specific query finished running.

> Though I came up with another problem trying to run check_postgres_disk_space:
> check_postgres_disk_space -H postcibbdb -p 5434 -db pcibb -u postgres --dbpass=postgres
> POSTGRES_DISK_SPACE UNKNOWN: DB "pcibb" (host:postcibbdb) (port=5434) Could not find data directory "/CIBB/data01" | time=0.02s
> 
> It somehow knows the data directory is "/CIBB/data01" BUT can't find it.
> I'm running this API from another Linux server. The disk does exist on the remote server postcibbdb. The other (10) checks are successful.
> i.e.
> $pg/check_postgres_connection -H postcibbdb -p 5434 -db pcibb -u postgres --dbpass=postgres
> POSTGRES_CONNECTION OK: DB "pcibb" (host:postcibbdb) (port=5434) version 9.3.4 | time=0.01s

The disk check needs to run on the same server as the data directory itself; it gets the path from the equivalent setting (data_directory) from the connection, but as you can see it looks on the local machine for this path.

> The disk exists:
> /dev/mapper/vg_cibb_data-vol_cibb_data 1048064000 461772228 586291772    45% /CIBB/data01
> 
> My guess is that it's some syntax problem. I need to check the archive disk, the data disk, and the logfile disk. How can I do that, without knowing in advance what the directory names are? The same script I want to run on various servers (different DBs).

You just need to run this check directly on the servers in question; if you want to run this from a central server, you can make this a ssh to the appropriate server and then run the command in question; e.g.:

$ ssh logserver check_postgres_disk_space -H postcibbdb -p 5434 -db pcibb -u postgres --dbpass=postgres

HTH,

David
--
David Christensen
End Point Corporation
david at endpoint.com
785-727-1171





More information about the Check_postgres mailing list