Skip to content

Monitor-JVM Installer

Monitor-JVM Installer in Configure HEAL Modules.

4 min read Updated SS MR

Monitor-JVM Installer#

Find the details of the monitor-jvm installer below:

1. Automated Installation via HealAgent: The Monitor-JVM module is automatically installed by the HealAgent installer.

2. If additional actions (install, uninstall, upgrade, downgrade) are required, follow the manual steps outlined below.

a. Prerequisites: Installation or uninstallation must be performed as the root user.

b. Directory Structure:

i. When installed via HealAgent, a new directory "utils" is created under the "Agents" directory, containing the "monitor-jvm" folder.

ii. For manual installation, create a "utils" folder in the "Agents" installed directory and place the "monitor-jvm .tar.gz" bundle here.

iii. Installation Command: Extract the files using the following command,

tar -xvzf monitor-jvm_linux_1.0.21.tar.gz

This creates the "monitor-jvm" folder, containing configuration files and logs.

Monitor-JVM Script Usage Instructions#

  1. To view the script usage, execute the following command:
./install_libhealagent_linux.sh

Expected Output:

05-02-2024:15:14:08: [INFO] Running as user:root
05-02-2024:15:14:08: [INFO] User has sufficient privileges to proceed.
05-02-2024:15:14:08: [INFO] PLATFORM: Linux. Script will proceed.
Usage: ./install_libhealagent_linux.sh [options]
Options:
agent_path=<agents_dir> for fresh installation
agent_path=<agents_dir> ip_address=192.168.x.x for fresh installation along with the ipaddress for jmx hostname
agent_path=<agents_dir> lib_version=/1.0.0/ to update to specified version of library
agent_path=<agents_dir> lib_version=1.0.0 ip_address=192.168.x.x to update to specified version of library along with ipaddress
-status to check current status of libhealagent library
-uninstall for uninstallation

2. Execute the below command to manually install monitor-jvm:

./install_libhealagent_linux.sh agent_path=<path-to-agents installed directory>

For Example:

./install_libhealagent_linux.sh agent_path=/opt/heal/AgentInstaller/Agent/

Expected Output:

05-02-2024:15:16:24: [INFO] Running as user: root
05-02-2024:15:16:24: [INFO] User has sufficient privileges to proceed.
05-02-2024:15:16:24: [INFO] PLATFORM : Linux. Script will proceed.
05-02-2024:15:16:24: [INFO] Finding OS architecture
05-02-2024:15:16:24: [INFO] OS is 64 Bit
05-02-2024:15:16:24: [INFO] ### Creating 64 Bit Library Link ###
05-02-2024:15:16:24: [INFO] /lib64/libhealagent.so symbolic link not found. Creating link as /lib64/libhealagent.so
05-02-2024:15:16:24: [INFO] Latest Version Library File: /opt/heal/AgentInstaller/Agent//utils/monitor-jvm/lib/64/libhealagent.so.1.0.20
05-02-2024:15:16:24: [INFO] /opt/heal/AgentInstaller/Agent//utils/monitor-jvm/lib/64/libhealagent.so.1.0.20 found.
Proceeding with library installation..
05-02-2024:15:16:24: [INFO] /lib64/libhealagent.so link created successfully.
05-02-2024:15:16:24: [INFO] /lib/libhealagent.so symbolic link not found. Creating link as /lib/libhealagent.so
05-02-2024:15:16:24: [INFO] Latest Version Library File: /opt/heal/AgentInstaller/Agent//utils/monitor-jvm/lib/32/libhealagent.so.1.0.20
Proceeding with library installation..
05-02-2024:15:16:24: [INFO] /lib/libhealagent.so link created successfully.
05-02-2024:15:16:24: [INFO] ### Creating config file Link ###
05-02-2024:15:16:24: [INFO] /etc/heal.conf symbolic link not found. Creating symbolic link...
05-02-2024:15:16:24: [INFO] Symbolic link created successfully.
05-02-2024:15:16:24: [INFO] ### Adding Library Entry in preload file ###
05-02-2024:15:16:24: [INFO] ld.so.preload file already exists.
05-02-2024:15:16:24: [INFO] Creating a backup of /etc/ld.so.preload...
05-02-2024:15:16:24: [INFO] Backup created successfully: /etc/ld.so.preload_healbackup_20240205151624
05-02-2024:15:16:24: [INFO] Adding /$LIB/libhealagent.so to /etc/ld.so.preload...
05-02-2024:15:16:24: [INFO] LDPRELOAD entry /$LIB/libhealagent.so added successfully.
05-02-2024:15:16:24: [INFO] ### Validating loader config ###
05-02-2024:15:16:24: [INFO] Library is found loaded in the loader. Loader configuration is proper. Proceeding..
05-02-2024:15:16:24: [INFO] ### Validating libhealagent Status ###
05-02-2024:15:16:24: [INFO] Fetching libhealagent Status...
05-02-2024:15:16:24: [INFO] Libhealagent Installation Status: Installed

