Though some Linux distributions package the check_postgres utility for easy installation, the versions that are included are usually very old. We recommend that you obtain a copy of the latest check_postgres source code. At the time of writing this book, the latest version is 2.22.0, released on June 30, 2015. Obtain the latest copy of the check_postgres source code from this URL: https://bucardo.org/wiki/Check_postgres
As we want to use Nagios to execute the check_postgres, please follow the steps in the Configuring Nagios to monitor a database host recipe to produce a working installation with a basic database host configuration. We will be making further modifications to the db_conf.cfg file introduced there.