How to auto fix crashed table?

Hello,

from time to time happens that an mysql table is marked as crashed and so website dont work properly.

I want to ask what is the smartest way to fix this issue without big downtime? Any script that checks mysql and auto fix crashed table or any script which notiffy admin via email?

i got idea somehow extracting mysqld.log entries and if match email is sent, but im not good programmer so i ask advice

Assuming you are talking MySQL (if not, please specify), you won’t need a script, MySQL has this built in.
http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html
https://dev.mysql.com/doc/refman/5.0/en/rebuilding-tables.html