I have created script to check jar process is running or not, if not it will send mail. After executing it sends the mail if the process is not running.
#!/bin/sh
check_if_running()
{
   echo "Checking to make sure push processor is running"
   determine_push_pid
   if [ "$PID" != "" ]
   then
      echo "Found push processor running under process ID {$PID}"
   else
      echo "Can't determine process ID for push processor, "
    #   start_push_processor
      send_email "There is no process running on :-> $BOXNAME"
   fi
}
determine_push_pid()
{
   PID=`ps -ef | grep ams_services | grep java | grep -v DupdateProfiles | awk -F' ' ' { print $2 } '`
   if [ "$PID" != "" ]
   then
      echo "Process ID for push processor is {$PID}"
   fi
}
start_push_processor()
{
   echo "Starting push processor"
   nohup java -Dspring.profiles.active=dev -Xms2G -Xmx2G -jar #$JARFILE & 1>>$LOGFILE 2>>$echoFILE
   echo "Sleeping for $SLEEPSECONDS seconds"
   sleep $SLEEPSECONDS
   determine_push_pid
   if [ "$PID" == "" ]
   then
      echo "Can't determine new process ID for push processor, did it start?"
      send_email "Tried to start push processor, but couldn't on $BOXNAME"
   else
      echo "New PID for push processor is {$PID}"
   fi
}
send_email()
{
   DATA=$(cat <<EOF
   {
           "occurrenceTime":"$DATE",
           "systemIdentity":
                   {
                           "ip":"$IP"
                   },
           "eventType":"36c170f1-1338-4346-9d5b-737841a22166",
           "shortDesc":"Roster Alignment Alert !!",
           "properties":
                   {
                           "description":"$*",
                           "env":"$OPS_ENVIRONMENT",
                           "hostname":"$HOSTNAME"
                   }
   }
EOF
   )
     ### echo "$*"
   echo "$*" | mail -s "Roster Alignement Process Warning !!! " roster@mail.com
   echo "### Exiting with error after sending email"
   exit 1
}
SCRIPTNAME="Roster_Service.sh"
PROGNAME="ams_services"
IP=`/sbin/ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
BOXNAME="$OPS_CI_NAME ($OPS_ENVIRONMENT) ($IP)"
ENV=$OPS_ENVIRONMENT
SLEEPSECONDS=5
ACTIVITYSECONDS=600                 
CURTIME=$(date +%s)                   
TIMEDIFF=$(expr $CURTIME - $FILETIME)
JARFILE=""
P='%'
SCRIPTPID=$$
PID=""
DATE=`date +%s`
HOSTNAME=`hostname`
check_if_running
exit 0
but after running the script getting below syntax error message in terminal. 
expr: syntax error
### Starting Roster_Service.sh in dev
Checking to make sure push processor is running
Can't determine process ID for push processor,
### Exiting with error after sending email
Can anyone explain where and what thing am missing.
