Cricket mysql-status Collector

I’ve written a simple Cricket data collector for MySQL. It tracks the majority (if not all) of the information provided in the MySQL “SHOW STATUS” command. You can download the current version of mysql-status here; it is distributed under the GPL. It is written in perl and requires the DBI and DBD::mysql packages from CPAN.

mysql-status is similar to Heikki Hannikainen’s cricket-mysql-dbi, but runs as an external script and only issues a single SHOW STATUS command. It does not use crickets still-experimental SQL data source support.

Usage

The recommended usage for mysql-status is to create a new heirarchy in the cricket-config directory; I recommend calling it /mysqlstatus. Place the mysql-status script in your cricket installation’s utils directory. Run it with the -c option to generate output suitable for using as a Cricket “Defaults” file for your new heirarchy. Running it with -C generates the same config with the addition of several useful graphs in the view.

Next, define hosts in the heirarchy with options set for mysql access. Example:

Target mysql.example.com
    short-desc = "My DB Server"
    target-type = "mysql-basic"
    mysql-user = 'someuser'
    mysql-pass = 'thepassword'

The user you define needs very few access rights (only SELECT, I believe). I recommend defining limited monitoring user specifically for this purpose.