Skip to content

Commit aa394fd

Browse files
committed
Make the script Zabbix 7 ready
1 parent e752e2f commit aa394fd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
#4 For RHEL9 based systems use the CRB repository (Rocky Linux 9 specific) to get Perl-DataTime. dnf config-manager --set-enabled crb
1010

11-
Make sure to uncomment the correct lines (see blog post), the default is setup for MySQL 5.6 or MariaDB.
11+
#5 For ZBX7.0 a new table was added (history_bin). As such, for older version we can comment the line that partitions this table.
12+
13+
Make sure to uncomment the correct lines (see blog post), the default is setup for MySQL 5.6 or MariaDB and Zabbix version higher than 7.0.
1214

1315
Also, see common issues at the bottom of the blog post.
1416

@@ -93,6 +95,11 @@ Uncomment the following line for Zabbix 5.4 and OLDER:
9395
# $dbh->do("DELETE FROM auditlog_details WHERE NOT EXISTS (SELECT NULL FROM auditlog WHERE auditlog.auditid = auditlog_details.auditid)");
9496
```
9597

98+
Comment the following line for Zabbix 6.4 and OLDER:
99+
```
100+
'history_bin' => { 'period' => 'day', 'keep_history' => '60'},
101+
```
102+
96103
That's it! You are now done and you have setup MySQL partitioning. We could execute the script manually with:
97104
```
98105
perl /usr/share/zabbix/mysql_zbx_part.pl

mysql_zbx_part.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
'history_str' => { 'period' => 'day', 'keep_history' => '60'},
1616
'history_text' => { 'period' => 'day', 'keep_history' => '60'},
1717
'history_uint' => { 'period' => 'day', 'keep_history' => '60'},
18+
# Comment the history_bin line below if you're running Zabbix versions older than 7.0
19+
'history_bin' => { 'period' => 'day', 'keep_history' => '60'},
1820
'trends' => { 'period' => 'month', 'keep_history' => '12'},
1921
'trends_uint' => { 'period' => 'month', 'keep_history' => '12'},
2022

0 commit comments

Comments
 (0)