Thursday, July 27, 2017

.::: Sample output snmpwalk OID on MIB IF-MIB :::.


1. Definition IF-MIB
The MIB module to describe generic objects for network interface sub-layers. This MIB is an updated version of MIB-II's ifTable, and incorporates the extensions defined in RFC 1229.

2. OID on IF-MIB include calculate
ifTable
1.3.6.1.2.1.2                            interfaces                                           NODE
1.3.6.1.2.1.2.1                          ifNumber                                             LEAF  Integer32
1.3.6.1.2.1.2.2                          ifTable                                              NODE
1.3.6.1.2.1.2.2.1                        ifEntry                                              NODE
1.3.6.1.2.1.2.2.1.1                      ifIndex                                              LEAF  InterfaceIndex
1.3.6.1.2.1.2.2.1.2                      ifDescr                                              LEAF  DisplayString
1.3.6.1.2.1.2.2.1.3                      ifType                                               LEAF  IANAifType
1.3.6.1.2.1.2.2.1.4                      ifMtu                                                LEAF  Integer32
1.3.6.1.2.1.2.2.1.5                      ifSpeed                                              LEAF  Gauge32
1.3.6.1.2.1.2.2.1.6                      ifPhysAddress                                        LEAF  PhysAddress
1.3.6.1.2.1.2.2.1.7                      ifAdminStatus                                        LEAF  INTEGER
1.3.6.1.2.1.2.2.1.8                      ifOperStatus                                         LEAF  INTEGER
1.3.6.1.2.1.2.2.1.9                      ifLastChange                                         LEAF  TimeTicks
1.3.6.1.2.1.2.2.1.10                     ifInOctets                                           LEAF  Counter32
1.3.6.1.2.1.2.2.1.11                     ifInUcastPkts                                        LEAF  Counter32
1.3.6.1.2.1.2.2.1.12                     ifInNUcastPkts                                       LEAF  Counter32
1.3.6.1.2.1.2.2.1.13                     ifInDiscards                                         LEAF  Counter32
1.3.6.1.2.1.2.2.1.14                     ifInErrors                                           LEAF  Counter32
1.3.6.1.2.1.2.2.1.15                     ifInUnknownProtos                                    LEAF  Counter32
1.3.6.1.2.1.2.2.1.16                     ifOutOctets                                          LEAF  Counter32
1.3.6.1.2.1.2.2.1.17                     ifOutUcastPkts                                       LEAF  Counter32
1.3.6.1.2.1.2.2.1.18                     ifOutNUcastPkts                                      LEAF  Counter32
1.3.6.1.2.1.2.2.1.19                     ifOutDiscards                                        LEAF  Counter32
1.3.6.1.2.1.2.2.1.20                     ifOutErrors                                          LEAF  Counter32
1.3.6.1.2.1.2.2.1.21                     ifOutQLen                                            LEAF  Gauge32
1.3.6.1.2.1.2.2.1.22                     ifSpecific                                           LEAF  OBJECT IDENTIFIER

ifXTable
1.3.6.1.2.1.31                           ifMIB                                                NODE
1.3.6.1.2.1.31.1                         ifMIBObjects                                         NODE
1.3.6.1.2.1.31.1.1                       ifXTable                                             NODE
1.3.6.1.2.1.31.1.1.1                     ifXEntry                                             NODE
1.3.6.1.2.1.31.1.1.1.1                   ifName                                               LEAF  DisplayString
1.3.6.1.2.1.31.1.1.1.2                   ifInMulticastPkts                                    LEAF  Counter32
1.3.6.1.2.1.31.1.1.1.3                   ifInBroadcastPkts                                    LEAF  Counter32
1.3.6.1.2.1.31.1.1.1.4                   ifOutMulticastPkts                                   LEAF  Counter32
1.3.6.1.2.1.31.1.1.1.5                   ifOutBroadcastPkts                                   LEAF  Counter32
1.3.6.1.2.1.31.1.1.1.6                   ifHCInOctets                                         LEAF  Counter64
1.3.6.1.2.1.31.1.1.1.7                   ifHCInUcastPkts                                      LEAF  Counter64
1.3.6.1.2.1.31.1.1.1.8                   ifHCInMulticastPkts                                  LEAF  Counter64
1.3.6.1.2.1.31.1.1.1.9                   ifHCInBroadcastPkts                                  LEAF  Counter64
1.3.6.1.2.1.31.1.1.1.10                  ifHCOutOctets                                        LEAF  Counter64
1.3.6.1.2.1.31.1.1.1.11                  ifHCOutUcastPkts                                     LEAF  Counter64
1.3.6.1.2.1.31.1.1.1.12                  ifHCOutMulticastPkts                                 LEAF  Counter64
1.3.6.1.2.1.31.1.1.1.13                  ifHCOutBroadcastPkts                                 LEAF  Counter64
1.3.6.1.2.1.31.1.1.1.14                  ifLinkUpDownTrapEnable                               LEAF  INTEGER
1.3.6.1.2.1.31.1.1.1.15                  ifHighSpeed                                          LEAF  Gauge32
1.3.6.1.2.1.31.1.1.1.16                  ifPromiscuousMode                                    LEAF  TruthValue
1.3.6.1.2.1.31.1.1.1.17                  ifConnectorPresent                                   LEAF  TruthValue
1.3.6.1.2.1.31.1.1.1.18                  ifAlias                                              LEAF  DisplayString
1.3.6.1.2.1.31.1.1.1.19                  ifCounterDiscontinuityTime                           LEAF  TimeStamp

