4 Replies Latest reply on Jan 19, 2016 9:07 AM by wbrown

    Is there any detailed Device Studio documentation?

    wbrown

      Specifically I'm looking for the syntax documentation for the available functions.

      I stumbled on the Device Studio Pollers Quick Start Guide but that didn't provide any details for the functions.

      Reges, Substring and Length I figured out but the If statement has me stumped at the moment.

          • Re: Is there any detailed Device Studio documentation?
            wbrown

            I went down those paths.  Yes, there is a nice step-by-step guide.  What I was looking for was details such as syntax, keywords, arguments, etc that can be used with the various functions available for the transforms.

             

            For anyone interested, the If() function is as follows:

            IF(<condition to be tested> , <value to return if true>, <value to return if false>)

             

            <condition to be tested> is in the format of:

            OID comparison-operator value

            Example: [sysObjectID] = '1.3.6.1.4.1.9.12.3.1.3.1508'

             

            <value to return if __> is in the format of text data surrounded by single quotes.  I have not tested this with numeric return data.

            Example: 'Cisco Nexus 9396PX'

             

            Putting that all together, the full function from one of my pollers is:

            If([sysObjectID] = '1.3.6.1.4.1.9.12.3.1.3.1508','Cisco Nexus 9396PX','INVALID POLLER ASSIGNMENT')

             

            Specifically, when used in the MachineType field, that statement allows me to return the machine type of Cisco Nexus 9396PX when the poller is assigned to nodes with the sysObjectID of 1.3.6.1.4.1.9.12.3.1.3.1508.  If the poller is assigned to nodes with a different sysObjectID then the machine type will be displayed as INVALID POLLER ASSIGNMENT.

            I wrote this particular poller because my Nexus 9Ks were showing with a MachineType of "Cisco".

             

            Update:

            I'm now running NPM 11.5.3.  Nesting the If statements is supported.  I do not know whether this is supported in previous versions.

            A working example from my Cisco 897 poller is as follows:

            If([sysObjectID] = '1.3.6.1.4.1.9.1.1622','Cisco 897 ISR',

            If([sysObjectID] = '1.3.6.1.4.1.9.1.1624','Cisco 897 ISR',

              If([sysObjectID] = '1.3.6.1.4.1.9.1.1625','Cisco 897 ISR',

               If([sysObjectID] = '1.3.6.1.4.1.9.1.1626','Cisco 897 ISR',

                If([sysObjectID] = '1.3.6.1.4.1.9.1.2008','Cisco 897 ISR',

                 If([sysObjectID] = '1.3.6.1.4.1.9.1.2045','Cisco 897 ISR',

                  If([sysObjectID] = '1.3.6.1.4.1.9.1.2053','Cisco 897 ISR',

                      If([sysObjectID] = '1.3.6.1.4.1.9.1.2345','Cisco 897 ISR','INVALID POLLER ASSIGNMENT')

                  )

                 )

                )

               )

              )

            )

            )