清除zabbix所有历史数据

作者: 阿乐_822e | 来源:发表于2019-07-09 16:54 被阅读0次

[root@zabbix_server zabbix]# cat clean_his.sh

#!/bin/bash

# 清除所有ZBX历史数据

User="root"

Password="123456"

$(which mysql) -u${User}  -p${Password}  -e"

use zabbix;

truncate history;

optimize table history;

truncate table history_str;

optimize table history_str;

truncate table history_uint;

optimize table history_uint;

truncate table trends;

optimize table trends;

truncate table trends_uint;

optimize table trends_uint;

truncate table events;

optimize table events;"

相关文章

网友评论

    本文标题:清除zabbix所有历史数据

    本文链接:https://www.haomeiwen.com/subject/zfhfkctx.html