Getting “No Response Captured” when configuring SQL script in Dev-Op Mbeans
-
Hi Team,
I am using below script to configure in Dev-Op Mbeans but getting “No Response Captured”
Whereas same script is running fine on Solaris box._dbStatus=0 status=`/usr/sbin/ping $servername` if [ "$status" == "$servername is alive" ]; then _dbStatus=1 echo SERVER_STATUS_RUNNING=$_dbStatus else _dbStatus=0 echo SERVER_STATUS_RUNNING=$_dbStatus fi;
Please can you guide me what I am doing incorrect.
-
Hi,
This script is endless; you should echo a result for capturing a variable in WLSDM.
You should use the ping command like i.e. “ping $servername –c 1” then extract output from the ping command.
We are recommending you to use the script which is available in WLSDM README for pinging database. Please follow the readme link here: http://www.wlsdm.com/docs/README#VI.ConsoleUsage&DevOpsMBean
Also we are pasting below.
Step-1 Write Shell Script: Ping database and calculate database response time using WebLogic API (weblogic.jar)
#Variables _dbStatus=0 #0:DB_DOWN,1:DB_UP #start DB Ping _startTime=$(($(date +%s%N)/1000000)) _pingResult=`java -cp weblogic.jar utils.dbping ORACLE_THIN $YOUR_USER_NAME $YOUR_PASSWORD $YOUR_IP:$YOUR_PORT/$YOUR_SERVICE_NAME` _endTime=$(($(date +%s%N)/1000000)) _dbResponseTime=`expr $_endTime - $_startTime` if [[ "$_pingResult" == *"Success!!!"* ]]; then _dbStatus=1 #echo "Database connection SUCCESS!!!" #DB_UP echo DatabaseStatus=$_dbStatus else _dbStatus=0 #echo "Database connection FAILURE!!!" #DB_DOWN echo DatabaseStatus=$_dbStatus fi echo DatabaseResponseTime=$_dbResponseTime```