Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Arrangement and application of snmp Oid

Shulou Source: shulou.com Published: 2022-06-01 00:55:05 10月04日 Update

OID common group

Management information base MIB: any managed resource is represented as an object, called a managed object. A MIB is a collection of managed objects. It defines a series of properties of the managed object: the name of the object, the access rights of the object, the data type of the object and so on. Each SNMP device (Agent) has its own MIB. MIB can also be seen as a bridge between NMS (Network Management system) and Agent.

The variables in the MIB file are named from the object Identifier (objectidentifier) namespace managed by ISO and ITU. It is a hierarchical tree structure. As shown in figure 2, the first level has three nodes: ccitt, iso, and iso-ccitt. The low-level object ID is assigned by the relevant organization respectively. The identifier of a particular object can be obtained through the path from the root to the object. General network devices take the object content under the iso node. For example, a MIB variable named ipInReceives under the namespace ip node is assigned a numeric value of 3, so the name of the variable is: iso.org.dod.internet.mgmt.mib.ip.ipInReceives corresponding numeric representation (object identifier OID, which uniquely identifies a MIB object) is: 1.3.6.1.2.1.4.3

MIB tree

Ip group

Oid: .1.3.6.1.2.1.4

1. IpRouteTable table

Oid: .1.3.6.1.2.1.4.21

DEll doesn't have this oid.

Example:

Iso.org.dod.internet.mgmt.mib.ip. IpRouteTable.ipRouteEntry.ipRouteNextHop.202.120.86.71,1.3.6.1.2.1.4.21.1.7.202.120.86.71ipRouteEntryIpRouteDest

Oid = 1.3.6.1.2.4.21.1.1

IP-MIB::ip.21.1.1.0.0.0.0 = IpAddress: 0.0.0.0 IP-MIB::ip.21.1.1.10.10.4.0 = IpAddress: 10.10.4.0 IP-MIB::ip.21.1.1.10.10.4.236 = IpAddress: 10.10.4.236 IP-MIB::ip.21.1.1.10.10.4.255 = IpAddress: 10.10. 4.255 IP-MIB::ip.21.1.1.127.0.0.0 = IpAddress: 127.0.0.0 IP-MIB::ip.21.1.1.127.0.0.1 = IpAddress: 127.0.0.1 IP-MIB::ip.21.1.1.127.255.255.255 = IpAddress: 127.255.255.255 IP-MIB::ip.21.1.1.255.255.255.255 = IpAddress: 255.255.255.255IpRouteNextHopoid = `. 1.3.6.1.2.4.21.1.7`IP-MIB::ip.21.1.7.0.0.0.0 = IpAddress: 10.10.4.254 IP-MIB::ip.21.1.7.10.10.4.0 = IpAddress: 10.10.4.236 IP-MIB::ip.21.1.7.10.10.4.236 = IpAddress: 127.0.0. 1 IP-MIB::ip.21.1.7.10.10.4.255 = IpAddress:127.0.0.1 IP-MIB::ip.21.1.7.127.0.0.0 = IpAddress:127.0.0.1 IP-MIB::ip.21.1.7.127.0.0.1 = IpAddress:127.0.0.1 IP-MIB::ip.21.1.7.127.255.255.255 = IpAddress:127. 0.0.1 IP-MIB::ip.21.1.7.255.255.255.255 = IpAddress: 127.0.0.1IpRouteMaskoid = `. 1.3.6.1.2.4.21.1.11` IP-MIB::ip.21.1.11.0.0.0.0 = IpAddress: 0.0.0.0 IP-MIB::ip.21.1.11.10.10.4.0 = IpAddress: 255.255.255. 0 IP-MIB::ip.21.1.11.10.10.4.236 = IpAddress: 255.255.255.255 IP-MIB::ip.21.1.11.10.10.4.255 = IpAddress: 255.255.255.255 IP-MIB::ip.21.1.11.127.0.0.0 = IpAddress: 255.0.0.0 IP-MIB::ip.21.1.11.127.0.0.1 = IpAddress: 255. 255.255.255 IP-MIB::ip.21.1.11.127.255.255.255 = IpAddress: 255.255.255.255 IP-MIB::ip.21.1.11.255.255.255.255 = IpAddress: 255.255.255.255IpRouteType

Oid = 1.3.6.1.2.4.21.1.8

IP-MIB::ip.21.1.8.0.0.0.0 = INTEGER: 3IP-MIB::ip.21.1.8.10.10.4.0 = INTEGER: 3IP-MIB::ip.21.1.8.10.10.4.243 = INTEGER: 3IP-MIB::ip.21.1.8.10.10.4.255 = INTEGER: 3IP-MIB::ip.21.1.8.127.0.0.0 = INTEGER: 3IP MIBV: Ip.21.1.8.127.0.0.1 = INTEGER: 3IP-MIB::ip.21.1.8.127.255.255.255 = INTEGER: 3IP-MIB::ip.21.1.8.255.255.255.255 = INTEGER: 32. IpAddrTable Table 3. IpNetToMediaTable table System group Interfaces group

.1.3.6.1.2.1.2

IfDescr Port description

OID = .1.3.6.1.2.2.2.1.2

IfSpeed port rate

Inbound and outbound traffic of ifInOctets port

Wait... the use of oid

Take Huasan V7 as an example:

Qsnmpwalk 10.11.254.1 sysDescr

SNMPv2-MIB::sysDescr.0 = STRING: H3C Comware Platform Software, Software Version 7.1.070, Release 2510P01H3C S6800-54QTCopyright (c) 2004-2017 New H3C Technologies Co., Ltd. All rights reserved. Query the MAC address under a port

Get the MAC address under the specific port of the switch.

Scan the MAC table (private MIB)

Get the corresponding relationship between MAC address and PortInterger

Qsnmpwalk 10.11.254.1 1.3.6.1.2.1.17.7.1.2.2.1.2

SNMPv2-SMI::mib-2.17.7.1.2.2.1.2.1000.88.105.108.194.51.215 = INTEGER: 1613SNMPv2-SMI::mib-2.17.7.1.2.2.1.2.1000.88.105.108.194.131.239 = INTEGER: 1613. Scan the PortInteger table (private MIB)

Get the corresponding relationship between PortInterger and IfIndex.

Qsnmpwalk 10.11.254.1 1.3.6.1.2.1.17.1.4.1.2

SNMPv2-SMI::mib-2.17.1.4.1.2.1 = INTEGER: 1SNMPv2-SMI::mib-2.17.1.4.1.2.2 = INTEGER: 2...SNMPv2-SMI::mib-2.17.1.4.1.2.1613 = INTEGER: 1619 scan the ifDescr table

Get the corresponding relationship between IfIndex and ifDescr.

IF-MIB::ifDescr.1 = STRING: Ten-GigabitEthernet1/0/1IF-MIB::ifDescr.2 = STRING: Ten-GigabitEthernet1/0/2...IF-MIB::ifDescr.1613 = STRING: NULL0IF-MIB::ifDescr.1619 = STRING: Bridge-Aggregation1

The final correspondence:

Bridge-Aggregation1-1619-1613-A bunch of mac

Tags: Object management name port identity variable address identifier number space node device private low-level three between switch example information information base Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Xiaomi Microsoft Docker Apple