Skip to content

Commit 671c309

Browse files
committed
Change housekeeper truncate to delete without events
1 parent 693d62e commit 671c309

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mysql_zbx_part.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ sub date_next_part {
222222

223223
sub delete_old_data {
224224
$dbh->do("DELETE FROM sessions WHERE lastaccess < UNIX_TIMESTAMP(NOW() - INTERVAL 1 MONTH)");
225-
$dbh->do("TRUNCATE housekeeper");
225+
$dbh->do("DELETE FROM housekeeper WHERE `tablename` !='events'");
226+
226227
# Uncomment the following line for Zabbix 5.4 and earlier
227228
# $dbh->do("DELETE FROM auditlog_details WHERE NOT EXISTS (SELECT NULL FROM auditlog WHERE auditlog.auditid = auditlog_details.auditid)");
228229
}

0 commit comments

Comments
 (0)