Auguestine Auguestine - 4 years ago 150
Bash Question

How to get websphere application server installation directory using shell script

I have a WebSphere Application server (WAS) installed in the path

/opt/IBM/WebSphere
. It is possible to get the installed path using wsadmin? I need to get that installed directory path using shell script.

Answer Source

If you're in a profile directory (or always know where one is,) you could check variables.xml, which exists at /config/cells/(your_cell_name_here)/nodes/(node_name_here)/variables.xml for the value of WAS_INSTALL_ROOT. For example (not necessarily the cleanest):

INSTALLROOT=$(grep "symbolicName=\"WAS_INSTALL_ROOT\"" variables.xml | grep -o "value=\"[^\"]*" | cut -b8-)

There is also an installation registry, which is /opt/.ibm/.nif/.nifregistry for WAS before 8.0 and /opt/.ibm/.was.installlocations.registry for 8.0 and above, however these are created and edited by the installation wizard so they may not be 100% accurate to what's installed on the system. This developerWorks answer explains a little more about those files.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download