How to do it...

Follow these steps on the monitoring system to watch the 192.168.56.10 server, which is the first node of our PostgreSQL cluster:

  1. Find the configuration directory for Nagios:
    • Debian-based servers should use this path: /etc/nagios3/conf.d
    • Red Hat-based servers should use this path: /etc/nagios/objects
  2. As a root-level user, create a file named db_conf.cfg in the preceding path.
  3. In the db_conf.cfg file, define a hostgroup entry by adding this text:
        define hostgroup { 
            hostgroup_name  pg-servers 
             alias           PostgreSQL Servers 
        } 
  1. In the db_conf.cfg file, define a host entry by adding this text:
       define host {
       use generic-host
       host_name pg-1
       alias PostgreSQL Node 1
       address 192.168.56.10
       hostgroups pg-servers
       }
  1. In the db_conf.cfg ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.