Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Custom SNMP Plug-Ins

Contrail Insights can monitor SNMP metrics of network devices in your data center. Contrail Insights includes several supported SNMP plug-ins shipped with the product including ifTable, ifXTable, and TCP plug-ins for network devices for all vendors and three more plug-ins for Juniper devices. In addition to the Contrail Insights built-in SNMP plug-ins, Contrail Insights allows you to create your own custom SNMP plug-ins. The custom SNMP plug-ins allow you to define the SNMP MIBs and metrics that you want to monitor. The only thing you need is to define a configuration file for the SNMP MIB you want to monitor.

Note:

Confirm that you installed the related MIBs on the appformix_network_agent nodes before you generate the plug-ins.

Sample Custom SNMP Plug-In Configuration File

The sample configuration file is listed. You can also find this sample file in the Contrail Insights release bundle sample_snmp_config.py:

Table 1 describes the fields.

Table 1: SNMP Plug-In Configuration File Field Descriptions

Field

Description

SNMP_OID

The OID of SNMP MIB you want to monitor.

SNMP_MIB_KEYS

The metrics in this MIB are metrics that you want to monitor. The key needs to match the key received from the SNMP command.

PLUGIN_TYPE

There are three types of SNMP plug-ins:

snmp_network_device

Refers to tabular MIBs which define multiple related object instances grouped in MIB tables. For example, ifTable defined the metrics for a list of interfaces on this device.

snmp_device_info

Refers to singular MIBs which define a single object instance. For example, 1.3.6.1.2.1.1.7 (OID for sysServices). You can specify by OID and name it.

snmp_device_attribute

Refers to the case where there is not a field to determine the tag for each entry in tabular MIBs. Instead, the sample SNMP output of these MIBs are metric_name .x.x.x.x = value where x.x.x.x is the tag name. For instance, OID 1.3.6.1.4.1.9.9.42.1.1.8.1 (OID for CISCO-RTTMON-MIB).

SNMP_TAG_KEY

This field is required for tabular (plugin_type=snmp_network_device) MIBs to determine the tag for each entry of the SNMP output. This field is not needed for singular (plugin_type=device_info) MIBs .

AGGREGATE_ID

Must be set to “appformix_network_agents”.

PLUGIN_PREFIX

(Optional) This field is the prefix of the metrics shown in the Contrail Insights Dashboard. For example, for OID IF-MIB::ifTable, the prefix could be interface.

CalculationMethod

Prior to release 2.16, this field was called CalculationType. This denotes how Contrail Insights calculates this metric (rate/value).

ENTITY_TYPE

A list of strings that indicates what this MIBs data represents. If it reports interface data, ENTITY_TYPE=['interface'].

Configure Custom SNMP Plug-Ins in Contrail Insights

After you create the configuration file for your custom SNMP plug-in, the next step is to post your plug-in to Contrail Insights. Copy your configuration file to your Contrail Insights Ansible directory and include the plug-in descriptor in the appformix_custom_snmp_plugins variable in group_vars/all. This variable must be initialized at the time of the Contrail Insights Platform installation. Save the configuration file as sample_snmp_config.py in your installation directory.

Then Contrail Insights will take your configuration file, generate the plug-in configuration JSON file and install this plug-in to Contrail Insights during the Contrail Insights Platform installation.

Install MIBs in Contrail Insights Agents from Ansible

When adding or enabling a new plug-in in Contrail Insights, you need to install the corresponding MIBs in your Contrail Insights Agents. The Contrail Insights Ansible script helps you install the MIBs in both appformix_controller nodes and Contrail Insights Agents.

Set the following variable in group_vars/all:

Add the needed MIB files (.txt) in a folder and Contrail Insights will install all the MIBs from that folder in your appformix_controller nodes and Contrail Insights Agents by copying those MIB files to the location set in the platform_mib_location variable. You can change this variable in group_vars/all. The default value is /usr/share/snmp/mibs/.