Top Banner
Management Pack for PostgreSQL VMware vRealize True Visibility Suite 1.0
34

PostgreSQL Management Pack for

May 15, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PostgreSQL Management Pack for

Management Pack for PostgreSQL

VMware vRealize True Visibility Suite 1.0

Page 2: PostgreSQL Management Pack for

You can find the most up-to-date technical documentation on the VMware website at:

https://docs.vmware.com/

VMware, Inc.3401 Hillview Ave.Palo Alto, CA 94304www.vmware.com

Copyright ©

2021 VMware, Inc. All rights reserved. Copyright and trademark information.

Management Pack for PostgreSQL

VMware, Inc. 2

Page 3: PostgreSQL Management Pack for

Contents

1 Management Pack for PostgreSQL 4

2 System Requirements (PostgreSQL) 5Configuring Database Permissions and the Least-Privileged User (PostgreSQL) 5

3 Installing the Management Pack (PostgreSQL) 9

4 Configuring the Management Pack (PostgreSQL) 12Creating a Credential (PostgreSQL) 12

Creating an Adapter Instance (PostgreSQL) 14

Validating Data Collection (PostgreSQL) 16

5 Troubleshooting the Management Pack (PostgreSQL) 18

6 Using the Management Pack (PostgreSQL) 20Resource Kinds and Relationships (PostgreSQL) 20

Inventory Tree (Traversal Spec) (PostgreSQL) 21

Dashboards (PostgreSQL) 22

PostgreSQL Overview 23

PostgreSQL on OS 23

PostgreSQL on VM 24

PostgreSQL IOPS 24

PostgreSQL Top-N Queries 25

Views (PostgreSQL) 26

Reports (PostgreSQL) 27

Alerts (PostgreSQL) 28

Metrics (PostgreSQL) 29

VMware, Inc. 3

Page 4: PostgreSQL Management Pack for

Management Pack for PostgreSQL 1The VMware vRealize® True Visibility™ Management Pack for PostgreSQL is an embedded adapter for vRealize Operations (vROps), collecting performance data from your PostgreSQL systems and providing predictive analytics and real-time information about problems in your infrastructure—all within the vRealize Operations user interface.

Notable Features

The Management Pack harnesses powerful vRealize Operations features such as:

n 5 comprehensive monitoring dashboards:

n PostgreSQL Overview

n PostgreSQL on VM

n PostgreSQL on OS

n PostgreSQL IOPS

n PostgreSQL Top 10 Queries

n Key performance metrics such as Memory, CPU, Disk, Waits, Sessions, Queries, and Tablespace

n Out-of-the-box reports for Database, Instance, Slow Query, and Throughput

n Relationship mapping between PostgreSQL and the VMware virtual layer

n Detailed alerts and recommendations

VMware, Inc. 4

Page 5: PostgreSQL Management Pack for

System Requirements (PostgreSQL) 2Before installing and configuring the Management Pack, ensure your system meets the following requirements:

vRealize Operations Requirements PostgreSQL Requirements

Version(s) vRealize Operations v6.3+ (Enterprise edition only)

PostgreSQL 9.4+

Connection vROps hostname or IP address

IP address or hostname of PostgreSQL instance

Default Port: 5432 (TCP)

Database name

Note By default, the Management Pack will connect to ‘pg_ database’ and retrieve available databases through it. If another database is specified when adding an adapter instance, it will connect to that database only.

Credentials vROps User Name/Password with access to vRealize Suite API is required

PostgreSQL User Name/Password

The Management Pack requires a least-privileged user (LPU) account of read-only*. For details on creating an LPU, see: Configuring Database Permissions and the Least-Privileged User (PostgreSQL).

Note *NOTE: Tablespace and query data are not returned for PostgreSQL read-only users. Assigning the monitoring user/role a “super user” attribute will correct this limitation. Alternatively, using our defined LPU script will allow you to bypass assigning the "super user" attribute. See: Configuring Database Permissions and the Least-Privileged User (PostgreSQL).

Note Prior to configuring an adapter instance for the Management Pack, ensure the required PostgreSQL views, tables, and functions are added for resources being monitored. See: Configuring Database Permissions and the Least-Privileged User (PostgreSQL) for more information.

This chapter includes the following topics:

n Configuring Database Permissions and the Least-Privileged User (PostgreSQL)

Configuring Database Permissions and the Least-Privileged User (PostgreSQL)

VMware, Inc. 5

Page 6: PostgreSQL Management Pack for

The following topic outlines the required views, tables, and functions needed to properly monitor each PostgreSQL database resource.

n PostgreSQL Required Views, Tables, and Functions

n Creating a Least-Privileged User (LPU)

PostgreSQL Required Views, Tables, and Functions

