Adding a custom field view to the Information tab under General Information view in Spectrum OneClick for a specific model class
search cancel

Adding a custom field view to the Information tab under General Information view in Spectrum OneClick for a specific model class

book

Article ID: 388901

calendar_today

Updated On:

Products

Spectrum Network Observability

Issue/Introduction

This solution explains how to add the "HasStaleInterfaces" attribute to the general information subview under Information tab for devices with a model-class of "Firewall(27)".

Environment

DX NetOps Spectrum: All versions

Resolution

This is a step by step procedure on how to add an attribute named "HasStaleInterfaces" to the general information subview under component details for devices with a model class of "Firewall(27) using <display-if>:  
  
1. Identify the xml file responsible for displaying the Information view of a model class.  
  
1. In this document we will customize the general information view of firewall model class.  
  
3. On the OneClick webserver -> Navigate to $SPECROOT/tomat/webapps/spectrum/WEB-INF/topo/config/topo-app-config.xml and look for the below code  
  
<contents-registry>      
<icon-reg-id>firewall-icon-config</icon-reg-id>      
<tooltip-config>device-tooltip-config</tooltip-config>      
<information-config>view-devicedetails-config</information-config>      
<model-class>27</model-class>   
<!-- FIREWALL -->      
</contents-registry>  
  
1. The above code builds up the information view for firewall devices.  
  
5. Now look for view-devicedetails-config xml under $SPECROOT/tomat/webapps/spectrum/web-inf/topo/config directory and check the idref in the view tag  
  
<view id="view-devicedetails-config" idref="view-devicedetailsbase-config"> -------> Note this xml  
  
1. Now search for view-devicedetailsbase-config and the below code in this xml is responsible for displaying the fields under general information sub view under component detail panel of the firewall class.  
  
<!-- General Information -->      
<field-subview idref="device-geninfo-subview-config" expanded="true">    <title>com.aprisma.spectrum.app.topo.client.GeneralInformation</title>      
</field-subview>  
  
1. Now navigate to $SPECROOT/custom/topo/config directory  
  
8. Create a xml file with the name "device-geninfo-subview-config" and add the code below to the xml file  

<?xml version="1.0" encoding="utf-8"?>    
<field-subview idref="device-geninfo-subview-config">

<field-column>  

<display-if>
<expression>
attrInt(0x11ee8) == 27
</expression>
</display-if>

 
<column>  
<name>Ambient Temperature (Celsius)</name>
<content>    
<attribute>0x12be7</attribute>
</content>
</column>

</field-column>
</field-subview>

  
1. Save the file  
  
10. Close and restart any open OneClick clients.  
  
11. Login to OneClick and search for any firewall model in the database  
  
12. Go to the component detail panel -> Information -> General information tab and observe that "HasStaleInterfaces" field is add towards the right

This way we can add any field like device criticality , Red/Yellow/Orange threshold attributes to general information sub-view.