If in case your new OEM13c doesn’t have Always ON Feature & Management server goes down so in that you can monitor the monitoring URL by using simple unix command to called “curl”. It ping the URL whether it alive or not.
#Title:chkoem_url.ksh
#Author: Sandeep R Narani
#Date:02/23/2016
echo "This scripts monitors the OEM URL for 15mins"
URL=https://oracleslbhostname/em/faces/logon/core-uifwk-console-login
APP_NAME=OEM13c
DATE=$(date)
status_code=$(/bin/timeout 5 curl -vk $URL -o /tmp/healthcheck.log -w "\n%{http_code}\n")
MAIL_TO=youremail@gmail.com
if [ $status_code == 200 ]
then
##echo "13c Oracle Management Server is Working Fine"
echo "13c Oracle Management Server is UP" | /bin/mailx -v -s "${APP_NAME} is UP on ${DATE} with ${status_code} status" ${MAIL_TO}
else
echo "13c Oracle Management Server is DOWN" | /bin/mailx -v -s "${APP_NAME} is down on ${DATE} with ${status_code} status" ${MAIL_TO}
# Add the mail command after echo statement with a pipe, which is 'mail -s "${APP_NAME} is down on ${DATE} with ${status_code} status" ${MAIL_TO}'
fi
you can schedule using crontab or Autosys scheduler
*/15 * * * * /u01/app/oracle/chkoem_url.ksh
Leave a comment