Migrating Custom Drool Rule Files in NetIM 2.9.0

Categories:
Solution Number:
S38355
Last Modified:
2024-08-01
Description

In NetIM 2.9.0, the Drool library has been upgraded from version 5.1 to 9.44.0. This upgrade requires migration of user-defined custom Drool files to ensure they are correctly loaded into the Drool engine and function properly.

 

Issue
Due to the changes in the Drool rule definition syntax, user-defined custom Drool files from earlier versions need to be migrated to the new format. Although the upgrade process attempts to auto-migrate existing files, some files might be marked as invalid and will not be loaded into the Drool engine until manually updated.
Solution

To ensure successful migration and functionality of custom Drool rule files, follow these steps:

  1. Check Migration Efforts:
    • The upgrade process performs best-effort migrations. Common changes include:
      • Comments now start with // instead of #.
        • Old Format: # this is commented line
        • New Format: // this is commented line
      • Rule names must be unique.
      • The matches operator now uses Java Regex format.
        • Old Format: line matches "^.*tmsh\s+show\s+net\s+stp\s*$"
        • New Format: line matches "^.*tmsh\\s+show\\s+net\\s+stp\\s*$"
    • Please refer to the Drools documentation for the new syntax (the link shows version 8.44.0, but it applies to 9.44.0 as well).
      https://docs.drools.org/8.44.0.Final/drools-docs/drools/language-reference/index.html
  2. Verify Migration Logs:
    • After upgrading, check the post-install modifier logs for any issues:
      <InstallDir>/log/PostInstallModification/update<date>.log
  3. Check Invalid Drool Files:
    • If any new custom-defined Drool files added post-upgrade are marked as invalid, review the following log files for failure details:
      • AdapterServer.slf4j.<date>.log
      • NetworkModelDatabaseService.slf4j.<date>.log
      • AuxiliaryServices.slf4j.<date>.log
    • Look for errors related to Drool initialization, such as:
      ERROR com.makesys.fs.is.utils.DroolHelper.createKieModuleConfigs

Custom Drool Rule File Locations: Custom Drool rule files for SNMP Trap Severity mapping can be found at:

  • <InstallDir>/lib/xml/rules/snmpTrap/severity/Global/Custom
  • <InstallDir>/lib/xml/rules/snmpTrap/severity/OidSpecific/Custom

Example Error: An example of a migration error is shown below:

        2024/07/30 11:32:10 - [Thread-175] ERROR com.makesys.fs.is.utils.DroolHelper.createKieModuleConfigs - Kie Filesystem build result [Message [id=1, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=1, column=0 text=[ERR 107] Line 1:0 mismatched input '#' expecting one of the following tokens: '[package, unit, import, global, declare, function, rule, query]'.], Message [id=2, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=2, column=0 text=[ERR 102] Line 2:66 mismatched input '.' in global], Message [id=3, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=4, column=0 text=[ERR 107] Line 4:7 mismatched input 'com' expecting one of the following tokens: '[package, unit, import, global, declare, function, rule, query]'.], Message [id=4, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=14, column=0 text=[ERR 107] Line 14:0 mismatched input '#' expecting one of the following tokens: '[package, unit, import, global, declare, function, rule, query]'.], Message [id=5, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=14, column=0 text=[ERR 102] Line 14:20 mismatched input 'variables'], Message [id=6, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=15, column=0 text=[ERR 102] Line 15:0 mismatched input 'global'], Message [id=7, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=15, column=0 text=[ERR 102] Line 15:30 mismatched input 'evalObj'], Message [id=8, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=17, column=0 text=[ERR 102] Line 17:5 mismatched input '"Global Default Trap OID Based Severity Rule - ciscoLS1010ChassisFailureNotification"'], Message [id=9, kieBase=SnmpTrapGlobalCustomRuleBase, level=ERROR, path=com/makesys/fs/is/polling/snmp/trap/severity/drools/global/custom/mycustom.drl, line=0, column=0 text=Parser returned a null Package]]
    
Attachments
NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
Can't find an answer? Create a case