Yup. It work’s. Thanks.
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)