Tuesday, April 3, 2012

Interacting with Nodemanager

Nodemanager is a network daemon, which you can connect to and interact with. The basic functionality can be tested using a connection to Node Manager, using telnet, or in the case of SSL, ssh.

Commands which can be issued to Node Manager includes the starting, stopping and querying the state of servers.

Example:
telnet nodemanagerhost port

domain soa_domain    <- Set the current working domain, as specified in the nodemanager file
+OK Current domain set to 'soa_domain'
server AdminServer   <- Set the current working server AdminServer
+OK Current server is now 'AdminServer'
start AdminServer      <- Issue a start command to AdminServer
+OK Server 'AdminServer' started
getStates                        <- Get status of the servers
+OK AdminServer=RUNNING soa_server1=RUNNING AdminServerTag=UNKNOWN domain_bak=UNKNOWN

Other commands include: kill (server), getLog (last command issues, kill, start), execscript (server migration script)

Complete list of commands:
VERSION

DOMAIN
SERVER
COHERENCESERVER
USER
PASS
STAT
QUIT
START
STARTP
KILL
GETLOG
GETNMLOG
HELLO
CHGCRED
GETSTATES
EXECSCRIPT

1 comment:

Anonymous said...

While installing Weblogic I pointed netcat at port 5556 and was interested that I could just type at it so I googled the topic and found this page (in fact the only page!) - and knocked up this little script. Couldn't add <code> tags tho' :-(

cheers
morkk


#!/bin/sh

#############################################
DOMAIN=base_domain
ADM=AdminServer
IBR=IBR_server1
UCM=UCM_server1
USR=weblogic
PWD=password1
HOST=localhost
PORT=5556
#############################################

USAGE="usage: ${0##*/} start|stop|restart|status all|admin|ibr|ucm ..."

if [ $# -lt 2 ] ; then
echo $USAGE
exit 1
fi

manage() {
cat <<-EOF | nc $HOST $PORT | grep -v 'Invalid command'
domain $DOMAIN
user $USR
pass $PWD
server $1
$2
$3
EOF
}

case $1 in
star*) ACTION=start ;;
sto*) ACTION=kill ;;
ki*) ACTION=kill ;;
re*) ACTION="kill start" ;;
stat*) ACTION=stat ;;
*) echo "$USAGE" ; exit 1 ;;
esac
shift

for S ; do
case $S in
all) for I in $ADM $IBR $UCM ; do manage $I $ACTION ; done ;;
admin) manage $ADM $ACTION ;;
ibr) manage $IBR $ACTION ;;
ucm) manage $UCM $ACTION ;;
*) echo "$USAGE" ; exit 1 ;;
esac
done

exit 0