Skip to content

Using the Device SDK

dg-arista edited this page Jun 26, 2020 · 8 revisions

To run the Collector, either use the installed binary on CVP or build it directly from the source. The GNMIAdapter binary and its set of supported YANG modules are installed on CVP as well. Note that the CloudVision Device SDK is supported only on CVP versions 2019.1 and later.

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>

Running the GNMIAdapter is not necessary if your version of CloudVision includes support for the gNMI service.

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>

When streaming directly to CloudVision gNMI service, specify the use of metadata protocol version 2 and the service address as below.

-protoversion=v2 -gNMIServerAddr=<server IP:port>

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