Database status


Job details

Name: Database status
Platform: Postgres
Category: Availability
Description: This job monitors the availability status of databases in a PostgreSQL instance by checking the datallowconn column in the pg_database system catalog.
Long description: This job monitors the availability status of databases in a PostgreSQL instance by checking the datallowconn column in the pg_database system catalog.
Version: 1.0
Default schedule: 7,17,27,37,47,57 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘postgres’]/.[hasengine=‘YES’]

Parameters

Name Default value Description
ignore databases List of databases (separated by comma) which will be ignored.
ignore OLD status NO Ignore databases if status (datallowconn = false) have been registered for a period of time controlled by parameter “ignore status time threshold”.
ignore status time threshold 96 If the parameter “ignore OLD status” is set to “YES“ and the database has been not accessible for a period of time that exceeds the value of this parameter (in hours), then the database will be ignored.
return status 2 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when a database is not accessible.

Job Summary

Detailed Description

This monitoring job examines if databases in a PostgreSQL instance allow connections by inspecting the “datallowconn” column. If a database has “datallowconn” set to ‘false’, it implies that the database is not currently accepting connections. This status triggers a warning or an alarm based on the job’s configured thresholds.

Job Configuration

The job runs at a default schedule: every 7, 17, 27, 37, 47, and 57 minutes of each hour.

Job Dependencies

Several objects and procedures are crucial for this job:

Database Status Presentation

The system creates a report template that includes comprehensive details:

Additional Implementation Considerations

The job implementation involves setting up necessary tables and indices:

This structured configuration and detailed monitoring logic are designed to help maintain high availability and prompt status awareness of databases within a PostgreSQL environment.