I'm new to monit service. I want to execute select query if a application server goes down using monit. Configuration in /etc/monitrc is like:-
check host www.example.com with address www.example.com
if failed port 80 protocol http
then exec /tmp/test.sh
and test.sh contains following with the permission of chmod a+x /tmp/test.sh
mysql -u root -p root
use database;
select * from tablename;
The monit service is not executing /tem/test.sh file. How can I do it using monit ?