Monitoring on CentOS 6 mkdir -p /home/scripts vim /home/scrips/monitor_serivce_tomcat.sh Add the script below into the monitor_serivce_tomcat.sh file
!/bin/bash serviceIsRunning=false var1=$(/etc/init.d/tomcat status | awk ‘{print $3}’) if [ “$var1” == ‘running’ ] then serviceIsRunning=true echo “0:200:Running” fi if [ $serviceIsRunning == false ] then echo “2:404:stop” fi