TODO
On Zabbix DB host run following
mysql -u root -p zabbix < partition_maintenance.sql
Make sure event scheduler is turned on
mysql -u root -p zabbix -e "SHOW GLOBAL VARIABLES LIKE 'event_scheduler';"
If it is OFF
or 0
add following to my.cnf
file
event_scheduler = 1
as well as enable it without database restart
SET GLOBAL event_scheduler=1;
In order to keep track of last partition expiration following must be done
Import zabbix_template_v*.xml
via Zabbix UI
Place userparameter_mysql_partitions.conf
in /etc/zabbix/zabbix_agentd.d/
(default)
The script used in user param rely on .my.cnf
file available for credentials. Place it in zabbix user home directory. File must include user and password.
Example
$ grep zabbix /etc/passwd | awk -F':' '{print $6}'
/var/lib/zabbix/
$ sudo touch /var/lib/zabbix/.my.cnf && sudo chown zabbix. /var/lib/zabbix/.my.cnf && sudo chmod 600 /var/lib/zabbix/.my.cnf
$ sudo vim /var/lib/zabbix/.my.cnf
/var/lib/zabbix/.my.cnf
contents
[client]
user = root
password = <redacted>
- Add
Recreate appropriate tables to use partitions
- Add zabbix 4+ templates