Get the STATE of the weblogic instances via shell script.

Can I get the STATE(instance are RUNNING or not and HEALTH is OK or not) of the weblogic instances(Admin and Managed) running on my unix machine via shell script.
Someone told me that it can be done via "weblogic.Admin GETSTATE"....but it is not working for me(might be I am doing something wrong)
Searched the threads but not found any thread related to it.Can someone please help....

What I tried is:
/local/bea/wls92/jdk/bin/java -classpath /home/user/LIB/weblogic.jar weblogic.Admin -url t3://server:port -username user -password pass GETSTATE

but it is showing me the error as:
Failed to connect to t3://server(I entered server name here):port(I entered port here): Destination unreachable; nested exception is:
java.io.IOException: Empty server reply; No available router to destination

but when I am doing ping the server shows me as alive and I am able to open the console via the mentioned server and port....

PLEASE HELP!!!!!!!!!!Thanks in advance...

Check this link , might be you will get a clue from there.

weblogic.Admin Command-Line Reference

I am doing the same thing but no luck...If anyone did the same thing please give me any example.......