Wednesday, June 21, 2017

.::: Sample Calculate interface bandwidth utilization % Using IfSpeed, IfHighSpeed :::.

base on calculation bandwith utilization 32 bits and 64 bits.
http://teguhth.blogspot.co.id/2017/06/how-to-calculate-bandwidth-utilization.html
here as example calculation base on value snmpwalk/snmpget

Counter32 Bits
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

Counter64 Bits
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

Example Calculation

1. First find the interface unique ID based on ifName (1.3.6.1.2.1.31.1.1.1.1), ex:
   IF-MIB::ifName.11 = STRING: ether11  , Use the .11 above when searching for the ifInOctets OIDs below
[root@TEGUHLab data]# snmpwalk -v 2c -c teguht 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 teguht 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 teguht 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 teguht 10.10.10.10 .1.3.6.1.2.1.2.2.1.10.11
IF-MIB::ifInOctets.11 = Counter32: 1906417075
[root@TEGUHLab data]# snmpwalk -v 2c -c teguht 10.10.10.10 .1.3.6.1.2.1.2.2.1.16.11
IF-MIB::ifOutOctets.11 = Counter32: 2943830328
[root@TEGUHLab data]# snmpwalk -v 2c -c teguht 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 teguht 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 teguht 10.10.10.10 .1.3.6.1.2.1.31.1.1.1.15.11
IF-MIB::ifHighSpeed.11 = Gauge32: 1000

2. snmpwalk 1 :
[root@TEGUHLab data]# echo " snmpwalk 1"
 snmpwalk 1
[root@TEGUHLab data]# sh interfacetest.sh
IF-MIB::ifIndex.11 = INTEGER: 11
IF-MIB::ifDescr.11 = STRING: ether11
IF-MIB::ifSpeed.11 = Gauge32: 1000000000
IF-MIB::ifInOctets.11 = Counter32: 4050383104
IF-MIB::ifOutOctets.11 = Counter32: 2711729319
IF-MIB::ifAlias.11 = STRING: TO UNIVERSE
IF-MIB::ifName.11 = STRING: ether11
IF-MIB::ifHighSpeed.11 = Gauge32: 1000

3. snmpwalk 2 :
[root@TEGUHLab data]# echo " snmpwalk 2"
 snmpwalk 2
[root@TEGUHLab data]# sh interfacetest.sh
IF-MIB::ifIndex.11 = INTEGER: 11
IF-MIB::ifDescr.11 = STRING: ether11
IF-MIB::ifSpeed.11 = Gauge32: 1000000000
IF-MIB::ifInOctets.11 = Counter32: 4103953434
IF-MIB::ifOutOctets.11 = Counter32: 2716440431
IF-MIB::ifAlias.11 = STRING: TO UNIVERSE
IF-MIB::ifName.11 = STRING: ether11
IF-MIB::ifHighSpeed.11 = Gauge32: 1000

4. snmpwalk 3 :
[root@TEGUHLab data]# echo " snmpwalk 3"
 snmpwalk 3
[root@TEGUHLab data]# sh interfacetest.sh
IF-MIB::ifIndex.11 = INTEGER: 11
IF-MIB::ifDescr.11 = STRING: ether11
IF-MIB::ifSpeed.11 = Gauge32: 1000000000
IF-MIB::ifInOctets.11 = Counter32: 4154317732
IF-MIB::ifOutOctets.11 = Counter32: 2721188883
IF-MIB::ifAlias.11 = STRING: TO UNIVERSE
IF-MIB::ifName.11 = STRING: ether11
IF-MIB::ifHighSpeed.11 = Gauge32: 1000
[root@TEGUHLab data]#

5. Calculation Bandwith Input Output Utilization

Interface <= 1Giga Ethernet using 32bit

Input Utilization(%) = ((4103953434 - 4050383104) * 8 * 100)/1000000000
                    = 42,856264 %
Output Utilization(%) = ((2716440431 - 2711729319) * 8 * 100)/1000000000
                    = 3,7688896 %

Infosim Stablenet
Infosim Stablenet
Paessler Prtg
Paessler prtg
Manage Engine Opmanager

Manage Engine Opmanager
Manage Engine Opmanager

Manage Engine Opmanager

Cacti
Interface >= 10Giga Ethernet using 64bit(minimal 1 Mb Ethernet)
               

Input Utilization(%) = ((4103953434 - 4050383104) * 8 * 100)/(1000 * 10^6)
                    = 42,856264
Output Utilization(%) = ((2716440431 - 2711729319) * 8 * 100)/(1000 * 10^6)
                    = 3,7688896 %
Infosim Stablenet
Infosim Stablenet
Paessler Prtg
Paessler Prtg

Manage Engine Opmanager


Manage Engine Opmanager

Manage Engine Opmanager

Manage Engine Opmanager
Cacti

6. Note if ifInOctetsTn < ifInOctetsT1, not allowed and not calculated, ifInOctetsTn must be greater than ifInOctetsT1

7. Note if ifOutOctetsTn < ifOutOctetsTnT1, not allowed and not calculated, ifOutOctetsTn must be greater than ifOutOctetsT1

No comments:

Post a Comment

Popular Posts