HOSTNAME=`hostname`
PROCESS_NAME=/usr/share/tomcat
# プロセス数を確認
PIDNUM=$(ps -ef |grep $PROCESS_NAME |grep -v grep |wc -l)
if [ $PIDNUM -eq 0 ];then
echo -e "\033[31m$HOSTNAME tomcat is stopped.\033[0m"
else
echo -e "\033[32m$HOSTNAME tomcat is running.\033[0m"
if [ $PIDNUM -ne 1 ];then
echo -e "\033[31mProccess number didn't equal 1\033[0m"
fi
fi