Modifying Custom Monitors Created Before Version 7.2
The 7.2 version of the Solace Geneos Agent introduced support for encrypted management passwords to access the event broker. Any custom monitors that were created with earlier versions of the Solace-provided UsersMonitor.java
example before Version 7.2 require code changes if an encrypted management password is to be used.
The required code changes are generic to all monitors based on the UsersMonitor.java
example.
Steps to Modify Custom Monitors
- Unpack the
sol-geneossample
file and copy all custom monitor java files into the appropriate places in thesrc/com/…
directory structure. - Modify the sections and methods, as described in Sections and Methods Requiring Modification below.
- After the indicated sections and methods are modified, you must recompile, redeploy, and restart the Solace Geneos Agent. Refer to Adding New Monitors.
Sections and Methods Requiring Modification
The following sections and methods of pre-version 7.2 monitors must be modified:
-
onPostInitialize() method
Find where the password is set to the clear text management password property value:
String password = props.getProperty(MGMT_ENCRYPTED_PASSWORD_PROPERTY_NAME);
Set the password instead to the encrypted management password property value, using the
getEncryptedProperty
method that accepts one argument (the encrypted management password property) or two arguments (the encrypted management password property, and the clear text management password property as the fall back password if the encrypted management password property value does not exist). Use one of the following snippets:String password = SolGeneosAgent.onlyInstance.getEncryptedProperty(MGMT_ENCRYPTED_PASSWORD_PROPERTY_NAME);
String password = SolGeneosAgent.onlyInstance.getEncryptedProperty(MGMT_ENCRYPTED_PASSWORD_PROPERTY_NAME,MGMT_PASSWORD_PROPERTY_NAME);