docs: move pg_cron job management instructions to generic maintenance section
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
# Zabbix PostgreSQL Partitioning Monitoring
|
||||
|
||||
This directory contains an extremely efficient, production-ready Zabbix Native Agent 2 monitoring suite designed to track the health of your actively partitioned PostgreSQL database tables.
|
||||
This template relies on Zabbix Agent 2 and its PostgreSQL plugin. It allows you to monitor the health of your partitioned PostgreSQL database tables. It uses a single master item to pull all metrics in bulk over a single database connection, dynamically distributing the numbers to Zabbix using Dependent Items.
|
||||
There are three item prototypes:
|
||||
1. Future Partitions Buffer: Number of future partitions to be created
|
||||
2. Total Size Bytes: Total size of the partitioned table in bytes
|
||||
3. Time Since Last Maintenance: Time since the last maintenance script was run
|
||||
They allows to monitor all the critical metrics and also they do have a triggers, which will create a problem in case something is wrong with the partitioning.
|
||||
|
||||
This template natively leverages the Zabbix Agent 2 backend. It uses a single, highly-optimized master payload query (`partitions.get_all.sql`) to pull all metrics in bulk over a single database connection, dynamically distributing the numbers to Zabbix using Dependent Items.
|
||||
|
||||
### Step-by-Step Setup
|
||||
1. Copy the **one** SQL file (`template/partitions.get_all.sql`) into a secure directory on your Agent machine. E.g., `/etc/zabbix/zabbix_agent2.d/postgresql/`.
|
||||
2. Secure the local Linux permissions so the Zabbix user can strictly read it:
|
||||
```bash
|
||||
chown -R zabbix:zabbix /etc/zabbix/zabbix_agent2.d/postgresql
|
||||
chmod 644 /etc/zabbix/zabbix_agent2.d/postgresql/*.sql
|
||||
```
|
||||
3. Open your main `/etc/zabbix/zabbix_agent2.conf` file. Scroll to the absolute bottom and add these exact lines to safely establish your custom query module AND a secure named session (e.g., `AWS_RDS`):
|
||||
### Setup
|
||||
1. Copy the SQL file (`template/partitions.get_all.sql`) into a directory on your Agent machine. E.g., `/etc/zabbix/zabbix_agent2.d/postgresql/`.
|
||||
2. Install zabbix-agent2-plugin-postgresql package.
|
||||
3. Open your Plugin configuration file `/etc/zabbix/zabbix_agent2.d/plugins.d/postgresql.conf` and add these lines to establish your custom query module AND a secure named session (e.g., `AWS_RDS`). Adjust the parameters to match your environment. You can use uri instead of named session if you want. In this case you will need to modify the item keys to use the correct parameters.
|
||||
```ini
|
||||
# 1. Enable Loadable Custom Queries (Mandatory in Zabbix 7.4+)
|
||||
Plugins.PostgreSQL.CustomQueriesPath=/etc/zabbix/zabbix_agent2.d/postgresql/
|
||||
@@ -24,12 +23,10 @@ This template natively leverages the Zabbix Agent 2 backend. It uses a single, h
|
||||
Plugins.PostgreSQL.Sessions.AWS_RDS.TLSConnect=verify_full
|
||||
Plugins.PostgreSQL.Sessions.AWS_RDS.TLSCAFile=/etc/zabbix/global-bundle.pem
|
||||
```
|
||||
4. Restart your agent to lock the session and SSL configurations into memory:
|
||||
4. Restart your agent to apply the changes:
|
||||
```bash
|
||||
systemctl restart zabbix-agent2
|
||||
```
|
||||
5. Import the `zbx_pg_partitions_monitor_agent2.yaml` template directly into your Zabbix Frontend.
|
||||
6. Attach the template to your Host, navigate to its "Macros" tab, and define strictly exactly this **one** macro:
|
||||
* `{$PG.CONNSTRING.AGENT2}`: `AWS_RDS`
|
||||
|
||||
*(By pointing this macro to the Session name we built in Step 3, you are telling Zabbix to seamlessly abandon all plaintext frontend passwords and rely 100% on the encrypted local session parameters!)*
|
||||
5. Import the `zbx_pg_partitions_monitor_agent2.yaml` template into your Zabbix.
|
||||
6. Link the template to your Host, navigate to its "Macros" tab, and define the needed macros (in this case it's just named session):
|
||||
* `{$PG.CONNSTRING.AGENT2}`: `AWS_RDS`
|
||||
|
||||
Reference in New Issue
Block a user