This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Is there any detailed Device Studio documentation?

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.

  • 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')

          )

         )

        )

       )

      )

    )

    )

  • Thanks, but I've looked through that one.  As I mentioned to Richard above, that is a nice step-by-step guide but doesn't include the syntax detail I was looking for.