feat/fix(procedures): sync procedures and docs from test branch
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
-- Creates a view to monitor partition status and sizes.
|
||||
-- ============================================================================
|
||||
|
||||
CREATE OR REPLACE VIEW partitions.monitoring AS
|
||||
DROP VIEW IF EXISTS partitions.monitoring;
|
||||
CREATE VIEW partitions.monitoring AS
|
||||
SELECT
|
||||
parent.relname AS parent_table,
|
||||
c.table_name,
|
||||
|
||||
@@ -55,7 +55,7 @@ If you are deploying Zabbix on a fresh database instance (like AWS RDS) rather t
|
||||
## Installation
|
||||
|
||||
The installation is performed by executing the SQL procedures in the following order:
|
||||
1. Initialize schema (`00_partitions_init.sql`).
|
||||
1. Initialize schema (`00_schema_create.sql`).
|
||||
2. Install maintenance procedures (`01_maintenance.sql`).
|
||||
3. Enable partitioning on tables (`02_enable_partitioning.sql`).
|
||||
4. Install monitoring views (`03_monitoring_view.sql`).
|
||||
@@ -70,7 +70,7 @@ DB_HOST="localhost" # Or your RDS endpoint
|
||||
DB_NAME="zabbix"
|
||||
DB_USER="zabbix"
|
||||
|
||||
for script in 00_partitions_init.sql 01_maintenance.sql 02_enable_partitioning.sql 03_monitoring_view.sql; do
|
||||
for script in 00_schema_create.sql 01_maintenance.sql 02_enable_partitioning.sql 03_monitoring_view.sql; do
|
||||
echo "Applying $script..."
|
||||
psql -h $DB_HOST -U $DB_USER -d $DB_NAME -f "$script"
|
||||
done
|
||||
@@ -247,6 +247,9 @@ GRANT USAGE ON SCHEMA partitions TO zbx_monitor;
|
||||
GRANT SELECT ON partitions.monitoring TO zbx_monitor;
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> If you ever apply updates to `03_monitoring_view.sql`, you should run the script as the `zabbix` database user (the original creator of the view). The script drops and recreates the view, so running it as `zabbix` ensures the view retains its ownership and preserves existing `GRANT` permissions for read-only users.
|
||||
|
||||
## Implementation Details
|
||||
|
||||
### `auditlog` Table
|
||||
|
||||
Reference in New Issue
Block a user