Does Sentora have such a feature? It seems this is common with cpanel. I would think this would be something we should have as part of core Sentora...
Such a feature already exists within cPanel * WHM.
Documentation: Service Manager
Simply go to: WHM -> Service Manager
Then, make sure both "Enabled" and "Monitor" are checked for "mysql". This will instruct cPanel's chkservd mechanism (which runs onc per 5 minutes) to check on the status of MySQL and restart as necessary. If a restart is necessary, it will also email you about it if you have your email contact setup in WHM for the server.
However, if MySQL is crashing/unavailable that often that you're specifically asking for an auto-restart script, I would be more inclined to suggest you identify the cause of the outages. Applying a bandaid fix by auto-restarting MySQL is fine for the short-term, but you'll want to find out why MySQL is crashing in the first place so that you can prevent that from happening.
What does the MySQL log say during the time of the crash?
Feel free to open a ticket (see my signature for links) if you'd like assistance in attempting to identify the cause of MySQL crashing on your server.
Such a feature already exists within cPanel * WHM.
Documentation: Service Manager
Simply go to: WHM -> Service Manager
Then, make sure both "Enabled" and "Monitor" are checked for "mysql". This will instruct cPanel's chkservd mechanism (which runs onc per 5 minutes) to check on the status of MySQL and restart as necessary. If a restart is necessary, it will also email you about it if you have your email contact setup in WHM for the server.
However, if MySQL is crashing/unavailable that often that you're specifically asking for an auto-restart script, I would be more inclined to suggest you identify the cause of the outages. Applying a bandaid fix by auto-restarting MySQL is fine for the short-term, but you'll want to find out why MySQL is crashing in the first place so that you can prevent that from happening.
What does the MySQL log say during the time of the crash?
Feel free to open a ticket (see my signature for links) if you'd like assistance in attempting to identify the cause of MySQL crashing on your server.