DX NetOps Manager

Expand all | Collapse all

Is it possible to add a custom field view for a specific device type?

Jump to Best Answer
  • 1.  Is it possible to add a custom field view for a specific device type?

    Posted 08-30-2017 02:29 PM

    I want to create a custom field under the Information view of a specific device type in order to show the firmware version of the device.

    In this case, the devices are Transitions S4224, which are discovered as GnSNMPdev models. Although I know it's possible to add the custom field for model types or model classes, I'd like to know if it is possible to be more specific. 



  • 2.  Re: Is it possible to add a custom field view for a specific device type?
    Best Answer

    Posted 08-30-2017 03:12 PM

    You should be able to sue the <display-if> tag on the Device Type attribute id 0x23000e in your xml to tell OneClick to only display if it equal a specific value. There are some good examples in the Customizing a Model's Information View section of the documentation. 

     

    Define a Subview Group

    You can group together one or more subviews under a single collapsible group using the <subview-group> element.

    <subview-group>    <title>Subview Group Title</title>    <display-if>     <expression>          attrInt(AttributeID.MTYPE_HANDLE) == 0x3cc0002     </expression>    </display-if>   <subviews>     <table-subview idref="example-table1-config">          <title>Example Sub View #1</title>     </table-subview>     <table-subview idref="example-table2-config">          <title>Example Sub View #2</title>     </table-subview>    </subviews> </subview-group>

    Joe



  • 3.  Re: Is it possible to add a custom field view for a specific device type?

    Posted 08-30-2017 04:29 PM

    Thank you. I will take a deeper look at what you wrote, as the examples in the documentation don't apply for version 10.X, but for 9.X, and the topo-app-config.xml files are different from eachother's versions. 



  • 4.  Re: Is it possible to add a custom field view for a specific device type?

    Posted 09-05-2017 03:26 PM

    That helped me a lot! It was what I needed



  • 5.  Re: Is it possible to add a custom field view for a specific device type?

    Posted 09-05-2017 04:29 PM

    How can I know what tags are available to be used in these files?



  • 6.  Re: Is it possible to add a custom field view for a specific device type?

    Posted 08-31-2017 06:25 AM

    Considering what you explained about the identification on the "specific" field for a given model, I suggest you create a dedicated entry in the "Device Certification" panel of Spectrum, so then you control which "Device Type" will be the device you are targeted when it's discovered and then you can use the "Device Type" attribute to filter out the subview with the suggestion Joseph sent. That will be more specific than relying on the Model Type (as when it's GnSNMPDev, it's really generic).



  • 7.  Re: Is it possible to add a custom field view for a specific device type?

    Posted 08-31-2017 10:55 AM

    Yes, we've done that already. The devices were certified by us (though we didn't specified any Model type for them yet). 



  • 8.  Re: Is it possible to add a custom field view for a specific device type?

    Posted 09-04-2017 04:14 PM

    I've managed to add my custom field to show my custom attribute. 

    I copied the asset-info-subview-config.xml file to /spectrum/custom/topo and it has this configuration:

     

    <field-subview idref="asset-info-subview-config">
    <privilege>
      <name>asset-info</name>
    </privilege>
                <field-column>
                   <display-if>
                     <expression>
                        attr(0x23000e).toString().equals("Transition Networks S4224") <!-- Device type -->
                     </expression>
                   </display-if>
                   <column idref="custom-firmwareS4224-config"/>
                </field-column>
    </field-subview>

     

    It points to a custom file (custom-firmwareS4224-config.xml) I made to show the value for the custom attribute I created that points to the corresponding OID

     

    <?xml version="1.0" encoding="UTF-8"?>
    <column id="custom-firmwareS4224-config"
            xmlns ="http://www.aprisma.com"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.aprisma.com
                                ../../common/schema/column-config.xsd">

      <name>Firmware Transition</name>
     
      <content>
        <attribute>0xffff0004</attribute>
      </content>
      <header-template idref="headertemplate-singlerownonsortable-config"/>
     
    </column>

     

    So this is what I get.

     

     

    Now I have these questions:

     

    1) Can I add my custom field at the bottom of the first column, instead of adding a new column to the view?

    2) A better option would be to map the "Firmware version" original field to my custom xml (which points to the custom attribute). 

    In order to do so, I want to know if it's possible to override the original column-firmwareversion-config.xml (the field on the left side, below Serial number) and to add the <display-if> element, showing a different attribute's value depending on the device type. 

     

    Something like this:

     

    <column id="custom-firmwareS4224-config"
            xmlns ="http://www.aprisma.com"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.aprisma.com
                                ../../common/schema/column-config.xsd">

      <name>com.aprisma.spectrum.app.topo.client.FirmwareVersion</name>
      <display-if>
        <expression>
          attr(0x23000e).toString().equals("Transition Networks S4224") <!-- Device type -->
        </expression>
    </display-if>
          <content>
              <attribute>0xffff0004</attribute>
          </content>

    <!-- else -->

      <content>
        <attribute>0x12de0</attribute>
      </content>
      <header-template idref="headertemplate-singlerownonsortable-config"/>
     
    </column>

     

    Of course, the example above is not working. Any idea?



  • 9.  Re: Is it possible to add a custom field view for a specific device type?

     
    Posted 10-25-2018 09:32 AM

    You can show your custom firmware based on the type in the same spot as the OOB firmware. This example code is using the device family name so you would just replace the with your code.

     

    Code from the first column of data in asset info.

     

    <field-column>
    <column idref="column-networkaddress-config"><editable/></column>
    <column idref="column-devtype-config"/>
    <column idref="column-modelclass-config"/>
    <column idref="column-macaddress-config"/>
    <column idref="column-serialnumber-config"/>
    <display-if>
    <!-- Display if CollectionModelNameString (0x12adb) does not contain -->
    <expression>
    ( attr(0x12adb) != null &amp;&amp;
    ! attr(0x12adb).toString().contains("Adva"))
    </expression>
    </display-if>
    <column idref="column-firmwareversion-config"/>

    <display-if>
    <!-- Display if CollectionModelNameString (0x12adb) contains -->
    <expression>
    ( attr(0x12adb) != null &amp;&amp;
    attr(0x12adb).toString().contains(":Adva:"))
    </expression>
    </display-if>
    <column idref="Columns/column-adva-firmware-config"></column>
    <display-if>
    </display-if>
    <column idref="column-chassismodel-config"/>
    <column idref="column-slot-config"></column>
    <column idref="column-device-uuid-config"></column>
    <column idref="column-manufacturer-config"/>
    <column idref="field-chassislocation-config"></column>

    <display-if>
    <expression>
    attrInt(0x10001) == 0x2100ce <!-- Display Entity_SubType for CiscoNXOS -->
    </expression>
    </display-if>
    <column idref="column-entitysubtype-config"/>

    </field-column>