pg_ctl status responds with "available" during failed startup I am using pg_ctl -D $PGDATA status to monitor whether my postgres standby database is up and running. Sometimes the database fails to start due to a missing WAL file, but its status is reported as "available".

Is there a simple way to see if postgres is available using the pg_ctl status option, or do I need to write a script to query the postgres database and monitor the output from script?
The pg_ctl status command tests that the postmaster process (corresponding to $PGDATA) does exist from the point of view of the operating system. In the positive case, it reports that it's running (note that the word available is not used).

Essentially that's implemented by reading postmaster.pid and checking the result of kill(that_pid, 0).

It does not mean that this PostgreSQL instance does accept connections or is able to execute queries. To that purpose, better use psql or a script like Nagios check_postgres plugin.