JBoss
  • 08 Sep 2023
  • 3 Minutes to read
  • Dark
    Light
  • PDF

JBoss

  • Dark
    Light
  • PDF

Article summary

About this Article
This article provides VSP application instrumentation steps for JBoss application server and provides the steps to determine the values of deployment dolder and start-up script path required during application configuration on CMS.


Variables %JBOSS_HOME% and $JBOSS_HOME used throughout this article refer to the root directory where WildFly Application Server is installed in Windows and Linux operating systems respectively. Some sample values are provided below:

  • %JBOSS_HOME% - D:\JBoss-EAP-7.2.0\
  • $JBOSS_HOME - /opt/JBoss-EAP-7.2.0/


Windows

Auto Instrumentation

This section describes the steps involved when Auto-Instrumentation method is opted for Probe installation

NOTE
In cluster or domain mode, all the processes in the cluster are instrumented if auto instrumentation is enabled


  1. Application Deployment Folder
    1. Log in to the Virtual Machine where JBoss is installed
    2. Utilize the below path as Application Deployment Folder
      %JBOSS_HOME%\standalone\deployments
    3. Example:  D:\JBoss-EAP-7.2.0\standalone\deployments
  2. Startup Script File Path 
    1. Provide the below path as Startup Script File Path
      %JBOSS_HOME%\bin\standalone.conf.bat OR
      %JBOSS_HOME%\bin\domain.conf.bat
    2. Example: D:\JBoss-EAP-7.2.0\bin\standalone.conf.bat


Manual Instrumentation

This section describes the steps involved when Auto-Instrumentation method is not possible. Follow either Method 1 or Method 2 described below

Method 1:

  1. Shut down JBoss Server (if it is running)
  2. Add the content below to file standalone.conf.bat in the directory %JBOSS_HOME%/bin. Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section
    @echo off
    ECHO.%JAVA_TOOL_OPTIONS%| FIND /I "instrumentation.jar">Nul || (
       set JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS% -javaagent:"%VSP_HOME_WEB_MEM%"\iae-java\instrumentation.jar -Dvirsec_appcontextpath=<AppCollectiveID>
    
  3. Save the modified file standalone.conf.bat
  4. Start the JBoss Server

Method 2:

This method can be used for VSP instrumentation in Domain Mode deployment

  1. Log in to Virtual Machine where JBoss is installed
  2. Stop the JBoss service if it is running
  3. Modify the file %JBOSS_HOME%\domain\configuration\host-slave.xml to include the following entries for the server to be instrumented. In the below example, arguments are configured for JVM “server-one
    Before Change:
    <servers>
        <server name="server-one" group="main-server-group"/>
        <server name="server-two" group="other-server-group">                
      <socket-bindings port-offset="150"/>
        </server>
    </servers>
    
    After change: Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section
    <servers>
        <server name="server-one" group="main-server-group"/>
            <jvm name="default"> 
               <jvm-options>
                  <option value="-javaagent:c:\PROGRA~2\Virsec\virsec-web-mem\iae-java\instrumentation.jar"/>
                  <option value="-Dvirsec_appcontextpath="/>
                  <option value="-DVSP_HOME_WEB_MEM=c:\PROGRA~2\Virsec\virsec-web-mem\"/>          
                jvm-options>
            jvm> 
          <server name="server-two" group="other-server-group">
             <socket-bindings port-offset="150"/>
          server>
    servers>
    
  4. Start the JBoss service
  5. Application Deployment Folder
    1. Log in to the Virtual Machine where JBoss is installed
    2. Utilize the below path as Application Deployment Folder
      %JBOSS_HOME%\domain
    3. Example: D:\JBoss-EAP-7.2.0\domain
  6. Startup Script File Path
    1. As the VSP-JVM arguments are configured manually, create a dummy file and provide the file path as Start Up Script File Path in the CMS


Linux

Auto Instrumentation

This section describes the steps involved when Auto-Instrumentation method is opted for Probe installation

NOTE
In cluster or domain mode, all the processes in the cluster are instrumented if auto instrumentation is enabled
  1. Application Deployment Folder
    1. Log in to the Virtual Machine where JBoss is installed
    2. Utilize the below path as Application Deployment Folder
      $JBOSS_HO,ME/standalone/deployments
    3. Example: /opt/JBoss-EAP-7.2.0/standalone/deployments
  2. Startup Script File Path 
    1. Provide the below path as Startup Script File Path
      $JBOSS_HOME/bin/standalone.conf OR $JBOSS_HOME/bin/domain.conf    
    2. Example: /opt/JBoss-EAP-7.2.0/bin/standalone.conf


Manual Instrumentation

This section describes the steps involved when Auto-Instrumentation method is not possible. Follow either Method 1 or Method 2 described below

 Method 1:

  1. Shut down JBoss Server (if it is running)
  2. Add the content below to file standalone.conf in the directory $JBOSS_HOME/bin. Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section
    Shell
    export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -javaagent:/opt/virsec-web-mem/iae-java/instrumentation.jar -DVSP_HOME_WEB_MEM=/opt/virsec-web-mem -Dvirsec_appcontextpath="
    
  3. Save the modified file standalone.conf
  4. Start the JBoss Server

Method 2:

This method can be used for VSP instrumentation in Domain Mode deployment

  1. Log in to Virtual Machine where JBoss is installed
  2. Stop the JBoss service if it is running
  3. Modify the file $JBOSS_HOME\domain\configuration\host-slave.xml to include the following entries for the server to be instrumented
    In this example, arguments are configured for JVM “server-one
    Before Change:
    <servers>
        <server name="server-one" group="main-server-group"/>
        <server name="server-two" group="other-server-group">                
      <socket-bindings port-offset="150"/>
        </server>
    </servers>
    
    After Change: Ensure that <AppCollectiveID> mentioned below is replaced with the App Collective ID in the CMS Application Configuration section
    <servers>
        <server name="server-one" group="main-server-group"/>
            <jvm name="default"> 
               <jvm-options>
                  <option value="-javaagent:/opt/virsec-web-mem/iae-java/instrumentation.jar"/>
                  <option value="-Dvirsec_appcontextpath=<AppCollectiveID>"/>
                  <option value="-DVSP_HOME_WEB_MEM=/opt/virsec-web-mem"/>
              </jvm-options>
            </jvm> 
          <server name="server-two" group="other-server-group">
             <socket-bindings port-offset="150"/>
          </server>
    </servers>
    
  4. Start the JBoss instance using the below command:
    $JBOSS_HOME/bin/standalone.sh
  5. Application Deployment Folder
    1. Log in to the Virtual Machine where JBoss is installed
    2. Utilize the below path as Application Deployment Folder
      $JBOSS_HOME/domain
    3. Example: /opt/JBoss-EAP-7.2.0/domain
  6. Startup Script File Path
    1. As the VSP-JVM arguments are configured manually, create a dummy file and provide the file path as Start Up Script File Path in the CMS

Was this article helpful?

What's Next