Remove Orphaned Data From Zabbix’s MySQL Tables

Mattias Geniar, Monday, November 24, 2014 - last modified: Friday, March 17, 2017

A few years ago, I wrote a couple of SQL queries that I put onto Github to clean up a Zabbix database. It'll take items, triggers, events etc. that are no longer attached to a host, and remove them from the database.

This repo contains a few useful queries to cleanup old orphaned data in a Zabbix database. While Zabbix does Housekeeping, it does not clear orphaned data very well. Especially if you come from a long upgrade-line (1.x to 1.6 to 1.8 to 2.x), chances are your database is riddled with orphaned data that is consuming disk space.

I recently needed the files again after a few migrations, and they've served their purpose once again. They remain on Github for your consideration: Zabbix Orphaned Data Cleanup.

Hooray for open source! ;-)



Hi! My name is Mattias Geniar. I'm a Support Manager at Nucleus Hosting in Belgium, a general web geek & public speaker. Currently working on DNS Spy & Oh Dear!. Follow me on Twitter as @mattiasgeniar.


Share this post

Did you like this post? Will you help me share it on social media? Thanks!

Comments

fazae Friday, October 9, 2015 at 09:35 - Reply

thanks for this useful scripts


Leave a Reply

Your email address will not be published. Required fields are marked *