Smarts NCM: NCM Smarts Adapter is not able to use Explicit Rules for use with IP domains
search cancel

Smarts NCM: NCM Smarts Adapter is not able to use Explicit Rules for use with IP domains

book

Article ID: 315776

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

To provide steps to resolve this issue with the NCM Smarts Adapter when trying to synchronize with the Smarts IP domains and use Explicit Rules for discovering devices from Smarts IP domains into NCM Networks.


Symptoms:

NCM Smarts Adapter is not able to use Explicit Rules for use with IP domains. The catalina.log file shows the following errors: The logs show issues in handling a NULL value 

 

Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "MAPPING_EXCLUSIONS_ID"; SQL statement:

insert into mapping_rule (mapping_rules_id, rules_idx, rule_id) values (?, ?, ?) [23502-210]


Environment

VMware Smart Assurance - SMARTS

Cause

The h2 Mapping Rules is not able to handle a NULL value.

Resolution

Follow the workaround provided as there is no ETA for a fix in NCM NCM Smarts Adapter.


Workaround:

To access the h2 console 

For NCM version 10.1.13 

Open  $VOYENCE_HOME/NCMSmartsAdapter/webapps/NCMSmartsAdapter-10.1.13.0/WEBINF/classes/application.properties


Add these two spring.h2 lines at the end of the file, after the following line:  

environments.production.dataSource.properties.defaultTransactionIsolation=2
spring.h2.console.enabled=true
spring.h2.console.settings.web-allow-others=true

Save the file.
Restart the NCMSmartsAdapter service.

Skip to Part II:  In Your Web Browser 

For NCM versions 10.1.1. through 10.1.11

First step is to update the NCM Smarts adapter application.yml file 

source /etc/voyence.conf 

Find the application yml file. In this example NCM version 10.1.11 was used.

If your version is older then use the version info of your NCM installation.
Navigate to the $VOYENCE_HOME/NCMSmartsAdapter/webapps directory and review the NCMSmartsAdapter directory name and use this path for the commands below.

$VOYENCE_HOME/NCMSmartsAdapter/webapps/NCMSmartsAdapter-10.1.11.0/WEB-INF/classes/application.yml 

Under the spring heading insert the h2; and the lines below.

spring:
    h2:
       console:
           enabled: true
           settings:
                web-allow-others: true

Save the file.

Restart the NCMSmartsAdapter service. 

Part II:  In Your Web Browser 

http://IP of the AS Server:11843/NCMSmartsAdapter-10.1.11.0 (or your version) /h2-console

The user is SA and the password is blank.

JDBC connection screenshot
You will need to type in the JDBC URL as shown above.
Test Connection, if successful, then click Connect.

Please Note:  This assumes you have installed NCM in the default path. If not use the command line interface on your AS server to find the correct path to NCMSmartsAdapter./prodDB 

Once connected you will see a screen that shows fields in the h2-console.  See screenshot below.

In the SQL Statement window, type the line below 

 

ALTER TABLE MAPPING_RULE ALTER COLUMN MAPPING_EXCLUSIONS_ID BIGINT NULL

 

Click Run

h2 Console for the SQL statement to run the SQL statement to resolve this issue.

The results should be as shown in the screen shot above:

 

The command above 

Update Count: 0

(1 ms)

 

 

To check this in the left side pane, Click on the + next to MAPPING_RULE 

Then click MAPPING_EXCLUSIONS_ID and you should see BIGINT with a NULL entry 

 

Restart the NCMSmartsAdapter service.


Additional Information

See KB article https://kb.vmware.com/s/article/93926?lang=en_US  as this KB article has the details for fixing the issue with SAM Binary limitation of 255.  Which prevents the NCM Smarts Adapter from reading larger Smarts environments from the Smarts broker.

Impact/Risks:

High, The NCM Smarts adapter will work with the TSM domain only as it applies default rules.