In TADDM version 7.3, two versions of Jython are available. The current Jython 2.1 is
deprecated but still used by default. You can migrate to a new Jython 2.5.3.
Currently, scripts and script-based sensors use Jython 2.1
by default, although it is deprecated. To migrate to Jython 2.5.3,
complete the following steps.
- To modify the script, change the following interpreters:
#!/usr/bin/env ./jython_coll
to #!/usr/bin/env
./jython_coll_253
jython_wrap
to jython_wrap_253
cjython
to cjython_253
- To modify the script-based sensors, change the command
SCRIPT:<script.jy/py> to
SCRIPT[com.ibm.cdb.core.jython253_2.5.3]:<script.jy/py>.
Important: Do not use different versions of Jython in one template
sensor. All SCRIPT commands must have the same
bundle, either the default one, or 2.5.3.
To configure a
sensor script to use Jython 2.5.3, add the following code at its header:
import sys
import java
from java.lang import System
coll_home = System.getProperty("com.collation.home")
jython_home = coll_home + "/osgi/plugins/com.ibm.cdb.core.[jython_1.0.0|jython253_2.5.3]/lib/"
sys.path.append(jython_home + "/Lib")
sys.prefix = jython_home + "/Lib"
- To modify the script that is run by using
UniversalDataAgentConfiguration
(when parserClassName
is JythonParser
),
add the parserBundle
element, like in the following
example: <results>
<UniversalDataAgentConfiguration
xsi:type="coll:com.collation.platform.model.discovery.agent.UniversalDataAgentConfiguration">
...
<parserClassName>com.collation.platform.uda.JythonParser</parserClassName>
<parserBundle>com.ibm.cdb.core.jython253</parserBundle>
...
</UniversalDataAgentConfiguration>
</results>
- To modify the script interpreter that is run by using CustomTemplateSensor
in
CSTTemplate
descriptor, add the engineId
element,
like in the following example: <CTSTemplate>
...
<engineId>com.ibm.cdb.core.jython253</engineId>
...
</CTSTemplate>