Remove Orphaned Data From Zabbix’s MySQL Tables

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, November 24, 2014

Follow me on Twitter as @mattiasgeniar

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! ;-)



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.