We are using Nagios XI which stores all kind of monitoring data in MySQL databases - nagios and nagiosql. Due to high activity a lot of tables get fragmented very often. Inspired by Sean Hull's article on MySQL data fragmentation I decided to automate this job using Perl.