Перейти к содержимому

Zabbix. Очистить базу zabbix.

Заходим в mysql

mysql -u root

B ходим в базу

use zabbix;

И чистим

DELETE FROM history WHERE itemid NOT IN (SELECT itemid FROM items WHERE status='0');
DELETE FROM history_uint WHERE itemid NOT IN (SELECT itemid FROM items WHERE status='0');
DELETE FROM history_str WHERE itemid NOT IN (SELECT itemid FROM items WHERE status='0');
DELETE FROM history_text WHERE itemid NOT IN (SELECT itemid FROM items WHERE status='0');
DELETE FROM history_log WHERE itemid NOT IN (SELECT itemid FROM items WHERE status='0');
DELETE FROM trends WHERE itemid NOT IN (SELECT itemid FROM items WHERE status='0');
DELETE FROM trends_uint WHERE itemid NOT IN (SELECT itemid FROM items WHERE status='0');

и 2 вариант

TRUNCATE alerts;
TRUNCATE acknowledges;
TRUNCATE events CASCADE;
TRUNCATE auditlog CASCADE;
TRUNCATE auditlog_details CASCADE;
TRUNCATE history;
TRUNCATE history_uint;
TRUNCATE history_log;
TRUNCATE history_str;
TRUNCATE history_text;
TRUNCATE trends;
TRUNCATE trends_uint;
TRUNCATE auditlog;

 

Similar Posts:

Метки:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Яндекс.Метрика