Simple script to monitor mysql replication delay. It updates a value on the master every second and checks how far behind the value is on the slave. Simple yet effective.
Clever approach to monitoring mysql replication with monit. Ruby script checks replication is running and then touches a file, monit in turn monitors that file's timestamp and if it gets out of date, sends an alert. Sort of like a dead man switch. Clever.