I have configured the bandwidth Utilization with the below formula, data i am getting after snmpwalk.
Utilization = ( ifinOctect * 8 * 100 ) /( ifspeed * delta_time )
now i want to know if what is the unit of output of this command.
snmp
I have configured the bandwidth Utilization with the below formula, data i am getting after snmpwalk.
Utilization = ( ifinOctect * 8 * 100 ) /( ifspeed * delta_time )
now i want to know if what is the unit of output of this command.
Best Answer
RFC2863 defines IF-MIB and has a clear explanation on what
ifInOctets
andifSpeed
(paragraph 3.1.7) is:I would however not use
ifInOctets
on modern devices. Since these are 32-bits counters you're running a high risk of a counter wrap (reaching max-int) before you've read it. When available (and any modern device should have it)ifHCInOctets
is of more use since it uses a 64-bit counter:Looking at your calculation:
Your calculation seems to be an attempt to determine the link utilisation as a percentage. However, the way you describe it does not work.
ifInOctets
is an absolute number for the total of octets which were received. There's no notion of time there.To determine link utilisation you would have to take two measurements (the increase in received packets). By dividing that by the time difference
delta_time
you get the average number of packets/sec in the measured time interval. Multiply that by 8 to convert octets into bits. If you divide that result by theifSpeed
(which is in bits/sec) you get a fraction representing the interface utilisation. Finally multiplying it by 100 would give you a percentage.So if
ifInOctet1
andifInOctet2
are two consecutive measurementstime_delta
apart in time, the calculation would be:Utilization = ((ifInOctet2 - ifInOctet1) * 8 / delta_time) / ifSpeed * 100