Skip to content

Using the Device SDK

jcostaroberts edited this page Sep 12, 2019 · 8 revisions

To run the Collector, either download the latest binary from arista.com or build it directly from the source. Also available on arista.com are the GNMIAdapter binary and the set of OpenConfig YANG models which define the supported output types and paths.

The GNMIAdapter sits between the Collector and CloudVision and does type-checking and translation. Tell the GNMIAdapter where to stream to with the -ingestgrpcurl option. Pass a path to a directory containing the YANG modules with the -yangroot option. The -yangmodule option allows users to tell the GNMIAdapter to use only certain modules. Configure authentication with the -ingestauth option.

$ ./GNMIAdapter -ingestauth=key,<aeris-ingest-key> -ingestgrpcurl=<cvp-address>:9910 -yangroot <path-to-modules>

(Note: This can be run on CVP without authentication on port 9900, or from anywhere with certificates using port 9910.)

Specify a device to use with the -device option. A manager is also a device, so -device will also accept a manager. Options specific to a given device are passed with the option -deviceoption <option>=<value>, and you can see which options a device needs by specifying it and -help, e.g.,

$ ./Collector -device openconfig -help
Usage of ./Collector:
  ...
  Help options for device 'openconfig':
    address (required)
  	gNMI server host/port
    paths
  	gNMI subscription path (comma-separated if multiple) (default /)
    username
  	gNMI subscription username
    ...

For example, to collect SNMP data from a device abc123 using SNMPv2c with community string public:

$ ./Collector -device snmp -deviceoption address=abc123 -deviceoption v=2c -deviceoption c=public

abc123 should show up in the CloudVision Device Inventory and in the Topology view. You can use Telemetry Browser to see the updates it’s streaming.

Alternatively, the Collector may be run with multiple devices simultaneously by passing it a YAML config file (with the -configFile option) containing multiple device configs, e.g.,

-  Device: snmp
   Options:
      address: <address>
      v: 2c
      c: <community>
-  Device: snmp
   Options:
      address: <address2>
      v: 2c
      c: <community2>
-  Device: openconfig
   Options:
      address: <address3>
      username: <username>

Mock mode

The Collector also contains a mocking tool that checks whether a given device type, pointed at a specific target device, supports some feature of interest. For example, it can check whether a set of devices (specified here in a config file) will produce system and interface data:

$ ./Collector -mock -configFile <path-to-file> -mockFeature interfaces=/interfaces/interface -mockFeature system=/system/state -mockFeature lldp=/lldp

If the features are supported, the output will look like:

All features are supported by all devices:
    system        supported
    interfaces    supported
    lldp          supported

If not, there will be more reading to do:

Some features are not supported by some devices:
Device ABC123SERIAL {device: snmp, deviceoption: address=abc123, deviceoption: community=public}
    interfaces    unsupported
    system        supported
    lldp          unsupported
Device XYZ789SERIAL {device: snmp, deviceoption: address=xyz789, deviceoption: community=public}
    interfaces    supported
    system        unsupported
    lldp          supported