Vacuum alert


Job details

Name: Vacuum alert
Platform: Postgres
Category: Capacity
Description: Checks the size of the log file.
Long description: This job checks if vacuum has been performed recently.
Version: 3.0
Default schedule: 10 7 * *
Requires engine install: No
Compatibility tag: .[type=‘instance’ & databasetype=‘postgres’]/.[newer_than_ninetwo = ‘1′]

Parameters

Name Default value Description
ignore_databases 10 The list of databases to be ignored (separated by comma).
warning_threshold 10 Will give a warning if the number of hours since last vacuum exceeds this limit.
alarm_threshold 10 Will give an alarm if the number of hours since last vacuum exceeds this limit.
ignore_schemas 10 Comma separated list of schemas to ignore (format [database_name].[schema_name]).
min_table_size 10 Minimum table size (in KB) to be checked if vacuumed.
min_DML_operations 10 Minimum number of DML operations (insert, update and delete) on a table to be checked if vacuumed.

Job Summary

SELECT pg_stat_all_tables.schemaname, pg_stat_all_tables.relname, pg_stat_all_tables.last_vacuum, pg_stat_all_tables.last_autovacuum FROM pg_stat_all_tables WHERE pg_stat_all_tables.last_vacuum < now() - interval 'desired period' OR pg_stat_all_tables.last_autovacuum < now() - interval 'desired period';

Details of the Monitoring Task

Notifications and Output

Implementation Specifics

The set-up and operation of this monitoring job are crucial for maintaining the health of PostgreSQL databases, particularly in environments with regular bulk data updates, ensuring ongoing performance and storage optimizations through timely vacuum operations.