I also had same problem. I wanted to restart tomcat when my web application is not responding. So, i wrote below script and added to crontab.
restart_tomcat.sh
#!/bin/bash
export JAVA_HOME=/opt/jdk1.7.0_79
export PATH=$PATH:/opt/jdk1.7.0_79/bin
status="$(/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_my_webapp| awk -F':' '{print($1)}')"
if [ "$status" != "HTTP OK" ]
then
echo "`date` ---- Restarting tomcat"
/path/to/apache-tomcat-8.5.6/bin/shutdown.sh
sleep 15
/path/to/apache-tomcat-8.5.6/bin/startup.sh
fi
crontab
*/10 * * * * /path/to/restart_tomcat.sh.sh