IBM WebSphere (JMX)

Version 4

    The SAM Java application Server (JMX) template allows you to monitor vital statistics from Java Virtual Machines (JVM). Before assigning the template to a node with a JVM you want to monitor, you must configure the target JVM to accept remote JMX queries.

    Note: To configure Websphere, see http://www.solarwinds.com/NetPerfMon/SolarWinds/wwhelp/wwhimpl/common/html/wwhelp.htm#context=SolarWinds&file=OrionAPMAGConfigureJMXWebLogic.htm

    The sections below discuss how to configure JVM servers for JMX monitoring IBM WebSphere. Configuration instructions are given for both Linux and Microsoft Windows operating systems.

    • Explaining Java arguments.
    • Configuring a Standalone Java Virtual Machine
    • Configuring IBM WebSphere (tested on version 8.0)


    Java Arguments

    For enabling remote JMX monitoring, the following Java arguments will be used:

    -Djava.rmi.server.hostname=192.168.0.236
    This line indicates the IP address the RMI server will use. Type your server IP address here.

    -Dcom.sun.management.jmxremote
    This line enables remote JMX monitoring.

    -Dcom.sun.management.jmxremote.port=8686
    This line indicates which port the JMX module will use to accept JMX connections.

    -Dcom.sun.management.jmxremote.ssl=false
    This line indicates whether or not SSL is used.

    -Dcom.sun.management.jmxremote.authenticate=true
    This line indicates whether or not authentication is used. Use of authentication is recommended. If you do not want to use authentication, you should change the value to
    false.

    -Dcom.sun.management.jmxremote.password.file=c:\jmxremote.password
    This line indicates where the passwords file is stored. Do not add this line if you are not using authentication.

    -Dcom.sun.management.jmxremote.access.file=c:\jmxremote.access
    This line indicates where the access file is stored. Do not add this line if you are not using authentication.

    More information can be found at the following website: http://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html.

    Configuring a Standalone Java Virtual Machine

    Windows:

    1.   Download the JDK from the Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html (tested on JDK 1.7.0, update version 3).

    2.   Install the JDK.

    3.   On the license agreement page, read and accept the license and then click Next.

    4.   Click Change to change the installation directory to C:\Program Files\Java\jdk1.7.0_3, and then click OK.

    5.   Click Next.

    6.   Click Finish to exit from the installer.

    7.   Add a variable to the system with its path pointing to the JDK installation folder.


    For example:

    Variable name: JAVA_HOME
    Variable value:  C:\Program Files\Java\jdk1.7.0_3

    Note: If you want to run Java commands from the command line, you should add the JDK installation path to the PATH variable.

          If you plan to use JMX authentication, follow steps 8-12.

    8.   Navigate to the %JAVA_HOME%\jre\lib\management folder.

    9.   Rename the jmxremote.password.template file to jmxremote.password. Edit jmxremote.password by replacing/adding its content with the following:

    samuser somepasswd

    Where samuser is the user for the JVM monitored from SAM and somepasswd – is the password.

     

    10 Edit jmxremote.access by replacing/adding its content with the following:

     

    samuser readonly

     

    Where samuser is user for the JVM monitored and readonly – gives this read only permissions.

    11 Copy jmxremote.access and jmxremote.password to a folder, for example c:\jmxremote\.

    12 Grant access to the jmxremote.password file only for the Administrator. To grant access only for the Administrator, refer to this topic at the following location: http://download.oracle.com/javase/6/docs/technotes/guides/management/security-windows.html

     

    Linux:

    1.   Download the JDK from the Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html (tested on JDK SE 6, update version 24).

    2.   Unpack and run the JDK. In this case, the JDK was installed into the /usr/java/jdk1.7.0_3 folder.

    3.   Move this folder to /usr/local.

    4.   In the /usr/local/ directory, create a symbolic link to jdk1.7.0_3 named Java. Now the JDK is installed in /usr/local/jdk1.7.0_3 and linked to /usr/local/java.

    5.   Add the /usr/local/java/bin folder to the system path. (If it is only for your account, add it in .bash_profile file in your home directory). In Slackware, it should be in the .profile file. To make it a system wide environment, add it in the /etc/profile.

    6.   Edit a line in .bash_profile to be similar to: PATH=$PATH:$HOME/bin:/usr/local/java/bin. The path will be automatically set at boot time. To set the path immediately, use the command:

    $ export PATH=$PATH:/usr/local/java/bin
     

    7.   Add a variable to the system with the path pointing to the JDK installation folder.

    8.   Add the following lines to the /etc/profile file. Syntax dependencies may be different in various Linux distributions. This example is shown for the CentOS system:

    export JAVA_HOME=/usr/java/jdk1.7.0_3

    export PATH=$PATH:/usr/java/jdk1.7.0_3
     

    To set this immediately, run the export commands in your shel, or, logout then log back in to your system.

    If you use JMX authentication follow the steps 9-13.

    9.   Go to the $JAVA_HOME/jre/lib/management folder and rename the jmxremote.password.template file to jmxremote.password.

    10 Edit jmxremote.password by replacing/adding its content with the following:

    samuser somepasswd

    Where samuser is the user for the JVM monitored from SAM and somepasswd – is the password.

    11. Edit jmxremote.access by replacing/adding its content with the following:

    samuser readonly

    Where samuser is user for the JVM monitored and readonly – gives this read only permissions.


    12
    Copy jmxremote.access and jmxremote.password to a folder, for example /jmxremote/.

    13 Grant access to the jmxremote.password file only for the root user. Run the following commands as the root user in your shell:

    # chown root.root $JAVA_HOME/jre/lib/management/jmxremote.password
    # chmod 600 $JAVA_HOME/jre/lib/management/
    jmxremote.password

     

    Testing a Standalone JVM

    You can test that your JVM can respond to JMX queries by adding the following to the java command line. This will enable JMX on port 8686 using authentication:

    -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8686 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file="c:\jmxremote\jmxremote.password" -Dcom.sun.management.jmxremote.access.file="c:\jmxremote\jmxremote.access"

     

    For example:

    java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8686 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file="c:\jmxremote\jmxremote.password" -Dcom.sun.management.jmxremote.access.file="c:\jmxremote\jmxremote.access" some_java_applet

    In a separate window/shell, run the following command to test JMX and the JDK configurations:

    %JAVA_HOME%\jdk1.7.0_3\bin\jconsole

    In the jconsole window, select Remote Process, type 127.0.0.1:8686 and provide Username sam and Password somepasswd.

    After a successful connection, you will be able to see different monitoring statistics.

     

    Configuring IBM WebSphere (tested on version 8.0)

    1.   Run the IBM WebSphere Application Server.

    2.   Open a web browser and then navigate to: https://hostname:9043 where hostname is the name of the IBM WebSphere server.

    3.   In the left panel, click Expand Servers and Server types.

    4.   Click WebSphere Application Servers.

    5.   In the main window, click your server.

    6.   In the Server Infrastructure section, expand Java and Process Management.

    7.   Click Process Definition.

    8.   In the Additional Properties section, click Java Virtual Machine.

    9.   In Generic JVM Arguments, add the following (Warning: This will enable JMX without authentication):

    -Djavax.management.builder.initial= -Djava.rmi.server.hostname=192.168.0.236 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8686 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false


    10. 
    Click OK.

    11 Click, Save and then click OK.

    12 Click Save.

    13. Restart the IBM WebSphere Application Server.

     

    If you have errors after these configuration changes, you can manually change/restore the configuration. These changes are stored in the following file:

    %WEBSPHERE_HOME%\profiles\your_profile\config\cells\your_cell\nodes\your_node\servers\your_server\server.xml

    IBM WebSphere (JMX)

    This template monitors IBM WebSphere server statistics by using the JMX protocol.

    Prerequisites: Target server configured to allow JMX queries.


    Note
    : This template is configured to send JMX requests on port 8686.


    Credentials:
    Dependent on the JMX configuration.


    Monitored Components

    Note: All components may vary from a running environment. You can add your own threshold limits as necessary. For more information, see http://knowledgebase.solarwinds.com/kb/questions/2415.


    Classes Loaded Count

    This monitor returns the number of classes that are currently loaded in the Java virtual machine.


    Classes Total Loaded Count

    This monitor returns the total number of classes that have been loaded since the Java virtual machine has started execution.


    Classes Unloaded Count

    This monitor returns the total number of classes unloaded since the Java virtual machine has started execution.


    Memory Pending Final Count

    This monitor returns the approximate number of objects for which finalization is pending.


    Memory Heap Init Size (B)

    This monitor returns the initial amount of memory in bytes that the Java virtual machine allocates; or -1 if undefined.


    Memory Heap Used (B)

    This monitor returns the amount of used memory in bytes. The amount of used memory in the returned memory usage is the amount of memory occupied by both live objects and garbage objects that have not been collected, if any.


    Memory Heap Committed (B)

    This monitor returns the amount of committed memory in bytes.


    Memory Heap Max Size (B)

    This monitor returns the maximum amount of memory in bytes that can be used; or -1 if undefined.


    Memory Non Heap Init Size (B)

    This monitor returns the initial amount of memory in bytes that the Java virtual machine allocates; or -1 if undefined.


    Memory Non Heap Used (B)

    This monitor returns the amount of used memory in bytes.


    Memory Non Heap Committed (B)

    This monitor returns the amount of committed memory in bytes.


    Memory Non Heap Max Size (B)

    This monitor returns the maximum amount of memory in bytes that can be used; or -1 if undefined.


    Memory Garbage Collections Count
    This monitor returns the total number of collections that have occurred.


    Memory Garbage Collection Time (ms)

    This monitor returns the approximate accumulated collection elapsed time in milliseconds.


    Threads Total Started Count

    This monitor returns the total number of threads created and also started since the Java virtual machine started.


    Current Thread Count

    This monitor returns the current number of live threads including both daemon and non-daemon threads.


    Current Thread CPU Time

    This monitor returns the total CPU time for the current thread in nanoseconds.


    Current Thread User Time

    This monitor returns the CPU time that the current thread has executed in user mode in nanoseconds.


    Runtime Uptime (ms)

    This monitor returns the uptime of the Java virtual machine in milliseconds.


    Compiler Time (ms)

    This monitor returns the approximate accumulated elapsed time (in milliseconds) spent in compilation.

     

    Portions of this document were originally created by and are excerpted from the following sources:
    Oracle Corporation, Copyright © 2012 Oracle Corporation. 
    All rights reserved. Available at
    http://docs.oracle.com/javase/1.5.0/docs/guide/management/overview.html.