MySQL monitoring script

A commenter recently asked if I could publish the script that I wrote to handle monitoring master-master replication. It's been almost two years since I wrote the code, and I no longer have access to the original, but I've reproduced the general code here.

Storage Replication for High Availability

My job entails running ~10 relatively busy sites. These sites are no Facebook, or Google; hell, these sites don't even crack the Alexa 100k.

Monitoring master-master replication in MySQL

UPDATE: I've added the guts of the script in the following post. A few months ago, we got our secondary MySQL server online.