The table below lists PostgreSQL database resource kinds and their required views, tables, or functions needed to monitor each resource correctly. Prior to configuring an adapter instance for the Management Pack, ensure the following PostgreSQL function/query functionality is added for your PostgreSQL resources.

Note To help automate the assignment of the following permissions, you can run the script provided in Creating a Least-Privileged User (LPU).

Resource Type View/Table/Function Name Required? Version

Instance pg_stat_bgwriter Yes 9.0+

Database pg_stat_database Yes 9.0+

Database pg_database Yes 9.0+

Database pg_stat_database_conflicts Yes 9.1+

Database pg_tablespace Yes 9.0+

Tablespace* pg_user* Yes 9.0+

Table pg_stat_user_tables No 9.0+

Table pg_statio_user_tables No 9.0+

Table pg_tables No 9.0+

Trigger pg_trigger No 9.1+

Index pg_stat_user_indexes No 9.0+

Index pg_statio_user_indexes No 9.0+

Function pg_stat_user_functions No 9.0+

Sequence pg_statio_all_sequences Yes 9.0+

Management Pack for PostgreSQL

VMware, Inc. 6

Page 7: PostgreSQL Management Pack for

Resource Type View/Table/Function Name Required? Version

Session pg_stat_activity Yes 9.2+

Query* pg_stat_statements* Yes 9.0+

Note *NOTE: For security, an administrative-level monitoring user (i.e., “super user”) is required to view the SQL text or queryid of queries executed by other users. An “insufficient privileges” error will be returned in the Query text field if a read-only user is used. Tablespace data also requires an administrative-level monitoring user. However, using our defined LPU script will allow you to bypass assigning the "super user" attribute. See: Creating a Least-Privileged User (LPU).

Function Tracking: To track functions, ‘pg_stat_user_functions’ requires the log_statement_stats field to be modified (in postgresql.conf) to allow for any function tracking to happen.

Reference: http://www.postgresql.org/docs/current/static/runtime-config-statistics.html#GUC-TRACK-FUNCTIONS

Query Tracking: To track queries, these settings need to be added to the shared_preload_libraries settings:

shared_preload_libraries = ‘pg_stat_statements’

pg_stat_statements.max = 10000

pg_stat_statements.track = all

You also need to create the extension in the database. The extension is database bound and must be created for each database, even though it pulls data from each:

CREATE EXTENSION IF NOT EXISTS pg_stat_statements

You can check if it is installed on the database by calling:

SELECT *

FROM pg_available_extensions

WHERE name = ‘pg_stat_statements’ AND installed_version IS NOT NULL

Creating a Least-Privileged User (LPU)

To help automate the creation of a least-privileged user (LPU) for your PostgreSQL instance, run the following script on the database you plan to monitor. If you're monitoring multiple databases, run the script on the postgres database.

CREATE SCHEMA bluemedora;CREATE EXTENSION IF NOT EXISTS pg_stat_statements;CREATE OR REPLACE FUNCTION bluemedora.pg_stat_statements() RETURNS SETOF pg_stat_statements AS$$SELECT * FROM public.pg_stat_statements;$$ LANGUAGE sql VOLATILE SECURITY DEFINER;

CREATE OR REPLACE FUNCTION public.explain_this (

Management Pack for PostgreSQL

VMware, Inc. 7

Page 8: PostgreSQL Management Pack for

l_query text, out explain json )RETURNS SETOF json AS$$BEGIN RETURN QUERY EXECUTE 'explain (format json) ' || l_query;END;$$LANGUAGE 'plpgsql'VOLATILERETURNS NULL ON NULL INPUTSECURITY DEFINERCOST 100 ROWS 1000;

CREATE USER lpu WITH PASSWORD 'tmppassword';GRANT SELECT ON pg_database TO lpu;GRANT SELECT ON pg_stat_bgwriter TO lpu;GRANT SELECT ON pg_stat_database TO lpu;GRANT SELECT ON pg_stat_user_indexes TO lpu;GRANT SELECT ON pg_stat_user_tables TO lpu;GRANT SELECT ON pg_statio_all_sequences TO lpu;GRANT SELECT ON pg_statio_user_indexes TO lpu;GRANT SELECT ON pg_statio_user_tables TO lpu;GRANT SELECT ON pg_tables TO lpu;GRANT SELECT ON pg_tablespace TO lpu;GRANT SELECT ON pg_user TO lpu;GRANT SELECT ON pg_stat_replication TO lpu;GRANT SELECT ON pg_stat_database_conflicts TO lpu;GRANT SELECT ON pg_trigger TO lpu;GRANT SELECT ON pg_stat_activity TO lpu;GRANT SELECT ON pg_stat_statements TO lpu;GRANT USAGE ON SCHEMA bluemedora TO lpu;GRANT EXECUTE ON FUNCTION public.explain_this(l_query text, out explain text) TO lpu;

