SSH-based monitoring fails due to incompatible Java versions

Troubleshooting monitoring issues caused by incompatible Java versions.

Related Topics

Problem

SSH-based monitors in Hardware Sentry KM, Monitoring Studio KM, or Monitoring Studio X may no longer work, either on a new installation, or after upgrading from an earlier version of the KM.

This is due to the KM’s included SSH client requiring an updated version of the Java Runtime Environment.

Identifying the issue

Errors such as this may be seen in the Collection Hub logs:

-----+ swSSHSendCommand(): ERROR (ERROR) while performing SSH query to 198.51.100.25: executionTime=0.033, exitStatus=:
     | Cannot connect to 198.51.100.25: There was a problem while connecting to 198.51.100.25:22

These may be seen by Enabling Debug Logging, then checking the Collection Hub logs in the %PATROL_HOME%\log or $PATROL_HOME/log folder for error messages like those shown above.

The SSH client can be tested via command line, by executing one of the following commands on the PATROL Agent with the appropriate hostname, username, and password or keyfile specified:

/opt/bmc/Patrol3/jre64/bin/java -jar $PATROL_HOME/../bin/MS_HW_matsya-module-sshclient.jar -hostname:198.51.100.25 -username:user "echo Hello"  

OR

  /opt/bmc/Patrol3/jre64/bin/java -jar $PATROL_HOME/../bin/MS_HW_matsya-module-sshclient.jar -hostname:198.51.100.25 -username:user -keyfile:/home/patrol/.ssh/id_rsa

If an incompatible version of Java is in use, the response to these queries will be similar to this:
MS_HW_matsya-module-sshclient.jar: Error: Failed to connect to 198.51.100.25 (Exception IOException: There was a problem while connecting to 198.51.100.25:22)

Resolution

Install Java Runtime Environment (JRE) 1.8.0_241 or higher. This can be deployed through Truesight as part of a deployable package. See BMC’s documentation on Using OpenJDK with KM Repository.