OBIEE 12c Restart just BI Services (11G OPMN Services) Linux.
This is by no means the perfect script but for us it works fine , All we wanted was a way we could restart the EM OBIEE Services from Linux , With some checks to ensure everything stopped and everything we want started and then sending an email to us to let us know its all OK.
We have noticed sometimes OBIEE 12c can get stuck if not used over the weekend ... Weird huh... Only happens on selected servers for one of our clients. So we bounce the EM Services every now and then which seems to resolve the problem.
So the automated script is as below . Just create a .sh script on the Linux box and adjust the Paths in the script ( First 2 lines).. Add the Mailx command from Linux if required and your off... We have scheduled the script on a Linux Cron Job.
- Please See the code
#Restart all OBIEE BI Server Services Only
#DELIVERBI 2016
#Stop all OBIEE BI Server Services Only
# Set OBIEEHOMEPTH for bitools bin
OBIEEHOMEPTH='/u01/Middlewarehome/user_projects/domains/bi12/bitools/bin'
OBIEELOGPTH='/u01/Middlewarehome/user_projects/domains/bi12/bitools/bin/obieestartstop'
> $OBIEELOGPTH
sh $OBIEEHOMEPTH/stop.sh -i obips1,obijh1,obiccs1,obisch1,obis1 > $OBIEELOGPTH
sleep 10s
valuestopped=$( grep -ic "Stopped" $OBIEELOGPTH )
valueshutdown=$( grep -c "SHUTDOWN" $OBIEELOGPTH )
if [ $valuestopped -eq 5 ] ||
[ $valueshutdown -eq 5 ]
then
echo "LOG Found 5 stopped or Shutdown Services and Starting NOW" >> $OBIEELOGPTH;
fi
sleep 10s
sh $OBIEEHOMEPTH/start.sh -i obis1,obisch1,obiccs1,obijh1,obips1 >> $OBIEELOGPTH
# Check if all Services are running
sleep 10s
valuerunning=$( grep -c "RUNNING" $OBIEELOGPTH )
valuestarted=$( grep -ic "Started" $OBIEELOGPTH )
if [ $valuerunning -eq 8 ] & [ $valuestarted -eq 5 ] || [ $valuerunning -eq 13 ] & [ $valuestarted -eq 5 ]
then
echo "OBIEE Services Success Status End of Job" >> $OBIEELOGPTH;
echo "SUCCESS LOG Found 8 OBIEE RUNNING Services so all Components are UP" >> $OBIEELOGPTH;
echo "OBIEE STG Server Email Notification of OBIEE BI Service Restart SUCCESS" | mail -s "OBIEE stgLinux Server" -a "/u01/Middlewarehomebi12/user_projects/domains/bi12/bitools/bin/obieestartstop" Shahed@deliverbi99.co.uk
else
echo "OBIEE Services Fail Status End of Job" >> $OBIEELOGPTH;
echo "ERROR OBIEE Services Have not Started Properly Please Check logs and Services" >> $OBIEELOGPTH;
echo "OBIEE STG Server Email Notification of OBIEE BI Service Restart FAIL" | mail -s "OBIEE stgLinux Server" -a "/u01/Middlewarehomebi12/user_projects/domains/bi12/bitools/bin/obieestartstop" Shahed@deliverb99i.co.uk
fi
You Can always check if your server is sending emails by making sure mailx is working as expected just issue the mail command.
Over and Out
Sha
Note: only a member of this blog may post a comment.