Note PostgreSQL databases previous to 9.2 may need to edit the script above.

Once complete, you can ensure the user has the EXPLAIN privilege by running:

SELECT exists( SELECT 1 FROM information_schema.role_routine_grants WHERE routine_name='explain_this' AND privilege_type='EXECUTE' AND grantee='explainer');

This query should return a single row with a single column of "exists" with a value of "true".

Note If the user has permissions to read from your tables and views, they do not require this special EXPLAIN permission.

Management Pack for PostgreSQL

VMware, Inc. 8

Page 9: PostgreSQL Management Pack for

Installing the Management Pack (PostgreSQL) 3This vRealize Operations Management Pack is installed using a .pak file.

1 Log in to vRealize Operations as an admin user.

2 From the top navigation bar, select Administration. In the left panel, the default Solutions

view will be selected. In the right panel, click the Add icon.

Note If you are using vROps 7.5, Solutions will have two subcategories: Configuration and Repository. Select Repository and scroll down to Other Management Packs and select Add a Management Pack to install a new management pack. Refer to the second screenshot below if needed.

vROps versions 7 and lower:

vROps version 7.5:

VMware, Inc. 9

Page 10: PostgreSQL Management Pack for

3 The Add Solution window will appear. Browse to the location of the saved .pak file, then click Upload.

Management Pack for PostgreSQL

VMware, Inc. 10

Page 11: PostgreSQL Management Pack for

4 Click Next when the upload has finished.

5 Read and accept the End User License Agreement (EULA), then click Next.

6 Click Finish when the installation process is complete.

Management Pack for PostgreSQL

VMware, Inc. 11

Page 12: PostgreSQL Management Pack for

Configuring the Management Pack (PostgreSQL) 4Configuring the Management Pack for PostgreSQL in vRealize Operations includes the following required tasks:

n Creating a Credential (PostgreSQL)

n Creating an Adapter Instance (PostgreSQL)

Note In addition, you may want to perform one or more of the following optional tasks to further configure the Management Pack for your specific needs:

n Validating Data Collection (PostgreSQL) (optional)

This chapter includes the following topics:

n Creating a Credential (PostgreSQL)

n Creating an Adapter Instance (PostgreSQL)

n Validating Data Collection (PostgreSQL)

Creating a Credential (PostgreSQL)

One of the required configuration tasks for the Management Pack is to create a set of credentials in vROps.

Prerequisites

n Chapter 3 Installing the Management Pack (PostgreSQL)

VMware, Inc. 12

Page 13: PostgreSQL Management Pack for

Procedure

1 From the top navigation bar, select Administration. In the left panel, expand the Management category and select Credentials.

2 Click the Add icon. In the Manage Credential window that appears, enter the following information, then click OK:

Results

n Credential name: A name for this set of Management Pack credentials

n User Name: PostgreSQL User Name

Management Pack for PostgreSQL

VMware, Inc. 13

Page 14: PostgreSQL Management Pack for

n Password: PostgreSQL Password

n vRealize Username: vRealize Operations Username

n vRealize Password: Password associated with vRealize Operations Username

Note The vRealize user name/password must have access to vRealize Suite API.

What to do next

Creating an Adapter Instance (PostgreSQL)

Creating an Adapter Instance (PostgreSQL)

Before you can begin using the Management Pack, you must create an adapter instance to identify the host from which the Management Pack will retrieve data.

Prerequisites

n Chapter 3 Installing the Management Pack (PostgreSQL)

n Creating a Credential (PostgreSQL)

Procedure

1 Log in to vRealize Operations as an admin user.

2 Click the Administration icon. In the right panel, the Solutions view will be displayed.

3 Select PostgreSQL Adapter from the Solutions list.

4 Click the Configure icon. The Manage Solution window will appear.

Note Click the Add icon above theInstance Namelist on the left to create multiple adapter instances.

Management Pack for PostgreSQL

VMware, Inc. 14

Page 15: PostgreSQL Management Pack for

5 In the Manage Solution window, enter the following information:

a Instance Settings:

n Display Name: A name for this particular instance of the Management Pack

n Description: Optional, but it can be helpful to describe multiple adapter instances of the Management Pack

b Basic Settings:

n Database: Optional; will connect to ‘pg_database’ and retrieve available databases. If one (or more) is specified here (comma-separated), the Management Pack will connect to that database only.

n Host: Hostname or IP address of PostgreSQL instance

n Port: Default port is 5432 (TCP); can be overridden

