Tags
Monitoring Weblogic Server, ServerRuntime -property State, Weblogic Server State, Weblogic ServerRuntime, Weblogic Shell Script Monitoring
set -x
export CLASSPATH="/......../server/lib/weblogic.jar"
#IPs
IP=XXX.XXX.XXX.XXX
#Define Port Numbers.
taranabilir.
declare -a Port=( 9001 9004 9006 9007 9008 9009 )
declare -a ServerState=[]
declare -a HealthState=[]
declare -a ObjectName=[]
declare -a OpenSocketsCurrentCount=[]
i=0
#Counter
while [ $i -lt 6 ]
do
ServerState[$i]=/usr/bin/java weblogic.Admin -url $IP:${Port[$i]} -username weblogic -password xxxxxxx
1 GET -pretty -type ServerRuntime -property State |grep -i State |awk '{print $2}'| rev | cut -c 1- | r
ev
SS=/usr/bin/java weblogic.Admin -url $IP:${Port[$i]} -username weblogic -password xxxxxxx GET -pretty
-type ServerRuntime -property State |grep -i State |awk '{print $2}'| rev | cut -c 1- | rev
HealthState[$i]=/usr/bin/java weblogic.Admin -url $IP:${Port[$i]} -username weblogic -password xxxxxxx
1 GET -pretty -type ServerRuntime -property HealthState |grep -i State |awk '{print $2}'|cut -f2 -d","|
rev | cut -c 1- | rev
HS=/usr/bin/java weblogic.Admin -url $IP:${Port[$i]} -username weblogic -password xxxxxxx GET -pretty
-type ServerRuntime -property HealthState |grep -i State |awk '{print $2}'|cut -f2 -d","| rev | cut -c
1- | rev
ObjectName[$i]=/usr/bin/java weblogic.Admin -url $IP:${Port[$i]} -username weblogic -password xxxxxxx
GET -pretty -type ServerRuntime -property JVMRuntime |grep -i JVMRuntime |awk '{print $2}'| rev | cut
-c 1- | rev
ON=/usr/bin/java weblogic.Admin -url $IP:${Port[$i]} -username weblogic -password xxxxxxx GET -pretty
-type ServerRuntime -property JVMRuntime |grep -i JVMRuntime |awk '{print $2}'| rev | cut -c 1- | rev
if [ “${ServerState[$i]}” != “RUNNING” ] ;
then
mailx -s ” Weblogic Server Status – $IP – HOSTNAME ” mail@mail.com <<EOF
Weblogic Server on Port ${Port[$i]} is not in RUNNING STATE.
$SS
$HS
$ON
EOF
fi
i=$((i+1))
done