Jython wsadmin: get server host name

In Jython WebSphere Wsadmin:

It looks like I can get the server names from nodeName, however I was not able to find a direct way to find the server nodeName.

I was thinking of creating a map of all nodes, but it's expensive.

Can anyone help?

+4
source share
2 answers

You can get the name of the server node using Server MBean.

Information on the MBean server can be found here http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.ejbfep.multiplatform.doc%2Finfo%2Fae%2Fae% 2Fcjmx_overview.html

objNameString = AdminControl.completeObjectName('WebSphere:type=Server,*') print AdminControl.getAttribute(objNameString, 'nodeName') 
+7
source

You can also get the name node using the getNode() method on AdminControl :

 wsadmin>objn = AdminControl.completeObjectName('WebSphere:type=Server,*') wsadmin>print AdminControl.getAttribute(objn, 'nodeName') Node01 wsadmin>print AdminControl.getNode() Node01 

References

+2
source

All Articles