n Credential: Select the credential you created when Creating a Credential (PostgreSQL).

Management Pack for PostgreSQL

VMware, Inc. 15

Page 16: PostgreSQL Management Pack for

c Advanced Settings:

n Collectors/Groups: Default Collector/Group is automatically selected. Click the drop-down menu if you want to run the collection on a different node.

n Function Count: Default = 10; enter “0” to disable

n Monitor Tables: True/False

n Order Functions By: Average Time, Calls, Total Time

n Order Queries By: Average Time, Calls, Total Time

n Query Count: Default = 10; enter “0” to disable

n SSL mode: Disable/Require

n Support Autodiscovery: Default setting is True, which enables the adapter instance to create resources for you. This should not be set to False.

6 Click Test Connection to test the configured connection information. Click Save Settings and Close to save your adapter instance.

What to do next

n To validate data collection, see: Validating Data Collection (PostgreSQL).

Validating Data Collection (PostgreSQL)

After you add an adapter instance, you will most likely want to validate the data that it collects in vROps. Wait until one collection cycle is complete and the Collection Status for the adapter instance on the Solutions page shows as "Data Receiving".

Prerequisites

n Creating an Adapter Instance (PostgreSQL)

Procedure

1 From the top navigation bar, select Environment.

2 In the left panel, select All Objects, then expand the PostgreSQL Adapter objects list.

Management Pack for PostgreSQL

VMware, Inc. 16

Page 17: PostgreSQL Management Pack for

3 Select a resource from the list, then click the All Metrics tab to select metrics and validate values against the data source.

What to do next

To learn more about using the Management Pack, see: Chapter 6 Using the Management Pack (PostgreSQL).

Management Pack for PostgreSQL

VMware, Inc. 17

Page 18: PostgreSQL Management Pack for

Troubleshooting the Management Pack (PostgreSQL) 5Once you have finished Chapter 3 Installing the Management Pack (PostgreSQL) and Chapter 4 Configuring the Management Pack (PostgreSQL), check the Collection State and Collection Status for the adapter instance on the Solutions page. If they show as Not Collecting or No Data Receiving, respectively, the following troubleshooting topics can help you diagnose and correct common problems with your adapter instance.

n Test Connection Errors

n Adapter and Collector Log Files

Test Connection Errors

When Creating an Adapter Instance (PostgreSQL), click Test Connection after entering all of your configuration settings to ensure vROps can connect to the specified host.

The following errors are possible:

Wrong Credentials

Error: Unable to establish a valid connection to target system. Connection authorization failure occurred. Reason: User ID or Password invalid.

Action: Ensure the correct PostgreSQL and vRealize Operations User Name and Password was entered when Creating a Credential (PostgreSQL).

Wrong Host

Error: Unable to establish a valid connection to target system. Required property is unknown host.

Action: Ensure the correct hostname or IP address of the PostgreSQL instance was entered when Creating an Adapter Instance (PostgreSQL).

Wrong Port

Error: Unable to establish a valid connection to target system. Connection authorization failure occurred. Error opening socket server <name> on port with message: Connection refused.

Action: Check your PostgreSQL database system and ensure the connection port number matches the port number entered (if other than default of 5432) when Creating an Adapter Instance (PostgreSQL)

VMware, Inc. 18

Page 19: PostgreSQL Management Pack for

Wrong Database

Error: Connection authorization failure occurred. The application server rejected establishment of the connection. An attempt was made to access a database, <name>, which was either not found or does not support transactions.

Action: Ensure the database name(s) provided match the PostgreSQL system. Multiple databases should be separated by commas in the Manage Solution window. See: Creating an Adapter Instance (PostgreSQL).

SSL Not Enabled

Error: SSL connection is not enabled.

Action: Under Advanced Settings, set SSL mode to be Enabled (required). See: Creating an Adapter Instance (PostgreSQL).

Server Does Not Support SSL

Error: The server does not support SSL connections.

Action: Under Advanced Settings, set SSL mode setting to Disabled. See: Creating an Adapter Instance (PostgreSQL).

Adapter and Collector Log Files

You can review adapter errors in the adapter and collector log files, which can be viewed in the vROps UI or in an external log viewer.

n Adapter log files are located in the $VCOPS_BASE/user/log/adapters/PostgreSQLAdapter/ folder.

n Collector log files are located in the $VCOPS_BASE/user/log/ folder.

To set the base log level for the collector in vROps:

1 Navigate to Administration > Logs.

2 Expand the MASTER folder, then select the COLLECTOR folder.

3 Click the Edit Properties icon.

4 In the Root logger level drop-down menu, select the desired option.

n The default logging level is warning.

n To troubleshoot issues, set the logging level to info.

