Remove junk events from Zabbix database, before migration

Events with source=3 is not required on new instance:
0, EVENT_SOURCE_TRIGGERS - Event was generated by a trigger status change
1, EVENT_SOURCE_DISCOVERY - Event was generated by discovery module
2, EVENT_SOURCE_AUTO_REGISTRATION - Event was generated by auto registration module
3, EVENT_SOURCE_INTERNAL - An internal event generated by items, LLD rules or triggers state change
Remote them with:
# show the event count per source
select source,count(*) from events grouped by source;

# check out what actually is content of these records
select * from events where source=3 limit 1;
 
# remove events
delete from events where source=3 limit 10;
delete from events where source=3 limit 100;
delete from events where source=3 limit 1000;
delete from events where source=3 limit 10000;

No comments: