MIB and SNMP walk...Which information do I need?


#1

Apologies for a possibly pretty stupid question but getting super confused!

I have setup:

  1. Install of influxDB
  2. Install Telegraf (Ubuntu)
  3. Tested the data from Telegraf for the default system stats it provides and seeing the values in Grafana (also confirmed using a test SNMP device with basic stats.

My question is, I have a new device and have the .MIB file. It contains a lot of information inside it.

I can do an SNMP walk for the device and get:

SNMPv2-MIB::sysDescr.0 = STRING: SP8 SP8459i 260612
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.3854.1
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1217604) 3:22:56.04
SNMPv2-MIB::sysContact.0 = STRING: Sys Contact
SNMPv2-MIB::sysName.0 = STRING: Sys Name
SNMPv2-MIB::sysLocation.0 = STRING: Sys Location
SNMPv2-MIB::sysServices.0 = INTEGER: 10
IF-MIB::ifNumber.0 = INTEGER: 1
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifDescr.1 = STRING: AKCP
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifMtu.1 = INTEGER: 1500
IF-MIB::ifSpeed.1 = Gauge32: 10000000
IF-MIB::ifPhysAddress.1 = STRING: 0:b:dc:0:96:fa
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifLastChange.1 = Timeticks: (0) 0:00:00.00
IF-MIB::ifInOctets.1 = Counter32: 694088
IF-MIB::ifInUcastPkts.1 = Counter32: 0
IF-MIB::ifInNUcastPkts.1 = Counter32: 0
IF-MIB::ifInDiscards.1 = Counter32: 0
IF-MIB::ifInErrors.1 = Counter32: 0
IF-MIB::ifInUnknownProtos.1 = Counter32: 0
IF-MIB::ifOutOctets.1 = Counter32: 363530
IF-MIB::ifOutUcastPkts.1 = Counter32: 0
IF-MIB::ifOutNUcastPkts.1 = Counter32: 0
IF-MIB::ifOutDiscards.1 = Counter32: 0
IF-MIB::ifOutErrors.1 = Counter32: 0
IF-MIB::ifOutQLen.1 = Gauge32: 0
IF-MIB::ifSpecific.1 = OID: SNMPv2-SMI::zeroDotZero
IP-MIB::ipForwarding.0 = INTEGER: notForwarding(2)
IP-MIB::ipAdEntAddr.192.168.1.246 = IpAddress: 192.168.1.246
IP-MIB::ipAdEntIfIndex.192.168.1.246 = INTEGER: 1
IP-MIB::ipAdEntNetMask.192.168.1.246 = IpAddress: 255.255.255.0
IP-MIB::ipAdEntBcastAddr.192.168.1.246 = INTEGER: 1

This is a short piece of text from the much larger MIB file:

sensorProbeTempTable OBJECT-TYPE
SYNTAX SEQUENCE OF SensorProbeTempEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
“This table contains the data for every Temperature Sensor in the SensorArray. Each row in the table contains data for a different Temperature Sensor.”
::= { sensorProbeEntry 16 }

This device is a network environment monitoring device and i have temperature sensors attached. I am confused as to what information I need to put in the .config file, or is there anyway of using the MIB file to get all the OIDs automatically?


#2

If you install your MIB so that it can be used by snmptable/snmptranslate, you can specify a table with a textual OID and its fields will be collected. There is an example of this here. If the MIB is not installed you will need to specify the numerical OIDs of each field like in the primary example, but you can leave the table OID out.


#3

hi thanks for your help! That resource is very useful. What do you mean by “intall your MIB”

How would one install the MIB?

If i am using the numberical OID how do i know when to use snmp.field, snmp.table and snmp.table.field?


#4

You should be able to place the MIB into the path configured in your snmp.conf, usually /usr/share/snmp/mibs or use the MIBDIRS environment variable. Here is the current documentation for making the MIB available.

Use snmp.field to get top level values and tags. If you are using numerical OIDs then you don’t need an OID in the snmp.table but you will need to specify each snmp.table.field with its numerical OID.

The top level fields you specify are retrieved via a GET, and the tables are gathered using WALK/BULKWALK.


#5

thanks for your reply. that is very helpful. I cannot find in the literature where it refers to where to place the MIB files.

What is the purpose of placing them there? Do numerical OID’s only work if the MIB is placed there?


#6

It’s the other way around, they provide the textual names for an OID. Since they can be used to lookup the field names for a table you can specify a table without any subfields and Telegraf will know what to name the fields.

If you use numerical OIDs and fully specify the table you don’t need the MIB.


#7

thank you. I have placed the .MIB in /usr/share/snmp/mibs however in this folder the other files have the extension .mib.txt Do i need to change my .mib to this file name too?

Furthermore when i do SNMPwalk for this device, there are alot of MIBs missing (with or without the .MIB file in /usr/share/snmp/mibs folder? Is that normal?


#8

I have placed the .MIB in /usr/share/snmp/mibs however in this folder the other files have the extension .mib.txt Do i need to change my .mib to this file name too?

I’m not sure, but you can test that it is working by running snmptranslate <oid> and verifying that a OID name, and not a numeric ID, is returned.

Furthermore when i do SNMPwalk for this device, there are alot of MIBs missing (with or without the .MIB file in /usr/share/snmp/mibs folder? Is that normal?

That would be normal if you are missing a MIB, but it shouldn’t be a problem unless something you are wanting to use is missing.