n To view detailed messages, including micro steps, queries, and returned results, set the logging level to debug.

Note If you set the logging level to debug , log files can become large very quickly. Set the logging level to debug only for short periods of time.

For more information about viewing log files and modifying levels, refer to the vROps online help.

Management Pack for PostgreSQL

VMware, Inc. 19

Page 20: PostgreSQL Management Pack for

Using the Management Pack (PostgreSQL) 6The Management Pack for PostgreSQL includes the following out-of-the-box features, harnessing the power of the vRealize Operations user interface:

n Resource Kinds and Relationships (PostgreSQL)

n Inventory Tree (Traversal Spec) (PostgreSQL)

n Dashboards (PostgreSQL)

n Views (PostgreSQL)

n Reports (PostgreSQL)

n Alerts (PostgreSQL)

n Metrics (PostgreSQL)

This chapter includes the following topics:

n Resource Kinds and Relationships (PostgreSQL)

n Inventory Tree (Traversal Spec) (PostgreSQL)

n Dashboards (PostgreSQL)

n Views (PostgreSQL)

n Reports (PostgreSQL)

n Alerts (PostgreSQL)

n Metrics (PostgreSQL)

Resource Kinds and Relationships (PostgreSQL)

The Management Pack for PostgreSQL creates Resource Kinds and Relationships (associations) for critical resources in your PostgreSQL environment.

VMware, Inc. 20

Page 21: PostgreSQL Management Pack for

Resource Kinds

Performance data, relationships, and events are collected for the following PostgreSQL resource kinds:

1 PostgreSQL Instance

2 PostgreSQL Database

3 PostgreSQL Table

n Indexes(if disabled, index and trigger instance metric groups will not be returned)

4 PostgreSQL Query (requires ‘pg_stat_statments’ to be enabled)

5 PostgreSQL Function (requires ‘pg_stat_user_functions’ to be enabled)

Relationships

Relationships among discovered resources are also created by the Management Pack. The hierarchical structure of those relationships is depicted in the diagram below.

PostgreSQL Relationships Diagram

Inventory Tree (Traversal Spec) (PostgreSQL)

The Inventory Tree (Traversal Spec) feature in vROps allows you to easily navigate your PostgreSQL environment. The hierarchical structure implicitly shows relationships among resources and enables quick drill-downs to root-cause issues.

To access your PostgreSQL Inventory Tree, navigate to Environment > Inventory Trees.

Management Pack for PostgreSQL

VMware, Inc. 21

Page 22: PostgreSQL Management Pack for

Example Inventory Trees – PostgreSQL

Icon Legend

Database

Function

Instance

Query

Table

Dashboards (PostgreSQL)

Dashboards are the primary feature for monitoring and troubleshooting PostgreSQL data problems from within vRealize Operations.

Management Pack for PostgreSQL

VMware, Inc. 22

Page 23: PostgreSQL Management Pack for

The following dashboards are included in the Management Pack for PostgreSQL:

n PostgreSQL Overview

n PostgreSQL on OS

n PostgreSQL on VM

n PostgreSQL IOPS

n PostgreSQL Top-N Queries

PostgreSQL Overview

The PostgreSQL Overview dashboard displays heat maps depicting the overall health of PostgreSQL databases.

PostgreSQL on OS

ThePostgreSQL on OSdashboard allows you to select a PostgreSQL database and related operating system (if available) in order to view key performance metrics (KPIs) for each.

Management Pack for PostgreSQL

VMware, Inc. 23

Page 24: PostgreSQL Management Pack for

PostgreSQL on VM

ThePostgreSQL on VMdashboard allows the user to select a PostgreSQL database and related virtual machine to view key performance indicators (KPIs) for each.

PostgreSQL IOPS

ThePostgreSQL IOPSdashboard allows the user to select a PostgreSQL database to view IO stats for the related database, virtual machine, and datastore.

Management Pack for PostgreSQL

VMware, Inc. 24

Page 25: PostgreSQL Management Pack for

PostgreSQL Top-N Queries

ThePostgreSQL Top-N Queriesdashboard allows the user to select a PostgreSQL database to view a ranking of the Top 10 slowest queries. The dashboard also allows you to select individual queries from the heat map to view performance metrics for the selected query.

Management Pack for PostgreSQL

VMware, Inc. 25

Page 26: PostgreSQL Management Pack for

Views (PostgreSQL)

The Management Pack for PostgreSQL creates views that allow the user to view statistics of metrics for various PostgreSQL resources. The views help give a broad picture of the entire system, as opposed to a more in depth view.

The following views are available in the Management Pack:

View Type Description

PostgreSQL Database Overview List Provides a overview of database performance metrics.

PostgreSQL Instance Overview List Provides an overview of instance performance metrics.

