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.

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.