docs(procedures): refine zabbix monitor user instructions and pg_cron management section
This commit is contained in:
@@ -149,6 +149,12 @@ If you *must* connect via TCP with a specific database user and password, the `p
|
|||||||
chmod 0600 ~/.pgpass
|
chmod 0600 ~/.pgpass
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Managing `pg_cron` Jobs:**
|
||||||
|
If you need to verify or manage your scheduled jobs (run as superuser):
|
||||||
|
- To **list all active schedules**: `SELECT * FROM cron.job;`
|
||||||
|
- To **view execution logs/history**: `SELECT * FROM cron.job_run_details;`
|
||||||
|
- To **remove/unschedule** the job: `SELECT cron.unschedule('zabbix_partition_maintenance');`
|
||||||
|
|
||||||
#### Option 2: Systemd Timers
|
#### Option 2: Systemd Timers
|
||||||
Systemd timers provide better logging and error handling properties than standard cron.
|
Systemd timers provide better logging and error handling properties than standard cron.
|
||||||
|
|
||||||
@@ -199,13 +205,6 @@ If running in Docker, you can execute it via the host's cron by targeting the co
|
|||||||
30 5,23 * * * docker exec zabbix-db-test psql -U zabbix -d zabbix -c "CALL partitions.run_maintenance();"
|
30 5,23 * * * docker exec zabbix-db-test psql -U zabbix -d zabbix -c "CALL partitions.run_maintenance();"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Managing `pg_cron` Jobs
|
|
||||||
|
|
||||||
If you are using `pg_cron` for scheduling, you can verify and manage your jobs (run as superuser):
|
|
||||||
- To **list all active schedules**: `SELECT * FROM cron.job;`
|
|
||||||
- To **view execution logs/history**: `SELECT * FROM cron.job_run_details;`
|
|
||||||
- To **remove/unschedule** the job: `SELECT cron.unschedule('zabbix_partition_maintenance');`
|
|
||||||
|
|
||||||
## Monitoring & Permissions
|
## Monitoring & Permissions
|
||||||
|
|
||||||
System state can be monitored via the `partitions.monitoring` view. It includes the information about number of future partitions and the time since the last maintenance run. Plus it includes the total size of the partitioned table in bytes.
|
System state can be monitored via the `partitions.monitoring` view. It includes the information about number of future partitions and the time since the last maintenance run. Plus it includes the total size of the partitioned table in bytes.
|
||||||
|
|||||||
Reference in New Issue
Block a user