How to do it...

Install check_postgres by following these steps:

  1. Use these commands to extract the check_postgres source and enter the source directory:
        tar -xzf check_postgres-2.21.0.tar.gz
        cd check_postgres-2.21.0/
  1. Next, build and install the actual software with these commands:
        perl Makefile.PL
        make
        sudo make install

As the postgres user on a PostgreSQL server, try using these commands to obtain database information:

  1. Check the state of the database size with this command:
        check_postgres.pl --action=database_size -w 100MB -c 200MB
  1. Create a large table by executing this SQL as the postgres user in the postgres database:
        CREATE TABLE bigtable AS
        SELECT generate_series(1,1000000) AS vals;
  1. Cause a critical alert by executing ...

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.