PostgreSQL Slowest Queries List Provides a list of slowest queries metrics.

PostgreSQL Throughput List Provides a list of throughput metrics.

To access the Management Pack views:

1 Navigate to Environment > All Objects > PostgreSQL.

2 Double-click on the desired object (resource).

3 Select the Details tab, then Views.

Management Pack for PostgreSQL

VMware, Inc. 26

Page 27: PostgreSQL Management Pack for

The available views for that resource are listed and can be selected.

Accessing Views

Reports (PostgreSQL)

The Management Pack for PostgreSQL contains four out-of-the-box reports that you can export and easily share with key stakeholders in either .pdf or .csv formats.

The following reports are available in the Management Pack:

Report Description

PostgreSQL Databases Report Provides a overview of database performance metrics.

PostgreSQL Instance Report Provides an overview of instance performance metrics.

PostgreSQL Slowest Queries Report Provides a list of slowest queries metrics.

PostgreSQL Throughput Report Provides a list of throughput metrics.

To access Management Pack reports:

1 Navigate to Environment > All Objects > PostgreSQL.

2 Double-click on the desired object (resource).

3 Select the Reports tab, then Report Templates.

The available report(s) for the selected resource are listed and can be selected.

To run a selected report, click the Run Template icon.

Accessing Reports

Management Pack for PostgreSQL

VMware, Inc. 27

Page 28: PostgreSQL Management Pack for

Alerts (PostgreSQL)

The Management Pack for PostgreSQL pulls PostgreSQL database health indicators and displays them in vRealize Operations as alerts. See the table below for the list of alerts available in the Management Pack.

Alerts List

Name Description Recommendation

Max Written Clean (Per Second) is Higher than Normal

The number of times the background writer has overwritten the maximum number of buffers (when a checkpoint is performed) is much higher than normal.

Consider increasing the value of “bgwriter_lru_maxpages” in postgresql.conf to increase performance.

Tablespace Size is Higher than Normal

The size of your Database is much higher than normal

Consider running a VACUUM to recover disk space.

Database Size is Higher than Normal

The size of your Database is much higher than normal

Consider running a VACUUM to recover disk space.

Table Size is Higher than Normal

The size of your Table is much higher than normal

Consider running a VACUUM to recover disk space.

Temp Files Created is Higher than Normal

The number of temporary files created is higher than normal. This can cause slower performance and I/O contention.

Consider increasing the “work_mem” in the postgresql.conf file.

Management Pack for PostgreSQL

VMware, Inc. 28

Page 29: PostgreSQL Management Pack for

Name Description Recommendation

Dead Rows is Higher than Normal

The dead rows for this table are higher than normal.

To clear the dead rows, consider running “VACUUM FULL” or “CLUSTER” during a maintenance window.

Queries Cancelled are Higher than Normal

The number of queries that are being cancelled is higher than normal.

Consider enabling “hot_standby_feedback” in the postgresql.conf file to avoid cancelled queries. Warning: This could create bloat in the primary database.

Metrics (PostgreSQL)

The Management Pack for PostgreSQL collects the metrics listed in the table below, according to PostgreSQL resource kinds.

Download metrics list as .csv file

Resource Kind Resource Group Resource Attribute Attribute Type

PostgreSQL Instance Tablespaces|General Tablespace Size double

PostgreSQL Instance Tablespaces|Configuration Tablespace Name string

PostgreSQL Instance Tablespaces|Configuration Tablespace Location string

PostgreSQL Instance Tablespaces|Configuration Tablespace Location string

PostgreSQL Instance Tablespaces|Configuration Tablespace Owner string

PostgreSQL Instance Tablespaces|Configuration Privileges string

PostgreSQL Instance Tablespaces|Configuration User Name string

PostgreSQL Instance Tablespaces|Configuration IP Address string

PostgreSQL Instance Tablespaces|Configuration Port integer

PostgreSQL Instance Tablespaces|Configuration Instance Name string

PostgreSQL Instance Buffers Buffers Allocated double

PostgreSQL Instance Buffers Times Backend Executed Own fsync double

PostgreSQL Instance Buffers Times Background Writer Stopped Due to too Many Buffers

double

PostgreSQL Instance Buffers Buffers Written by Backend double

PostgreSQL Instance Buffers Buffers Written by Background Writer double

PostgreSQL Instance Buffers Buffers Written During Checkpoint double

PostgreSQL Instance Configuration Name string

PostgreSQL Instance Configuration Server IP string

Management Pack for PostgreSQL

VMware, Inc. 29

Page 30: PostgreSQL Management Pack for

Resource Kind Resource Group Resource Attribute Attribute Type

