Cacti (home)ForumsDocumentation

optimize database

type:
userscript
userscript:
optimize_database
author:
gandalf
description:
optimize all Cacti tables having unused space
version:
1.1
pia:
none
date:
2012-07-30
scripts:
mysql,
table,
optimize,
database

Download

This script can be download here: optimize-database-latest.tgz

Purpose

Performing database inserts and deletes, MySQL tables will have unused space allocated. This script will check all Cacti tables for such a condition and optimize that very tables using basic MySQL techniques

Features

Prerequisites

Installation

Usage

php -q optimize_database.php

Additional Help?

If you need additional help, please go to

Possible Bugs?

Sample Output

php -q optimize_database.php 
Optimizing All Cacti Database Tables
Optimizing Table -> 'host', freeing 20 bytes: Successful
Optimizing Table -> 'mac_track_processes', freeing 188 bytes: Successful
Optimizing Table -> 'mac_track_vlans', freeing 456 bytes: Successful
Optimizing Table -> 'manage_host', freeing 60 bytes: Successful
Optimizing Table -> 'plugin_hmib_hrSWRun', freeing 2324 bytes: Successful
Optimizing Table -> 'plugin_hmib_hrSWRun_last_seen', freeing 120 bytes: Successful
Optimizing Table -> 'plugin_hmib_hrSystem', freeing 120 bytes: Successful
Optimizing Table -> 'plugin_hmib_processes', freeing 156 bytes: Successful
Optimizing Table -> 'plugin_thold_log', freeing 152 bytes: Successful
Optimizing Table -> 'poller_command', freeing 280 bytes: Successful
Optimizing Table -> 'poller_output', freeing 160052 bytes: Successful
Optimizing Table -> 'poller_output_boost', freeing 6520 bytes: Successful
Optimizing Table -> 'poller_output_boost_processes', freeing 1855 bytes: Successful
Optimizing Table -> 'thold_data', freeing 33684 bytes: Successful
Optimizing Table -> 'xen_stats', freeing 448 bytes: Successful





Personal Tools