Wait a minute! We never added a check for PostgreSQL itself! As we can't allow PostgreSQL to remain unmonitored, create a user on our PostgreSQL server with the following command:
CREATE USER nagios;
Then, make an entry in the pg_hba.conf file to allow trusted checks from the monitoring server with this line:
host template1 nagios 192.168.56.5/32 trust
Then, reload the PostgreSQL configuration with this command:
pg_ctl -D $PGDATA reload
Next, add a service entry to our db_conf.cfg file like this:
define service { use generic-service hostgroup_name pg-servers service_description PostgreSQL Status check_command check_pgsql }
After reloading our Nagios configuration files, click on the Services link in the web interface. ...