Automate Maximo EAR Deploy

November 16, 2022

Introduction

Maximo Application Suite (MAS) is coming and will make all of what we are about to talk about irrelevant. Even so, doing away with the hassle of manually deploying EAR files and waiting for what seems forever for the process to complete has been a personal desire for as long as I can remember and one that I never quite got around to. Until now, at the 11th hour in the twilight of Maximo 7.6, when I finally sat down and wrote the scripts to do just that. In this post we are going to discuss how to automate deploying the Maximo EAR, step by step with the scripts provided for download. So as the long process of the sun setting on WebSphere traditional continues, for those of you still not on MAS, this post will make your remaining days with WebSphere just a little more pleasant.

Before getting started, I want to highlight an IBM tech note I came across a few months back that drastically reduces the time to deploy the EAR, even if you are doing it manually. By precompiling the EJB classes you can reduce the EAR deployment by several minutes. https://www.ibm.com/support/pages/reducing-maximoear-deployment-time-using-ejbdeploy

ConfigTool

We are going to use the wasclient provided in the Maximo SMP ConfigTool directory to communicate with WebSphere, but first there are a few configuration steps we need to complete. The steps are almost identical for Windows and Linux, but to avoid possible confusion we have provided the configuration steps separately for Windows and Linux.

Windows

For the following steps we are going to use D:\IBM\SMP as the example SMP home folder and D:\IBM\WebSphere for the WebSphere installation folder, this is a very common configuration, but this is provided as an example and should be modified to match your environment.

  1. Copy the D:\IBM\SMP\ConfigTool\wasclient\Thisnwsadmin.orig.bat to D:\IBM\SMP\ConfigTool\wasclient\Thisnwsadmin.bat.
  2. Open the D:\IBM\SMP\ConfigTool\wasclient\Thisnwsadmin.bat in a text editor such as Notepad, Notepad++ or VS Code.
  3. Locate the line set WAS_HOME=$WASHOME$ and change it to set set WAS_HOME=D:\IBM\SMP\ConfigTool\wasclient.
  4. Locate the line set JAVA_HOME=$JAVAHOME$ and change it to set set JAVA_HOME=D:\IBM\SMP\ConfigTool\jre.
  5. From the WebSphere Deployment Manager profile directory, which is found under the D:\IBM\WebSphere\AppServer\profiles folder and is a folder typically named ctgDmgr01, as in our example, or similar. Copy the D:\IBM\WebSphere\AppServer\profiles\ctgDmgr01\etc\trust.p12 and D:\IBM\WebSphere\AppServer\profiles\ctgDmgr01\etc\key.p12 files to the D:\IBM\SMP\ConfigTool\wasclient\etc folder.
  6. Open the D:\IBM\SMP\ConfigTool\wasclient\properties\ssl.client.props file in a text editor.
    • Locate the com.ibm.ssl.keyStore property and set its value to D:\IBM\SMP\ConfigTool\wasclient\etc\key.p12.
    • Locate the com.ibm.ssl.trustStore property and set its value to D:\IBM\SMP\ConfigTool\wasclient\etc\trust.p12.
    • Save the ssl.client.props file and close the text editor.
  7. Download the wsadminlib.py script from the IBM GitHub repository found here https://github.com/wsadminlib/wsadminlib/blob/master/bin/wsadminlib.py.
  8. Copy the wsadminlib.py script to the D:\IBM\SMP\ConfigTool\scripts folder.
  9. Download the deploy-application.py script from here.
  10. Copy the deploy-application.py script to the D:\IBM\SMP\Config\scripts folder.
    • Open the D:\IBM\SMP\Config\scripts\deploy-application.py file in a text editor.
    • Locate the line execfile('SCRIPTS_HOME/wsadminlib.py') and update it to execfile('D:\IBM\SMP\Config\scripts\wsadminlib.py').
    • Save the deploy-application.py file and close the text editor.

Linux

For the following steps we are going to use /opt/IBM/SMP as the example SMP home directory and /opt/IBM/WebSphere for the WebSphere installation directory, this is a very common configuration, but this is provided as an example and should be modified to match your environment.

  1. Copy the /opt/IBM/SMP/ConfigTool/wasclient/Thisnwsadmin.orig.sh to /opt/IBM/SMP/ConfigTool/wasclient/Thisnwsadmin.sh.
  2. Open the /opt/IBM/SMP/ConfigTool/wasclient/Thisnwsadmin.sh in a text editor such as nano, vim or vi.
  3. Locate the line export WAS_HOME=$WASHOME$ and change it to set export WAS_HOME=/opt/IBM/SMP/ConfigTool/wasclient.
  4. Locate the line export JAVA_HOME=$JAVAHOME$ and change it to set export JAVA_HOME=/opt/IBM/SMP/ConfigTool/jre.
  5. From the WebSphere Deployment Manager profile directory, which is found under the /opt/IBM/WebSphere/AppServer/profiles directory and is a directory typically named ctgDmgr01, as in our example, or similar. Copy the /opt/IBM/WebSphere/AppServer/profiles/ctgDmgr01/etc/trust.p12 and /opt/IBM/WebSphere/AppServer/profiles/ctgDmgr01/etc/key.p12 files to the /opt/IBM/SMP/ConfigTool/wasclient/etc directory.
  6. Open the /opt/IBM/SMP/ConfigTool/wasclient/properties/ssl.client.props file in a text editor.
    • Locate the com.ibm.ssl.keyStore property and set its value to /opt/IBM/SMP/ConfigTool/wasclient/etc/key.p12.
    • Locate the com.ibm.ssl.trustStore property and set its value to /opt/IBM/SMP/ConfigTool/wasclient/etc/trust.p12.
    • Save the ssl.client.props file and close the text editor.
  7. Download the wsadminlib.py script from the IBM GitHub repository found here https://github.com/wsadminlib/wsadminlib/blob/master/bin/wsadminlib.py.
  8. Copy the wsadminlib.py script to the /opt/IBM/SMP/ConfigTool/scripts directory.
  9. Download the deploy-application.py script from here.
  10. Copy the deploy-application.py script to the /opt/IBM/SMP/Config/scripts directory.
    • Open the /opt/IBM/SMP/Config/scripts/deploy-application.py file in a text editor.
    • Locate the line execfile('SCRIPTS_HOME/wsadminlib.py') and update it to execfile('/opt/IBM/SMP/ConfigTool/scripts/wsadminlib.py').
    • Save the deploy-application.py file and close the text editor.

