echo 'MONITOR : ' `hostname` `date` >>/outfile1 echo 'MONITOR : App is NOT running ' >>/outfile1 return 2 fi itso-sles12-powerha-n-1 :~ # cat itsoStart.s h #!/bin/ksh93 # ARICENT_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # Copyright Aricent Holdings Luxembourg S.a.r.l. 2018. All rights reserved. # # ARICENT_PROLOG_END_TAG # echo "START called : " >>/data1/outputfile /powerha/application1.sh >/data1/outputfile 2>&1 & if (( $? == 0 )) then echo "START : "`hostname` `date` >>/data1/outfile1 echo "START : Application started 
" >>/data1/outfile1 return 0 else echo "START : "`hostname` `date` >>/data1/outfile1 echo "START : Application could not be started. 
" >>/data1/outfile1 return 1 fi itso-sles12-powerha-n-1 :~ # cat itsoStopt.s h #!/bin/ksh93 # ARICENT_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # Copyright Aricent Holdings Luxembourg S.a.r.l. 2018. All rights reserved. # # ARICENT_PROLOG_END_TAG # echo "STOP Called :" >>/data1/outfile1 PID=$(ps -ef | grep -w application1.sh | grep -v "grep" | awk {'print $2'}) if [[ -n $PID ]] then echo "STOP : " `hostname` `date` >>/data1/outfile1 echo "STOP : Application stopped " >>/data1/outfile1 kill -9 $PID else echo "STOP : " `hostname` `date` >>/data1/outfile1 echo "STOP : Application PID is not there " >>/data1/outfile1 fi return 0 itso-sles12-powerha-n-1:~ # 

