CAPC models not mapped in Spectrum Oneclick

Document ID : KB000030796
Last Modified Date : 04/03/2019
Show Technical Document Details
Introduction:

Customers may see an issue with launching into CAPC from Spectrum.

Error seen in CAPC is that Context ID is not a valid number or it loads a device that is incorrect.

When looking at CAPC_Item_Id on the model in OneClick, it will be 0 or the wrong number.

Background:

Cause:

Spectrum was removed and re-added as a datasource at some point.

Devices were removed from spectrum and replaced but with same name and IP.

 

Reason:

Spectrum stores CAPC<->OC model mapping in netqos_integ item_model_mapping table and in an "in-memory cache" on OneClick server.  

When Spectrum is deleted as a Data Source, neither this cache nor the table are cleared out.  

So when Spectrum is re-added as a datasource, the cache believes we have already synced the model and it will not write a new value to CAPC_Item_Id on the model in Spectrum.

Environment:
Spectrum 10.x
CAPC 3.x
Instructions:

On OneClick server, stop the tomcat service.

  

  Use mysql and connect to netqos_integ database.

bash -login

cd mysql/bin

mysql -uroot -proot netqos_integ

 

  Run the following sql command:

truncate item_model_mapping;  

exit mysql,

and start the tomcat service.


When Spectrum connects to CAPC, it will basically do a full sync and repopulate the item_model_mapping table and in-memory cache, which will cascade to CAPC_Item_Id attribute on models synced.

Additional Information:

This can also cause events to not be sent to the correct model.  

If the item_model_mapping table is incorrect or not updated correctly, the events would be mapped to the wrong Spectrum device or no device at all.