Deploy Scripts

PowerShell Script (Windows)

For Windows, download the deploy-application.ps1 script from here, then copy it to the D:\IBM\SMP\ConfigTool folder.

To use the script open a Windows PowerShell session and navigate to the D:\IBM\SMP\ConfigTool folder. Run the deploy-application.ps1 script providing the necessary arguments as shown in the example below. Note that a password was not provided as an argument and will be securely prompted for by the script after validating the provided arguments.

D:\IBM\SMP\ConfigTool\deploy-application.ps1 -AppName MAXIMO -CellName ctgNode01 -ServerName MXServer -WebServerName webserver1 -NodeName ctgNode01 -UserName wasadmin -VirtualHost maximo_host -EARFile D:\IBM\SMP\maximo\deployment\default\maximo.ear

Arguments

A full table of the available arguments is provided below. The script supports both stand alone servers and clusters, but only supports mapping the application to a single web server.

ArgumentDescription
-AppNameThe name of the application to deploy, such as MAXIMO.
-CellNameThe WebSphere cell name, for example ctgCell01.
-ClusterNameThe name of the cluster to deploy the application to, for example MXUICluster.
-EARFileThe path to the Maximo EAR file to deploy, for example D:\IBM\SMP\maximo\deployment\default\maximo.ear.
-HostNameThe name of the WebSphere deployment manager host.
-NodeNameThe WebSphere Node name that hosts the web server, for example ctgNode01.
-PasswordThe WebSphere user password.
-ServerNameThe application server name to deploy the application to, for non-clustered environments, for example MXServer.
-UserNameThe WebSphere username.
-VirtualHostThe name of the virtual host to deploy the application to, for example maximo_host.
-WebServerNameThe name of the web server to bind the application to, for example webserver1
-HelpPrints a help message with the available parameters.

Bash Script (Linux)

For Linux, download the deploy-application.sh script from here, then copy it to the /opt/IBM/SMP/ConfigTool directory.

In case the deploy-application.sh script is not executable run the following command to ensure it has the proper bit flags are set.

chmod ugo+x /opt/IBM/SMP/ConfigTool/deploy-application.sh

To use the script open a Bash shell session and navigate to the /opt/IBM/SMP/ConfigTool directory. Run the deploy-application.sh script providing the necessary parameters as shown in the example below. Note that a password was not provided as an argument and will be securely prompted for by the script after validating the provided arguments.

/opt/IBM/SMP/ConfigTool/deploy-application.sh -a MAXIMO -c ctgNode01 -s MXServer -w webserver1 -n ctgNode01 -u wasadmin -v maximo_host -e /opt/IBM/SMP/maximo/deployment/default/maximo.ear

Arguments

A full table of the available arguments is provided below. The script supports both stand alone servers and clusters, but only supports mapping the application to a single web server.

ParameterDescription
-a | --appnameThe name of the application to deploy, such as MAXIMO.
-c | --cellnameThe WebSphere cell name, for example ctgCell01.
--clusternameThe name of the cluster to deploy the application to, for example MXUICluster.
-e | --earfileThe path to the Maximo EAR file to deploy, for example /opt/IBM/SMP/maximo/deployment/default/maximo.ear.
-h | --hostnameThe name of the WebSphere deployment manager host.
-n | --nodenameThe WebSphere Node name that hosts the web server, for example ctgNode01.
-p | --passwordThe WebSphere user password.
-s | --servernameThe application server name to deploy the application to, for non-clustered environments, for example MXServer.
-u | --usernameThe WebSphere username.
-v | --virtualhostThe name of the virtual host to deploy the application to, for example maximo_host.
-w | --webservernameThe name of the web server to bind the application to, for example webserver1.
--helpPrints a help message with the available parameters.

Conclusion

In this post we reviewed how to use the Maximo ConfigTool's wasclient to automate deploying the Maximo EAR file. This comes a little late since Maximo 7.6 is coming to its end of life. However, even being spared the unpleasantness of manually deploying the EAR file for the few remaining years is worthwhile and worth posting about. We hope this makes your life just a little brighter and a little easier.

If you have any questions or comments please reach out to us at [email protected]

In the time it took you to read this blog post...

You could have deployed Opqo, our game-changing mobile solution for Maximo.

Opqo is simple to acquire, simple to deploy and simple to use, with clear transparent monthly pricing that is flexible to your usage.