Kauperts::MysqlSlaveChecker is a simple abstraction to access the output of MySQL’s ‘SHOW SLAVE STATUS´ in Ruby.
It translates all column names found in the status output to downcased/underscore’d Ruby methods on the instance.
It is nothing but a quick hackdown and doesn’t even come with tests. It’s currently used as a standalone command line tool with performed actions based on their status at the bottom of the file.
MYSQL_USERNAME=le_slave MYSQL_PASSWORD=foo MYSQL_SOCKET=/var/run/mysql.sock ./mysql_slave_checker.rb
The class depends on the mysql
gem (duh…).
-
Add tests
-
Make this a gem
Kauperts::MysqlSlaveChecker is released under a 3-clause BSD-licence. See the LICENSE file for details.