You are here

GCP - PostgreSQL Monitoring

Requires Opsview Monitor 6.2

This Host Template is part of the Google Cloud Platform Opspack

check_circle
Opsview Supported

404: Not Found

Included in the Cloud - GCP Opspack

Host Template: Cloud - GCP - PostgreSQL

Monitor your GCP Cloud PostgreSQL resources, with Service Checks including CPU, Disk and Memory Usage, Network Bytes, Connections, and PostgreSQL Connections, Transactions and Replication Lag Bytes.

This Host Template includes the following Service Checks:

Service Check Name Description Default Thresholds (Warning, Critical) UOM
GCP - PostgreSQL - Network Bytes Network received and sent bytes for the PostgreSQL instance. N/A B
GCP - PostgreSQL - Disk Operations Disk read and write operations for the PostgreSQL instance. N/A N/A
GCP - PostgreSQL - Database Availability Database uptime percentage over the period checked for the PostgreSQL instance. availability=100:100,80:100 %
GCP - PostgreSQL - Status Current serving state of the PostgreSQL instance. N/A N/A
GCP - PostgreSQL - Memory Usage Memory used by the PostgreSQL instance. memory_usage=70,90 %
GCP - PostgreSQL - Disk Usage Disk used by the PostgreSQL instance. disk_usage=70,90 %
GCP - PostgreSQL - CPU Usage CPU used by the PostgreSQL instance. cpu_usage=70,90 %
GCP - PostgreSQL - Transaction Count Number of PostgreSQL transactions. N/A N/A
GCP - PostgreSQL - Replication Lag Bytes The Replication Lag in bytes for the PostgreSQL instance. N/A B
GCP - PostgreSQL - Network Connections Number of network connections to the PostgreSQL instance. N/A N/A

Usage Instructions

The SQL API Library must be enabled to use this host template. To do this, log into your SQL Admin API Library at Google Console - APIs, and click the Enable button. It may take some time until the API is fully active.

GCP SQL API menu



Step 1: Add this Host Template

Add the Cloud - GCP - PostgreSQL Host Template to your Opsview Monitor host. If the resource you're monitoring has no hostname or public IP, then open the Advanced settings pane and change Host Check Command to Always assumed to be UP.

For more information, refer to Opsview Knowledge Center - Adding Host Templates to Hosts.



Step 2: Add and configure variables required for this Host Template

The Service Checks in this Host Template use the following variables, and they will be added to your Opsview Monitor instance when you import the Opspack:

GCP_PROJECT_ID

| Parameter | Position in Variable | Name | Description | |:---------:|:--------------------:|:-----|:------------| | --project-id | Arg1 | Monitored Project ID | ID of the project to monitor |

GCP_POSTGRESQL_DATABASE_ID

| Parameter | Position in Variable | Name | Description | |:---------:|:--------------------:|:-----|:------------| | --postgresql-database-id | Arg1 | PostgreSQL Database ID | ID of the PostgreSQL database |

GCP_CREDENTIALS_FILE

This argument is optional - if you are only using one set of credentials, we recommend not setting it, and instead placing your credentials file in the default path /opt/opsview/monitoringscripts/etc/plugins/cloud-gcp/credentials.json. Ensure this file is readable by the opsview user.

Parameter Position in Variable Name Description
--credentials-file Arg1 Credentials File Path of the JSON file with GCP Service Account Credentials


For more information, refer to Opsview Knowledge Center - Adding Variables to Hosts.

For mode-specific help, run the plugin with the -h -m <mode> flags. This will list the required and optional Variable Arguments for that mode. The appropriate mode for each Service Check is listed here:

Service Check Name Mode
GCP - PostgreSQL - Network Bytes GCP.PostgreSQL.Net.Bytes
GCP - PostgreSQL - Disk Operations GCP.PostgreSQL.Disk.Ops
GCP - PostgreSQL - Database Availability GCP.PostgreSQL.Availability
GCP - PostgreSQL - Status GCP.PostgreSQL.Status
GCP - PostgreSQL - Memory Usage GCP.PostgreSQL.Mem.Usage
GCP - PostgreSQL - Disk Usage GCP.PostgreSQL.Disk.Usage
GCP - PostgreSQL - CPU Usage GCP.PostgreSQL.CPU.Usage
GCP - PostgreSQL - Transaction Count GCP.PostgreSQL.Transactions
GCP - PostgreSQL - Replication Lag Bytes GCP.PostgreSQL.Repl.Lag.Bytes
GCP - PostgreSQL - Network Connections GCP.PostgreSQL.Net.Connections



Step 3: Apply changes and the system will now be monitored

View Output

v1.0-opsview-6

ODI-2965 Cloud-GCP Opspack

Initial release for Cloud-GCP Opspack