Install check-postgres by entering the following commands in the terminal:
sudo apt update sudo apt install check-postgres
script for monitoring PostgreSQL databases
check_postgres is a Perl script that runs many different tests against one or more Postgres databases. It uses the psql program to gather the information, and outputs the results in one of three formats: Nagios, MRTG, or simple.