I guess I am not getting what you want to do. Is the MySQL server in a pool behind the LTM? If so you could use a perl script on another computer to probe the MySQL database then up iControl to mark the server up or down.
I guess my big question is why? If you are using Apache and TomCat to get to the database server then if they are down then the access point to the database is down so for the most part the database is down if you cannot access it.
Now like I said before if you have the MySQL box behind the BigIP and other things are hitting it besides the web application. Then you need to monitor the MySql box and not through the site. To do this on the pool you can use tcp monitor this will make sure the server is listening on the MySQL port. Then you can user the perl/iControl script to more in depth monitoring of the database, using SQL querys. Note what ever you monitor using the perl script must not change or you risk the iContol script taking down the pool when it should not. As to how you write the iContol script there are a lot of posts that talk about how to mark down a member with a iControl script. Hope this help you.