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.
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:
SNMP_OID = ['enterprises.2636.3.1.13.1'] SNMP_MIB_KEYS = [ {'Name': 'jnxOperatingTemp', 'Units': 'C', 'CalculationMethod': 'value'}, {'Name': 'jnxOperatingCPU', 'Units': '%', 'CalculationMethod': 'value'} ] PLUGIN_TYPE = 'snmp_network_device' PLUGIN_NAME = 'snmp_network_device_usage' SNMP_TAG_KEY = 'jnxOperatingDescr' AGGREGATE_ID = 'appformix_network_agents' PLUGIN_PREFIX = 'device' LOAD_ALL = True ENTITY_TYPE = ["fpc", "routing_engine", "pic", "fan", "power"]
Table 1 describes the fields.
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_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 “ |
||||||
PLUGIN_PREFIX |
(Optional) This field is the prefix of the metrics shown in
the Contrail Insights Dashboard. For example, for OID |
||||||
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.
appformix_custom_snmp_plugins: - { config_file_name: 'sample_snmp_config.py' }
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
:
installer_mib_location: 'snmp_mibs/*'
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/
.