after forgetting to add postgresql to pkg_scripts in rc.conf.local on a machine I thought this might be useful. it has basic connection checks, as well as a huge range of other checks for more serious installations. it's usable for Nagios and Icinga as a monitoring plugin, but also has modes aimed at producing output for MRTG graphing etc.
OK? check_postgres is a script for monitoring various attributes of your database (transaction id status, blocked queries, long running queries, connection status and more). It is designed to work with Nagios, MRTG, or in standalone scripts. http://bucardo.org/wiki/Check_postgres
check_postgres.tgz
Description: application/tar-gz