码迷,mamicode.com
首页 > Web开发 > 详细

weblogic监控

时间:2018-10-23 18:17:46      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:user   server   rest   eal   wc -l   admin   blog   tty   running   

#!/bin/sh
URL="156.12.19.56:8001" #节点的ip:port
USER_NAME="weblogic" #weblogic控制台账户
PASS_WORD="Sxds121954#" #weblogic控制台密码
DOMAIN_NAME="sssl_domain" #域名字
SERVER_NAME="sssSvr5601" #节点名字
STATE_ALL=$(/usr/java/jdk1.6.0_45/bin/java -cp /weblogic/wlserver_10.3/server/lib/weblogic.jar weblogic.Admin -url $URL -username $USER_NAME -password $PASS_WORD get -pretty -mbean "$DOMAIN_NAME:Location=$SERVER_NAME,Name=$SERVER_NAME,Type=ServerRuntime")
CURRENT_TIME=date +%F" "%H:%M:%S
NUM1=echo "$STATE_ALL" | grep "State:HEALTH_OK"|wc -l
if [ $NUM1 -eq 2 ]; then
echo " $CURRENT_TIME $URL $DOMAIN_NAME $SERVER_NAME running status is OK" >>/weblogic/user_projects/domains/sssldomain/logs/AutoRestart5601date +%Y%m%d.log
else
echo "$CURRENT_TIME $URL $DOMAIN_NAME $SERVER_NAME running status is not OK" >>/weblogic/user_projects/domains/sssldomain/logs/AutoRestart5601date +%Y%m%d.log
/weblogic/user_projects/domains/sssl_domain/restartssl5601.sh
echo "$CURRENT_TIME $URL $DOMAIN_NAME $SERVER_NAME restart succese!" >>/weblogic/user_projects/domains/sssldomain/logs/AutoRestart5601date +%Y%m%d.log
fi

weblogic监控

标签:user   server   rest   eal   wc -l   admin   blog   tty   running   

原文地址:http://blog.51cto.com/12250761/2307683

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!