3. Check the Installation Status of monitor-jvm by executing the below command:

./install_libhealagent_linux.sh -status

Expected Output:

05-02-2024:15:13:59: [INFO] Running as user: root
05-02-2024:15:13:59: [INFO] User has sufficient privileges to proceed.
05-02-2024:15:13:59: [INFO] PLATFORM: Linux. Script will proceed.
05-02-2024:15:13:59: [INFO] Finding OS architecture
05-02-2024:15:13:59: [INFO] OS is 64 Bit
05-02-2024:15:13:59: [INFO] Fetching libhealagent Status...
05-02-2024:15:13:59: [INFO] Libhealagent Installation Status: Installed
  1. Execute the following command to uninstall the monitor-jvm library:
./install_libhealagent_linux.sh -uninstall

Expected Output:

05-02-2024:15:15:04: [INFO] Running as user: root
05-02-2024:15:15:04: [INFO] User has sufficient privileges to proceed.
05-02-2024:15:15:04: [INFO] PLATFORM : Linux. Script will proceed.
05-02-2024:15:15:04: [INFO] Finding OS architecture
05-02-2024:15:15:04: [INFO] OS is 64 Bit
05-02-2024:15:15:04: [INFO] Performing uninstall...
05-02-2024:15:15:04: [INFO] Removed /$LIB/libhealagent.so entry from /etc/ld.so.preload.
05-02-2024:15:15:04: [INFO] Removed /lib64/libhealagent.so file symbolic link.
05-02-2024:15:15:04: [INFO] Removed /lib/libhealagent.so file symbolic link.
05-02-2024:15:15:04: [INFO] Removed symbolic link /etc/heal.conf.
05-02-2024:15:15:04: [INFO] /etc/ld.so.conf.d/healagent.conf file does not exist.. Ignoring and proceeding with uninstallation.
05-02-2024:15:15:04: [INFO] Uninstallation completed.
05-02-2024:15:15:04: [INFO] Fetching libhealagent Status...
05-02-2024:15:15:04: [INFO] Libhealagent Installation Status: Uninstalled

Monitor-JVM Configuration for Custom Java Process#

Follow the steps below to configure monitor-jvm:

  1. Configure monitor-jvm's heal.conf file to support JMX arguments for a custom Java process:

a. Add the pattern in the "whiteListRegexArgs" by using the below argument.

<server/component Name><pattern>

b. Add a key in the "serverInstance" configuration in heal.conf to match the process arguments

<server/component Name><key>

c. Here, the key should be unique and should match the process arguments; if it matches, it will try to add the JMX arguments.

d. Pick one of the JVM arguments with which we can identify a specific JVM uniquely.

2. Configure monitor-jvm's heal.conf to support JIM arguments for a custom Java process:

a. Add the pattern in the "whiteListRegexArgs" by using the below argument.

<server/component Name><pattern>

b. Add key in the serverInstance configuration in heal.conf to match the process arguments

<server/component Name><key>

c. Create an agent-cache.properties file for this new Java process in the JIMAgent/config/ directory.

For example:

  1. Consider a Java process: "SampleJava" for which JMX and JIM args will be added via the monitor-jvm library.
  2. The "sampleJava" process is started as follows:
java SampleJava sampleArg=uniqueValue arg2=value2

Here, "sampleArg" is the unique argument key and "uniqueValue" is the argument value.

3. Then configure the heal.conf file as below:

a. whiteListRegexArgs="testComponent=[sS][aA][mM][pP][lL][eE][jJ][aA][vV][aA]"

b. serverInstance="testComponent=sampleArg"

4. Create an agent-cache.properties file for this new Java process in the JIMAgent/config/ directory.

a. testComponent_uniqueValue_agent-cache.properties

5. Then restart the Java process. In this case, it is the SampleJava process. Then, in the ps output of SampleJava, we should be able to see the JMX & JIM args.