Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check the status of weblogic dynamically thru C/Script.

Status
Not open for further replies.

infiniti

IS-IT--Management
Mar 7, 2002
1
US
Hi,
I want to know if I can check the status of weblogic(whether its running or down) dynamically thru a C program or some script. And once I have found that that the server is down, can I restart it dynamically from the same program.
Thanks,
Amber
 
You can use JMX to dynamically check the status and if you have a NodeManager running you can remotely reboot.
 
You could try something like this (I presume you're using unix)
#!/bin/sh
ps -ef | grep -v "grep weblogic.Server"|grep weblogic.Server
if [ $? -ne 0 ]
then
./startWebLogic.sh
fi
The ps should return false if it can't find a process containing "weblogic.Server".
This script should be put in your weblogic root installation dir. It obviously will be thrown off if your system has more than one process open that contains the string 'weblogic.Server', but I'm not sure why that would happen (unless you are running multiple instances on the same machine)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top