自动化监控Zabbix监控ZABBIX

清除zabbix所有历史数据

2019-07-09  本文已影响0人  阿乐_822e

[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;"

上一篇 下一篇

猜你喜欢

热点阅读