3. Sample output by SnmpWalk
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.1.11
IF-MIB::ifIndex.11 = INTEGER: 11
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.2.11
IF-MIB::ifDescr.11 = STRING: ether11
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.3.11
IF-MIB::ifType.11 = INTEGER: ethernetCsmacd(6)
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.4.11
IF-MIB::ifMtu.11 = INTEGER: 1500
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.5.11
IF-MIB::ifSpeed.11 = Gauge32: 1000000000
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.6.11
IF-MIB::ifPhysAddress.11 = STRING: e4:8d:8c:2c:9c:c3
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.7.11
IF-MIB::ifAdminStatus.11 = INTEGER: up(1)
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.8.11
IF-MIB::ifOperStatus.11 = INTEGER: up(1)
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.9.11
IF-MIB::ifLastChange.11 = Timeticks: (0) 0:00:00.00
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.10.11
IF-MIB::ifInOctets.11 = Counter32: 3706009249
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.11.11
IF-MIB::ifInUcastPkts.11 = Counter32: 1239963861
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.12.11
IF-MIB::ifInNUcastPkts.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.13.11
IF-MIB::ifInDiscards.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.14.11
IF-MIB::ifInErrors.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.15.11
IF-MIB::ifInUnknownProtos.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.16.11
IF-MIB::ifOutOctets.11 = Counter32: 653051289
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.17.11
IF-MIB::ifOutUcastPkts.11 = Counter32: 3140684960
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.18.11
IF-MIB::ifOutNUcastPkts.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.19.11
IF-MIB::ifOutDiscards.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.20.11
IF-MIB::ifOutErrors.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.21.11
IF-MIB::ifOutQLen.11 = Gauge32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.22.11
IF-MIB::ifSpecific.11 = OID: SNMPv2-SMI::zeroDotZero
[root@TeguhLab data]#

