Zabbix alarm queue cleaning

Scenario: Due to a network failure, several hundred or thousands of
zabbix machines have been alerted , and the mail failed to be sent for many times, resulting in a lot of warning queues accumulated, and other mails have a delay in processing: Method 1. Modify the mysql zabbix library alerts table ,
Change the status to sent or send failed (recommended) Method 2. Directly clean up the alerts table, but this operation will also cause the action log to be cleaned up.
Description: The alerts table is an alarm log table, which records the information sent by zabbix action. Status field meaning: 0 means to be sent, 1 means sending is normal, 2 means sending failed.
Suggestion: Back up the data when modifying or deleting the database, command: mysqldump -u -p library name table name>table name.sql
Method 1:
1. Check how many actions to be sent currently exist in alerts;
mysql> select count(*) from alerts where status =0;
Zabbix alarm queue cleaning

2. Update the status of the action to be sent
mysql> update zabbix.alerts set status = 1 where sttaus = 0;
3. Restart the
zabbix -server service #systemctl restart zabbix_server
Method 2:
(For this method, please back up the alerts table first)
1. View The statements created in the alerts table are recorded and re-created after cleaning up
mysql> show create table alerts;
Zabbix alarm queue cleaning
2. Delete the alerts table
mysql> drop table alterts;
3. Restart the zabbix -server service and check whether the status is normal
#systemctl restart zabbix_server

systemctl status zabbix_server

Guess you like

Origin blog.51cto.com/14483703/2545424