WLST script to monitor WebLogic status, heap, JDBC, and JMS
Do you want a custom script to send out an email that reports on your Oracle WebLogic Server status, heap, data source, and JMS information?
If you want the an equivalent of the output below, all you need is a single crontab entry, a single bash script, and a single WLST Python script, all included below.
Basic scripting and WLST knowledge is required. The scripts can be customized to your liking.
Crontab:
# --------------------------------------------------------------------------------
# 2020-03-16 | Script to monitor WebLogic Server
# --------------------------------------------------------------------------------
0 * * * * /home/oracle/scripts/monitorSOAWLS.sh > /dev/null 2>&1
soamonitor.sh:
#!/bin/bash
##############################################
# Weblogic Server Monitoring Script
# Author: Ahmed Aboulnaga
# Date: 2020-03-16
##############################################
#----------------------------------------
# Variables
#----------------------------------------
ENV=PROD12C
ORACLE_HOME=/u01/app/oracle/middleware
SCRIPT_PATH=/home/oracle/scripts/wlst
SERVERS=soadev1
PORT=7001
EMAILS="ahmed@revelationtech.com,ahmed.aboulnaga@revelationtech.com"
#----------------------------------------
# Set environment
#----------------------------------------
source ${ORACLE_HOME}/wlserver/server/bin/setWLSEnv.sh 2>&1 > /dev/null
#----------------------------------------
# Loop through server list
#----------------------------------------
for serv in ${SERVERS}
do
#----------------------------------------
# Run WLST script
#----------------------------------------
echo "********************************************************";
echo " Running Server status report for :${serv} ";
echo "********************************************************";
${ORACLE_HOME}/common/bin/wlst.sh ${SCRIPT_PATH}/monitor_all_servers.py ${serv} ${port}
echo ' ********** END OF REPORT **********