PostgreSQL Instance Configuration Server Port integer

PostgreSQL Instance Configuration Last Time Stats Reset string

PostgreSQL Instance Configuration Version string

PostgreSQL Instance Checkpoints Scheduled Checkpoints Performed double

PostgreSQL Instance Checkpoints Time Synchronizing Checkpoint Files to Disk double

PostgreSQL Instance Checkpoints Requested Checkpoints Performed double

PostgreSQL Instance Checkpoints Time Writing Checkpoint Files to Disk double

PostgreSQL Database Sessions Number of Active Connections integer

PostgreSQL Database Sessions Total Sessions integer

PostgreSQL Database Sessions Active Sessions integer

PostgreSQL Database Sessions Idle Sessions integer

PostgreSQL Database Sessions Idle Sessions in Transaction integer

PostgreSQL Database Sessions Idle Sessions in Transaction (Aborted) integer

PostgreSQL Database Sessions Sessions Executing Fastpath Function Call integer

PostgreSQL Database Sessions Sessions with Unknown State (Track Activities is Disabled)

integer

PostgreSQL Database General Canceled Queries Due to Conflicts integer

PostgreSQL Database General Deadlock Count integer

PostgreSQL Database General Database Size integer

PostgreSQL Database General Last Timestamp Stats Reset string

PostgreSQL Database Activity Rows Deleted double

PostgreSQL Database Activity Rows Returned double

PostgreSQL Database Activity Rows Updated double

PostgreSQL Database Activity Rows Fetched double

PostgreSQL Database Activity Rows Inserted double

PostgreSQL Database Configuration Tablespace Name string

PostgreSQL Database Configuration Database Name string

PostgreSQL Database Configuration Database ID integer

PostgreSQL Database Configuration IP Address string

Management Pack for PostgreSQL

VMware, Inc. 30

Page 31: PostgreSQL Management Pack for

Resource Kind Resource Group Resource Attribute Attribute Type

PostgreSQL Database Configuration Port integer

PostgreSQL Database Conflicts Queries Canceled Due to Deadlocks double

PostgreSQL Database Conflicts Queries Canceled Due to Old Snapshot double

PostgreSQL Database Conflicts Queries Canceled Due to Lock Timeouts double

PostgreSQL Database Conflicts Queries Canceled Due to Dropped Tablespaces double

PostgreSQL Database Conflicts Queries Canceled Due to Pinned Buffers double

PostgreSQL Database Transactions Transaction Rollbacks double

PostgreSQL Database Transactions Transaction Commits double

PostgreSQL Database Disk IO Temporary Bytes Written double

PostgreSQL Database Disk IO Temporary Files Created double

PostgreSQL Database Disk IO Buffer Hit Ratios double

PostgreSQL Database Disk IO Block Reads/Buffer Misses double

PostgreSQL Database Disk IO Time Spent Writing Data double

PostgreSQL Database Disk IO Buffer Hits double

PostgreSQL Database Disk IO Time Spent Reading Data double

PostgreSQL Database Disk IO Blocks Read by Sequences integer

PostgreSQL Database Disk IO Blocks Hit by Sequences integer

PostgreSQL Table Triggers|Configuration Trigger Enabled Status string

PostgreSQL Table Triggers|Configuration Trigger ID double

PostgreSQL Table Triggers|Configuration Trigger Name string

PostgreSQL Table Triggers|Configuration Type of Trigger Fire integer

PostgreSQL Table Triggers|Configuration Arguments Passed to Trigger string

PostgreSQL Table Triggers|Configuration Table ID integer

PostgreSQL Table Triggers|Configuration Table Name string

PostgreSQL Table Triggers|Configuration Function Name string

PostgreSQL Table Triggers|Configuration Function ID integer

PostgreSQL Table Triggers|Configuration IP Address string

PostgreSQL Table Triggers|Configuration Port integer

PostgreSQL Table Indexes|Activity Number of Block Reads integer

Management Pack for PostgreSQL

VMware, Inc. 31

Page 32: PostgreSQL Management Pack for

Resource Kind Resource Group Resource Attribute Attribute Type

PostgreSQL Table Indexes|Activity Number of Table Rows Fetched by Scan integer

PostgreSQL Table Indexes|Activity Number of Buffer Hits integer

PostgreSQL Table Indexes|Activity Number of Index Entries Returned integer

PostgreSQL Table Indexes|Activity Number of Scans integer

PostgreSQL Table Indexes|Configuration Index ID string

PostgreSQL Table Indexes|Configuration Index Name string

PostgreSQL Table Indexes|Configuration Table Name string

PostgreSQL Table Indexes|Configuration Schema Name string

PostgreSQL Table Indexes|Configuration Table ID integer

