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

Yehudah Edelstein YEHUDAED at cellcom.co.il
Mon Jul 14 15:42:34 UTC 2014


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}

Thank you for responding.

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 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).
Thank you for any assistance you can give me.
Yehudah

-----Original Message-----
From: David Christensen [mailto:david at endpoint.com] 
Sent: Monday, July 14, 2014 6:12 PM
To: Yehudah Edelstein
Cc: check_postgres at bucardo.org
Subject: Re: [check_postgres] check_postgres_txn_time -H POSTCIBBDB -db pcibb --warning=60s --critical=120s -dbuser postgres -dbpass postgres --port=5434 --include=pcibb

> Hello,
>         Could you help with this error?
>  
> + /ORACLE_HOME/oracle/product/postgresql/postgresql-9.3.2/check_postgres-2.21.0/check_postgres_txn_time -H POSTCIBBDB -db pcibb --warning=60s --critical=120s -dbuser postgres -dbpass postgres --port=5434 --include=pcibb
> Could not parse psql output!
> Please report these details to check_postgres at bucardo.org:
> Version:          2.21.0
> Action:           txn_time
> Calling line:     7579
> Output:           ')::varchar(2000)), ((NULL)::bytea), (('')::varchar(4000)), (('0')::char(3)), ((635408413778477177)::int8), (('׳”׳¢׳ª׳§׳ª ׳§׳•׳‘׳¥ ׳œ׳ž׳—׳¡׳Ÿ')::varchar(100)), (('V-DOCPRD1')::varchar(64)), (('EAI_DocumentManagement.Archive')::varchar(50)), (('EAI_DocumentManagement.Archive.ArchiveFile')::varchar(100)), (('EAI_DocumentManagement.Archive.ArchiveFile.ExecuteTask')::varchar(50)), (('0')::varchar(50)), (('')::varchar(50)), (('')::varchar(25)), (('')::varchar(20)), (('')::varchar(50)), (('')::varchar(100)), (('{eaeeb409-9d7f-46db-9922-e5d068bd7b60}')::varchar(50)), (('')::varchar(50)), ((NULL)::bytea), ((21)::int2))
> Command:          /usr/bin/psql -q -t -d pcibb -U postgres -p 5434 -h POSTCIBBDB -o /tmp/VU46VDVgbE/check_postgres_psql.3q5YjPe.tmp -x-c "SELECT datname, datid, pid AS pid, usename, client_addr, xact_start, query AS query, state AS state, CASE WHEN client_port < 0 THEN 0 ELSE client_port END AS client_port, COALESCE(ROUND(EXTRACT(epoch FROM now()-xact_start)),0) AS seconds FROM pg_stat_activity WHERE (xact_start IS NOT NULL) ORDER BY xact_start, query_start, pid DESC"
> Postgres version: PostgreSQL 9.3.4

Hi Yehudah,

Is this a consistent error, or something that only occasionally causes issues, and is it always related to the specific query?  What version of DBI/DBD::Pg are you using?

Can you look in the run_command() function and add UNLINK => 0 in the tempfile() command (line 2226 in the reported version), then attach a copy of the generated output tempfile?  (You can/should change this back before running this in production, but for the purposes of testing this will give us the raw output of the command.)

Regards,

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




---------------------------------------------------------------------------------------------------------------
This e-mail message may contain confidential, commercial and privileged information or data that
constitute proprietary information of Cellcom Israel Ltd. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient you are hereby notified that any use
of this information or data by any other person is absolutely prohibited.
If you are not the intended recipient, please delete all copies.

Thank You.
http://www.cellcom.co.il


More information about the Check_postgres mailing list