[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.1.11
IF-MIB::ifName.11 = STRING: ether11
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.2.11
IF-MIB::ifInMulticastPkts.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.3.11
IF-MIB::ifInBroadcastPkts.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.4.11
IF-MIB::ifOutMulticastPkts.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.5.11
IF-MIB::ifOutBroadcastPkts.11 = Counter32: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.6.11
IF-MIB::ifHCInOctets.11 = Counter64: 115165116948198
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.7.11
IF-MIB::ifHCInUcastPkts.11 = Counter64: 95729601299
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.8.11
IF-MIB::ifHCInMulticastPkts.11 = Counter64: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.9.11
IF-MIB::ifHCInBroadcastPkts.11 = Counter64: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.10.11
IF-MIB::ifHCOutOctets.11 = Counter64: 33290985497085
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.11.11
IF-MIB::ifHCOutUcastPkts.11 = Counter64: 71860438708
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.12.11
IF-MIB::ifHCOutMulticastPkts.11 = Counter64: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.13.11
IF-MIB::ifHCOutBroadcastPkts.11 = Counter64: 0
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.14.11
IF-MIB::ifLinkUpDownTrapEnable.11 = No Such Instance currently exists at this OID
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.15.11
IF-MIB::ifHighSpeed.11 = Gauge32: 1000
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.16.11
IF-MIB::ifPromiscuousMode.11 = No Such Instance currently exists at this OID
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.17.11
IF-MIB::ifConnectorPresent.11 = No Such Instance currently exists at this OID
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.18.11
IF-MIB::ifAlias.11 = STRING: TO UNIVERSE
[root@TeguhLab data]# snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.19.11
IF-MIB::ifCounterDiscontinuityTime.11 = No more variables left in this MIB View (It is past the end of the MIB tree)
[root@TeguhLab data]#

4. Create bash script to runing sample output OID
[root@TeguhLab data]# cat allinterface.sh
echo " "
echo ".::: ifEntry counter 32 bit :::."
echo " "
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.1.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.2.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.3.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.4.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.5.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.6.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.7.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.8.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.9.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.10.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.11.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.12.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.13.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.14.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.15.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.16.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.17.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.18.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.19.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.20.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.21.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.2.2.1.22.11
echo " "
echo ".::: ifXEntry counter 64 bit :::."
echo " "
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.1.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.2.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.3.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.4.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.5.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.6.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.7.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.8.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.9.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.10.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.11.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.12.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.13.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.14.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.15.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.16.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.17.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.18.11
snmpwalk -v 2c -c public 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.19.11
[root@TeguhLab data]#


5. Running bash script to show output snmpwalk
[root@TeguhLab data]# ./allinterface.sh

.::: ifEntry counter 32 bit :::.

IF-MIB::ifIndex.11 = INTEGER: 11
IF-MIB::ifDescr.11 = STRING: ether11
IF-MIB::ifType.11 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifMtu.11 = INTEGER: 1500
IF-MIB::ifSpeed.11 = Gauge32: 1000000000
IF-MIB::ifPhysAddress.11 = STRING: e4:8d:8c:2c:9c:c3
IF-MIB::ifAdminStatus.11 = INTEGER: up(1)
IF-MIB::ifOperStatus.11 = INTEGER: up(1)
IF-MIB::ifLastChange.11 = Timeticks: (0) 0:00:00.00
IF-MIB::ifInOctets.11 = Counter32: 2584645437
IF-MIB::ifInUcastPkts.11 = Counter32: 1239091521
IF-MIB::ifInNUcastPkts.11 = Counter32: 0
IF-MIB::ifInDiscards.11 = Counter32: 0
IF-MIB::ifInErrors.11 = Counter32: 0
IF-MIB::ifInUnknownProtos.11 = Counter32: 0
IF-MIB::ifOutOctets.11 = Counter32: 570732626
IF-MIB::ifOutUcastPkts.11 = Counter32: 3140008380
IF-MIB::ifOutNUcastPkts.11 = Counter32: 0
IF-MIB::ifOutDiscards.11 = Counter32: 0
IF-MIB::ifOutErrors.11 = Counter32: 0
IF-MIB::ifOutQLen.11 = Gauge32: 0
IF-MIB::ifSpecific.11 = OID: SNMPv2-SMI::zeroDotZero

.::: ifXEntry counter 64 bit :::.

IF-MIB::ifName.11 = STRING: ether11
IF-MIB::ifInMulticastPkts.11 = Counter32: 0
IF-MIB::ifInBroadcastPkts.11 = Counter32: 0
IF-MIB::ifOutMulticastPkts.11 = Counter32: 0
IF-MIB::ifOutBroadcastPkts.11 = Counter32: 0
IF-MIB::ifHCInOctets.11 = Counter64: 115163549587375
IF-MIB::ifHCInUcastPkts.11 = Counter64: 95728377200
IF-MIB::ifHCInMulticastPkts.11 = Counter64: 0
IF-MIB::ifHCInBroadcastPkts.11 = Counter64: 0
IF-MIB::ifHCOutOctets.11 = Counter64: 33290862619295
IF-MIB::ifHCOutUcastPkts.11 = Counter64: 71859489278
IF-MIB::ifHCOutMulticastPkts.11 = Counter64: 0
IF-MIB::ifHCOutBroadcastPkts.11 = Counter64: 0
IF-MIB::ifLinkUpDownTrapEnable.11 = No Such Instance currently exists at this OID
IF-MIB::ifHighSpeed.11 = Gauge32: 1000
IF-MIB::ifPromiscuousMode.11 = No Such Instance currently exists at this OID
IF-MIB::ifConnectorPresent.11 = No Such Instance currently exists at this OID
IF-MIB::ifAlias.11 = STRING: TO UNIVERSE
IF-MIB::ifCounterDiscontinuityTime.11 = No more variables left in this MIB View (It is past the end of the MIB tree)
[root@TeguhLab data]#

No comments:

Post a Comment

Popular Posts