zabbix清空监控数据非监控项

删除历史数据的sql

truncate table history;
truncate table history_uint;
truncate table history_str;
truncate table history_text;
truncate table history_log;


删除趋势数据的sql

truncate table trends;
truncate table trends_uint;

清除报警和事件

-- ⚠️ 禁用外键检查(防止外键冲突)
SET FOREIGN_KEY_CHECKS = 0;

-- 清理报警确认记录
TRUNCATE TABLE acknowledges;

-- 清理事件标签
TRUNCATE TABLE event_tag;

-- 清理问题标签
TRUNCATE TABLE problem_tag;

-- 清理恢复映射
TRUNCATE TABLE event_recovery;

-- 清理当前/历史报警
TRUNCATE TABLE problem;

-- 清理所有事件记录(如触发器触发的事件)
TRUNCATE TABLE events;

-- ✅ 恢复外键检查
SET FOREIGN_KEY_CHECKS = 1;

posted @ 2025-05-30 10:27  lifei888  阅读(11)  评论(0)    收藏  举报