PostgreSQL Table Indexes|Configuration IP Address string

PostgreSQL Table Indexes|Configuration Port integer

PostgreSQL Table General Table Size integer

PostgreSQL Table Activity Number of Rows Updated double

PostgreSQL Table Activity Number of Sequential Scans double

PostgreSQL Table Activity Last Time Table Analyzed by Auto Daemon string

PostgreSQL Table Activity Number of Dead Rows double

PostgreSQL Table Activity Last Time Table Vacuumed by Auto Daemon string

PostgreSQL Table Activity Number of Rows Deleted double

PostgreSQL Table Activity Last Time Table Manually Analyzed string

PostgreSQL Table Activity Number of Index Scans double

PostgreSQL Table Activity Number of Rows Inserted double

PostgreSQL Table Activity Number of Times Table Manually Vacuumed double

PostgreSQL Table Activity Number of Times Table Vacuumed By Auto Daemon

double

PostgreSQL Table Activity Last Time Table Manually Vacuumed string

PostgreSQL Table Activity Number of Rows Fetched by Index Scans double

PostgreSQL Table Activity Number of Times Table Manually Analyzed double

PostgreSQL Table Activity Number of Rows Modified Since Last Analyzed integer

PostgreSQL Table Activity Number of Times Table Analyzed by Auto Daemon

double

Management Pack for PostgreSQL

VMware, Inc. 32

Page 33: PostgreSQL Management Pack for

Resource Kind Resource Group Resource Attribute Attribute Type

PostgreSQL Table Activity Rows fetched by Sequential Scans double

PostgreSQL Table Activity Number of Live Rows double

PostgreSQL Table Activity Number of Rows Hot Updated (No separate index update requried)

double

PostgreSQL Table Configuration Table ID integer

PostgreSQL Table Configuration Tablespace Name string

PostgreSQL Table Configuration Database Name string

PostgreSQL Table Configuration Table Name string

PostgreSQL Table Configuration Table Schema string

PostgreSQL Table Configuration IP Address string

PostgreSQL Table Configuration Port integer

PostgreSQL Table Disk IO Number of Block Reads from Indexes double

PostgreSQL Table Disk IO Number of Block Reads double

PostgreSQL Table Disk IO Number of Buffer Reads double

PostgreSQL Table Disk IO Number of Block Reads from TOAST Table Indexes

double

PostgreSQL Table Disk IO Number of Buffer Hits from TOAST Table double

PostgreSQL Table Disk IO Number of Buffer Hits from Indexes double

PostgreSQL Table Disk IO Number of Buffer Hits from TOAST Table Indexes

double

PostgreSQL Table Disk IO Number of Block Reads from TOAST Table double

PostgreSQL Function Activity Total Time Spent Calling This and All Called Functions

double

PostgreSQL Function Activity Average Total Call Time double

PostgreSQL Function Activity Times Called double

PostgreSQL Function Activity Time Spent on This Function Alone (not referenced functions)

double

PostgreSQL Function Configuration Schema Name string

PostgreSQL Function Configuration Function Name string

PostgreSQL Function Configuration Function ID integer

PostgreSQL Function Configuration IP Address string

PostgreSQL Function Configuration Port integer

Management Pack for PostgreSQL

VMware, Inc. 33

Page 34: PostgreSQL Management Pack for

Resource Kind Resource Group Resource Attribute Attribute Type

PostgreSQL Function Configuration Database Name string

PostgreSQL Function Configuration Rank integer

PostgreSQL Query Activity Query Text string

PostgreSQL Query Activity Total Time double

PostgreSQL Query Activity Average Time Spent Per Call double

PostgreSQL Query Activity Number of Calls double

PostgreSQL Query Activity Rows Returned integer

PostgreSQL Query Configuration User Name string

PostgreSQL Query Configuration Database Name string

PostgreSQL Query Configuration IP Address string

PostgreSQL Query Configuration Port integer

PostgreSQL Query Configuration Rank integer

PostgreSQL Query Disk IO Local Block Cache Hits integer

PostgreSQL Query Disk IO Shared Block Reads integer

PostgreSQL Query Disk IO Shared Blocks Written integer

PostgreSQL Query Disk IO Total Time Spent Writing Blocks integer

PostgreSQL Query Disk IO Shared Blocks Dirty Read integer

PostgreSQL Query Disk IO Local Block Reads integer

PostgreSQL Query Disk IO Shared Block Cache Hits integer

PostgreSQL Query Disk IO Local Blocks Dirty Read integer

PostgreSQL Query Disk IO Total Time Spent Reading Blocks integer

PostgreSQL Query Disk IO Local Blocks Written integer

Management Pack for PostgreSQL

VMware, Inc. 34