Checking the connection to the PostgreSQL database


You can take actions to confirm the connection to a PostgreSQL database if no data is reported by the PostgreSQL KM.

To check the PostgreSQL database

Login to the PostgreSQL database (via pgadmin or other tool) and run the following queries to check if any of the following PostgreSQL Environment monitor attributes returns a value or is empty (null):

Attribute

Command query

SELECT sum(n_tup_ins) AS inserts FROM pg_stat_user_tables where n_tup_ins is not null;

SELECT sum(n_tup_del) AS deletes FROM pg_stat_user_tables where n_tup_del is not null;

SELECT sum(n_tup_upd) AS updates FROM pg_stat_user_tables where n_tup_upd is not null;

To check the tablespace data

If the SpaceAvailableMB and SpaceUserPCT attributes under the PostgreSQL Tablespace Metrics monitor are offline or have no data, you can perform the following actions to check the connection between the PostgreSQL KM and the PostgreSQL database.

Remote connection

Check the remote operating system connection details as follows:

  • For the Linux operating system, run the SSH client with the SSH user name and password that were inserted while configuring the PostgreSQL KM to confirm that you can connect to the database host.
  • For Windows operating system, run the WMIChecker.bat tool that was installed with the PostgreSQL KM under ~Patrol3/pgrkm/. This tool checks the connection details to the remote database host. The user name and password were inserted for a remote connection when the PostgreSQL KM was configured.

Local Connection

  • For the Linux operating system, run the following command line with a PATROL user:
df -k [TalbeSpaceLocation]
  • For Windows operating system, confirm that the PATROL operating system user has permissions to run the following command:
fsutil volume diskfree [TalbeSpaceLocation]

Related topic

Troubleshooting

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*