Skip to main content
Dongkwan
Staff
Staff
May 30, 2023

Technical Tip: How to calculate the SNMP OID value for current bandwidth

  • May 30, 2023
  • 0 replies
  • 4939 views
Description

This article describes how to calculate the current bandwidth value with the SNMP OID.

Scope

FortiGate, all firmware.

Solution

FortiGate does not currently provide SNMP OID values for bandwidth. However, there are 2 SNMP OIDs that can be used to get the number of bytes received/sent from/to a specific interface:


Name                   OID
ifInOctets     1.3.6.1.2.1.2.2.1.10

ifOutOctets  1.3.6.1.2.1.2.2.1.16

An exact value for bandwidth cannot be provided automatically as a result. FortiGate provides the byte count for each incoming/outgoing traffic. The amount of bytes collected over a specific period allows for calculation of the bandwidth consumed per second,

For example, when the number of bytes received on the interface with SNMP index 1, is queried (1.3.6.1.2.1.2.2.1.10.1), the value of 1052009935 is obtained. After one minute this counter is queried again and returns a value of 1053011878, to obtain the bandwidth of the last 60 seconds, the following calculation must be made:

bandwidth = (1053011878-1052009935)*8/60 = 133592.4 (133.6Kbps)

 

Most of SNMP Manager applications should use this SNMP OIDs for bandwidth graphing.
It is also possible to calculate the bandwidth usage by policy, below is SNMP MIB information related to policy bandwidth:

 

FgFwPolStatsEntry ::= SEQUENCE {

    fgFwPolID               FnIndex,

    fgFwPolPktCount         Counter32,

    fgFwPolByteCount        Counter32,

    fgFwPolLastUsed         DisplayString,

    fgFwPolPktCountHc       Counter64,

    fgFwPolByteCountHc      Counter64

}

    Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
    Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.