---
title: "Configuring SNMP Collector in NetSense for MIBs"
canonical: "https://thoughtdata.refined.site/space/TUD/55186251/Configuring%20SNMP%20Collector%20in%20NetSense%20for%20MIBs"
format: markdown
---
## Configuring SNMP Collector in Netsense for MIBs

**Pre-Requisite**: Basic knowledge of SNMP and MIBs is required to understand this topic and setting up your Netsense to collect data from different MIBs from devices of different vendors. This is typically done by advanced users. You have downloaded the MIB which you intend to monitor and understood which tables and OIDs which you want to monitor and ThoughtData's Netsense is installed configured and up and running in your IT network along with SNMP collector to perform additional configuration.

Copy the MIB file you have downloaded into **"/usr/share/snmp/mibs"** directory in Netsense

![image](media://4a24888d-0418-4734-8c79-e3974db518fe)

 Copy your downloaded MIB file into Netsense system

You may optionally create sub folder for different vendors to organize your MIBs and copy the mib files under them, If you do so, remember the full path where you copied the mib file.

Go to **"/etc/snmp"** directory, edit the file **snmp.conf** by running **"vi snmp.conf"**

![image](media://b6c98891-0476-4e89-a748-aa0bea986516)

 Edit the snmp.conf file

If you copied the file to **"/usr/share/snmp/mibs"** path, you do not need to append the config in **mibdirs** section in this file and skip to next step. If you copied it somewhere else, append the **mibdirs** config, by adding the full path of the directory where the MIB was copied at the end by adding a "<span style="color: #0000ff">**:**</span>**"** prefix.

For Example: 

***mibdirs /usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/snmp/mibs/Cisco/v2/auto/mibs/v2:/usr/share/snmp/mibs/vmware***<span style="color: #0000ff">***:/usr/share/snmp/mibs/Cisco/v1***</span>

where <span style="color: #0000ff">***/usr/share/snmp/mibs/Cisco/v1***</span><span style="color: #000000">* is the path where you copied the mib file*</span>

In the **mibs** section of this file, add the MIB name at the end by adding "<span style="color: #0000ff">**:**</span>**"** prefix.

For Example: 

***mibs +UUID-TC-MIB:VMWARE-ENV-MIB:VMWARE-ESX-AGENTCAP-MIB:VMWARE-HEARTBEAT-MIB:VMWARE-NSX-MANAGER-AGENTCAP-MIB:VMWARE-NSX-MANAGER-MIB:VMWARE-PRODUCTS-MIB:VMWARE-RESOURCES-MIB:VMWARE-ROOT-MIB:VMWARE-SRM-EVENT-MIB:VMWARE-SYSTEM-MIB:VMWARE-TC-MIB:VMWARE-TUNNEL-SERVER-AGENTCAP-MIB:VMWARE-TUNNEL-SERVER-MIB:VMWARE-VA-AGENTCAP-MIB:VMWARE-VC-EVENT-MIB:VMWARE-VCHA-MIB:VMWARE-VCOPS-EVENT-MIB:VMWARE-VMINFO-MIB:VMWARE-VMINFO-MIB:CISCO-PROCESS-MIB:CISCO-SMI:CISCO-SWITCH-ENGINE-MIB:CISCO-IP-STAT-MIB:CISCO-VTP-MIB***<span style="color: #0000ff">***:***</span>***<span style="color: #0000ff">CISCO-ENVMON-MIB</span>***

where ***<span style="color: #0000ff">CISCO-ENVMON-MIB </span>***<span style="color: #000000">*is the name of the MIB you copied*</span>

Save and exit the file by pressing **"Esc" ":" "wq"**.

Execute the command **"snmptranslate -Tp 1.3.6.1.4.1.9.9.13.1.3"** where **1.3.6.1.4.1.9.9.13.1.3** is the OID of the MIB table you want to poll in the MIB. In this example **1.3.6.1.4.1.9.9.13.1.3** represents **ciscoEnvMonTemperatureStatusTable**, which is the MIB table for monitoring temperature status of Cisco switch

![image](media://da617817-2c66-482f-a6cd-6338bfc48b70)

 Edit mib_collection.cfg

Note that this table has 6 metrics as show in above screenshot. You can optionally choose which metrics you want to poll in the next set of configurations. Remember to note down the ID of the metric you want to poll or you do not want to poll as it will required for next steps. For E.g. : If you wish not to poll **ciscoEnvMonTemperatureLastShutdown** the ID will be **5.**

Go to the directory containing configuration files in your Netsense sensor using the command **"*****cd /usr/local/thoughtdata/netsense/etc/ "*** 

Edit the file ***"mib_collection.cfg"*** using the command ***"vi m******ib_collection.cfg******"*** 

![image](media://0c0a0591-391f-4eb1-a9dc-ad685d64108d)

 Edit mib_collection.cfg

This configuration file is the main configuration file which lets the SNMP Collector in your Netsense sensor to know which MIBs to poll. Only table OIDs has to be provided in this config file and not metric OIDs. Some out of box MIBs and their respective OIDs are pre-configured already in this file.

Add a new line at the end of this file. The line follows following format

** #<snmp tableId>,<reporting 1/0>,<static/dynamic>,<mib type 1-universal,2-server-mib,3-esxi,4-cisco devices>,<interval>,<mib oid>**

|  |  |
| --- | --- |
| Option/Field | Description |
| <snmp tableId> | This is new table ID for the new MIB you wish to poll, you will increment the last number/row in the file, in above example you will be inserting new row at row 35, so the Table ID will be 35 |
| <reporting 1/0> | This flag represents if you want to poll or not to poll the MIB table, **1 = Poll, 0 = Do not Poll** |
| <static/dynamic> | This parameter indicates if the MIB table you are polling is a static table or a dynamic table<br>**S = Static, T = Dynamic/Time trending**<br>What is a Static Table?:  A static table is a MIB table where the values of the metrics in the table does not change over a period of time. For E.g.: A table which contains name of a system. system description, software version etc is a static table, It does not change every 5min on the device, Its likely to stay constant or changes rarely.<br>What is a Dynamic Table?: A dynamic table is a MIB table where the values of the metrics in the table constantly changes over a period of time. For E.g.: A table which contains %cpu utilization, %memory usage etc is a dynamic table, It changes constantly on the device.<br>This information is required for Netsense sensor to decide how often it has to poll the data from this table. |
| <mib type 1-universal,2-server-mib,3-esxi,4-cisco devices> | This parameter indicates whether the MIB you added is a universal/standard MIB or a vendor specific MIB . This information is required for Netsense sensor to decide to poll the right MIBs on target device. |
| <interval> | This parameter indicates the frequency of polling, unit is seconds, default is **300** for dynamic tables, for static tables set it to **86400**. Setting lower poll interval for static tables will unnecessarily wastes Netsense SNMP collector resources, Likewise setting lower than 300 for dynamic tables decreases the performance of your Netsense SNMP collector due to increased polling. Increasing dynamic tables to greater than 300 increases your Netsense Sensor's SNMP collector performance. Choose the appropriate values depending on your monitoring needs. |
| <mib oid> | OID of the table you wish to poll E.g.: **1.3.6.1.4.1.9.9.13.1.3** |

A sample example row will look something like below

**35,1,T,4,300,4,****1.3.6.1.4.1.9.9.13.1.3**

Save and exit the file by pressing "Esc" ":" "wq".

The following steps are required to configure specific details about the individual metrics from the MIB table, By default SNMP collector collects all metrics in the MIB table post configuration unless specified otherwise. The following steps provide additional details about how you control individual metric data collection within a MIB table. If you intend to collect all metrics , you can skip below steps and proceed to Step 14

In the same directory create a new file with the format OID.cfg, For E.g.:**1.3.6.1.4.1.9.9.13.1.3.cfg** by running "**vi** **1.3.6.1.4.1.9.9.13.1.3.cfg". **Note the OID should be the OID of the table which you are configuring.

![image](media://e0250173-9316-4aa5-b189-721db2da2d8f)

 Create the CFG file for the OID - Sample illustration

This file is used for Netsense sensor SNMP collector to know, if certain metrics should not be polled in a given SNMP MIB. By default if there is no configuration OID.cfg all metrics are polled. If there is a configuration file , the collector checks for the configuration and you may specify which ones you do not want to poll 

Add new lines to the file. The lines follows following format

#<Add/Remove>:<newFieldColumnId>

|  |  |
| --- | --- |
| Option/Field | Description |
| <Add/Remove> | This flag represents if you want to collect data from a particular metric or not **1 = Add/Collect, 0 = Do not add/Do not Collect** |
| <newFieldColumnId> | This field is the ID of the metric which you do not want to poll inside the MIB table as collected during Step 8 |

Save and exit the file by pressing "Esc" ":" "wq".

Your Netsense sensor SNMP collector configuration to poll a specific MIB is now completed. You can restart your Netsense sensor SNMP collector.

If you haven't setup SNMP collector as a service. Go to "**cd** ***/usr/local/thoughtdata/netsense/bin/ "*** 

Run **"./stopnp*****" and "./startnp"**** to stop and start your SNMP collector**** ***

Run **"./ps"** to check if the SNMP collector process is running

Alternatively, If you have registered your SNMP collector process as a service. Run **"systemctl stop tdnetpoller*****" ****followed by**** ******"systemctl start tdnetpoller******"****** ***to stop and start your SNMP collector.

Checking logs of SNMP collector process. Run **"cat tdnetpoller.log*****" ***to check SNMP collector related logs in case if you run into any issues

Your configuration to setup your SNMP collector in Netsense sensor for polling a specific MIB from your network device is now completed, you may now proceed to configure your Enterprise360 to add a new dashboard to visualize the metrics from the new MIB.

Related Topic

Configure new dashboard for polled SNMP MIB data in Enterprise360