Configure Network Device from JSON File
Overview
To add network devices to Contrail Insights, you can draft a
network device JSON file and set the following variable in group_vars/all
:
network_device_file_name: /path/to/network_device_file_name.json
Multiple network devices can be added to the JSON file. This file can be written manually from the network inventory. Alternatively, tools like LLDP can be used to generate the device names, interface connections, and topology information.
The network device topology file should adhere to the following
example schema(s). Note that a device can also be configured with
multiple sources (SNMP, JTI, gRPC and NETCONF). Following is one example
for each source. Note that only user.snmp
, user.jti
, user.grpc
, and user.netconf
are accepted in the Source
field and a period ('.') cannot be specified
in the NetworkDeviceId
field.
Included in the release bundle is a sample configuration file: sample_network_device_config.json
Network Device JSON Example for SNMP Device
{ "NetworkDeviceList": [ { "NetworkDevice": { "MetaData": { "SnmpConfig": { "Version": "2c", "Community": "public", "PollInterval": 60, "OIDList": ["IF-MIB::ifTable", "IF-MIB::ifXTable"] } }, "ManagementIp": "10.1.1.2", "Name": "qfx1", "Source": ["user.snmp"], "NetworkDeviceId": "qfx1", "ChassisType": "tor", "ConnectionInfo": [ { "remote_interface_name": "et-0/0/1", "local_interface_name": "et-0/1/0", "remote_system_id": "qfx2" }, { "local_interface_name": "et-0/0/2", "remote_interface_name": "et-0/1/0", "remote_system_id": "qfx3" } ] } }, { "NetworkDevice": { "MetaData": { "SnmpConfig": { "Version": "3", "Username": "user1", "Password": "password1", "Level": "authPriv", "Protocol": "SHA", "PrivProtocol": "DES", "PrivKey": "privacy protocol pass phrase", "SnmpEngineId": "80000000000", "OIDList": ["IF-MIB::ifTable", "TCP-MIB::tcp"] } }, "ManagementIp": "10.1.1.3", "Name": "qfx2", "NetworkDeviceId": "qfx2", "Source": ["user.snmp"], "ChassisType": "spine", "ConnectionInfo": [ { "local_interface_name": "et-0/0/1", "remote_interface_name": "et-0/1/0", "remote_system_id": "qfx1" } ] } } ] }
Some fields have a fixed list of valid choices:
NetworkDevice.MetaData.SnmpConfig.Version: "2c", "3"
NetworkDevice.MetaData.SnmpConfig.Protocol: "MD5", "SHA"
NetworkDevice.MetaData.SnmpConfig.Level: "noAuthNoPriv", "authNoPriv", "authPriv"
NetworkDevice.MetaData.SnmpConfig.PrivProtocol: "AES", "DES"
The field MetaData.SnmpConfig.PollInterval
is optional. You can input a value which is a multiple of 60. It
determines the period that Contrail Insights will poll for SNMP data
from the device (units is in seconds). By default, this value is set
to 60 seconds.
Following are the possible values for the field MetaData.SnmpConfig.OIDList
:
"TCP-MIB::tcp"
"IF-MIB::ifXTable"
"IF-MIB::ifTable"
"UDP-MIB::udp"
"UCD-SNMP-MIB::memory"
"IP-MIB::ipInReceives"
"IPV6-MIB::ipv6IfTable"
"JUNIPER-FIREWALL-MIB::jnxFWCounterDisplayFilterName"
"NETWORK_DEVICE_SYSTEM_METRICS_MIB"
"JUNIPER-PFE-MIB::jnxPfeMemoryUkernFreePercent"
"JUNIPER-SUBSCRIBER-MIB::jnxSubscriberTotalCount"
"JUNIPER-IPv6-MIB::jnxIpv6StatsReceives"
"1.3.6.1.4.1.2636.3.4.2"
"enterprises.2636.3.1.13.1"
"enterprises.2636.3.39.1.12"
"1.3.6.1.2.1.25.2"
These are all of the MIBs that Contrail Insights supports out of the box. To enable additional SNMP MIB monitoring, see Custom SNMP Plug-Ins for more information.
SNMP Traps are automatically enabled on SNMP devices if the
SNMP Trap plug-in is enabled. The SnmpEngineId
field is needed for SNMP Trap v3.
Network Device JSON Example for JTI Device
{ "NetworkDeviceList": [ { "NetworkDevice": { "MetaData": { "Version": "17.2R1", "Username": "user2", "Password": "password2", "NetConfPort": 830, "JtiConfig": { "ReportRate": 60, "Dscp": 20, "DeviceLocalPort": 21112, "LocalAddress": "172.16.0.1", "ForwardingClass": "best-effort", "SensorList": [ { "Name": "Interface_Sensor", "Resource": "/junos/system/linecard/interface/" } ] } }, "ManagementIp": "10.1.1.4", "Name": "qfx3", "Source": ["user.jti"], "NetworkDeviceId": "qfx3", "ChassisType": "tor", "ConnectionInfo": [ { "remote_interface_name": "et-0/0/2", "local_interface_name": "et-0/1/0", "remote_system_id": "qfx2" } ] } } ] }
Following are the possible values for the field MetaData.JtiConfig.SensorList
:
"/junos/system/linecard/cpu/memory/"
"/junos/system/linecard/fabric/"
"/junos/system/linecard/firewall/"
"/junos/system/linecard/interface/"
"/junos/system/linecard/interface/logical/usage/"
"/junos/system/linecard/npu/memory/"
"/junos/system/linecard/npu/utilization/"
"/junos/system/linecard/optics/"
"/junos/system/linecard/packet/usage/"
"/junos/system/linecard/qmon/"
These are all of the JTI UDP sensors Contrail Insights supports out of the box. To enable additional JTI sensor monitoring, see Custom Sensors for JTI, gRPC, and NETCONF for more information.
Note that the variables ForwardingClass
, DeviceLocalPort
, Dscp
, ReportRate
, PayloadSize
, and LocalAddress
are optional variables. DeviceLocalPort
will default to 21112, Dscp
will default to 20, and ReportRate
will default to 60 if you do not supply these values. LocalAddress
is used to set the local-address
of export-profile
in the device configuration.
If you do not supply LocalAddress
, then
Contrail Insights will use the device's ManagementIp
field to set local-address
of export-profile
on the device.
Network Device JSON Example for gRPC Device
{ "NetworkDeviceList": [ { "NetworkDevice": { "MetaData": { "Version": "17.2R1", "Username": "root", "Password": "pass", "NetConfPort": 830, "GrpcConfig": { "DeviceLocalPort": 50051, "SSLEnabled": false, "SensorList": [ { "Resource": "/interfaces/", "ReportRate": 60 }, { "Resource": "/junos/system/subscriber-management/infra/sdb/statistics/", "ReportRate": 60 } ] }, "ManagementIp": "10.1.1.4", "Name": "qfx4", "Source": ["user.grpc"], "NetworkDeviceId": "qfx4", "ChassisType": "tor", "ConnectionInfo": [ { "remote_interface_name": "et-0/0/2", "local_interface_name": "et-0/1/0", "remote_system_id": "qfx5" } ] } } ] }
Following are the possible values for the field MetaData.GrpcConfig.SensorList
:
"/arp-information/ipv4/neighbors/neighbor/"
"/bgp-rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/"
"/bgp-rib/afi-safis/afi-safi/ipv4-unicast/neighbors/"
/bgp-rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/"
"/bgp-rib/afi-safis/afi-safi/ipv6-unicast/neighbors/"
"/components/"
"/interfaces/"
"/junos/npu-memory/"
"/junos/rsvp-interface-information/"
"/junos/services/label-switched-path/usage/"
"/junos/services/segment-routing/interface/egress/usage/"
"/junos/services/segment-routing/interface/ingress/usage/"
"/junos/services/segment-routing/sid/usage/"
"/junos/system/linecard/cpu/memory/"
"/junos/system/linecard/firewall/"
"/junos/system/linecard/intf-exp/"
"/junos/system/linecard/npu/memory/"
"/junos/system/linecard/npu/utilization/"
"/junos/system/linecard/optics/"
"/junos/system/linecard/packet/usage/"
"/junos/system/linecard/qmon-sw/"
"/junos/system/subscriber-management/aaa/accounting-statistics/"
"/junos/system/subscriber-management/aaa/dynamic-request-statistics/"
"/junos/system/subscriber-management/client-protocols/dhcp/v6/"
"/junos/system/subscriber-management/client-protocols/dhcp/v4/"
"/junos/system/subscriber-management/client-protocols/l2tp/summary/"
"/junos/system/subscriber-management/client-protocols/ppp/statistics/"
"/junos/system/subscriber-management/client-protocols/pppoe/statistics/"
"/junos/system/subscriber-management/infra/network/ppp/"
"/junos/system/subscriber-management/infra/network/pppoe/"
"/junos/system/subscriber-management/infra/sdb/statistics/"
"/junos/task-memory-information/task-memory-overall-report/task-memory-stats-list/task-memory-stats/"
"/junos/task-memory-information/task-memory-overall-report/task-size-block-list/task-size-block/"
"/lacp/"
"/lldp/interfaces/interface/neighbors/"
"/lldp/interfaces/interface/state/"
"/nd6-information/"
These are all of the gRPC sensors Contrail Insights supports out of the box. To enable additional gRPC sensor monitoring, see Custom Sensors for JTI, gRPC, and NETCONF for more information.
Note that the variable SSLEnabled
determines whether you want to set up a secure
connection to the device. See Contrail Insights JTI (gRPC) Monitoring for more
information.
DeviceLocalPort
is an optional variable
which defaults to 50051.
Network Device JSON Example for NetConf Device
{ "NetworkDeviceList": [ { "NetworkDevice": { "MetaData": { "Version": "17.2R1", "Username": "root", "Password": "pass", "NetConfPort": 830, "NetConfConfig": { "CommandList": [ { "CommandLine": "show interfaces terse", "Interval": 60 } ] }, "ManagementIp": "10.1.1.5", "Name": "qfx5", "Source": ["user.netconf"], "NetworkDeviceId": "qfx5", "ChassisType": "tor", "ConnectionInfo": [ { "remote_interface_name": "et-0/1/0", "local_interface_name": "et-0/0/2", "remote_system_id": "qfx4" } ] } } ] }