Skip to content

Commit 103efe8

Browse files
committed
Make the script Zabbix 6 compatible
1 parent c99f545 commit 103efe8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ MAKE SURE TO UNCOMMENT THE CORRECT LINES FOR THE VERSION YOU NEED. Check the blo
6868
# MySQL 8.x (NOT MariaDB!)
6969
```
7070

71+
Uncomment the following line for Zabbix 5.4 and OLDER:
72+
```
73+
# $dbh->do("DELETE FROM auditlog_details WHERE NOT EXISTS (SELECT NULL FROM auditlog WHERE auditlog.auditid = auditlog_details.auditid)");
74+
```
75+
7176
That's it! You are now done and you have setup MySQL partitioning. We could execute the script manually with:
7277
```
7378
perl /usr/share/zabbix/mysql_zbx_part.pl

mysql_zbx_part.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,6 @@ sub date_next_part {
182182
sub delete_old_data {
183183
$dbh->do("DELETE FROM sessions WHERE lastaccess < UNIX_TIMESTAMP(NOW() - INTERVAL 1 MONTH)");
184184
$dbh->do("TRUNCATE housekeeper");
185-
$dbh->do("DELETE FROM auditlog_details WHERE NOT EXISTS (SELECT NULL FROM auditlog WHERE auditlog.auditid = auditlog_details.auditid)");
185+
# Uncomment the following line for Zabbix 5.4 and earlier
186+
# $dbh->do("DELETE FROM auditlog_details WHERE NOT EXISTS (SELECT NULL FROM auditlog WHERE auditlog.auditid = auditlog_details.auditid)");
186187
}

0 commit comments

Comments
 (0)