Hi,
As we can now receive bytes in and out 0ver SNMP, how correctly calculate bit/per second from received data?
I found very easy calculation method:
We can calculate the throughput of an interface using this technique:
take a sample of the total bytes-in, wait 60 seconds and take another sample bytes-in total.
TotalByteIn [t = 0s] is total bytes-in after 0 seconds
TotalByteIn [t = 60s] is total bytes-in after 60 second
The average throughput in this time interval is calculated using this formula (the value is Bps)
(TotalByteIn [t = 60s] - TotalByteIn [t = 0s]) / 60 = Throughput
So 60 here - time in seconds, delay between request of SNMP information. Question - how easier store previous data to calculate BPS (I need received value - last one or previous, or other variant - now and next value after 60 seconds).
I tried resident script with time 0, not working but strange - in log showing TX1 and TX2 the same values, but BPS different (in my case I receiving SNMP data every 10 seconds)..
TX1 = grp.getvalue('38/5/22')
log('TX1', TX1)
os.sleep(10)
TX2 = grp.getvalue('38/5/22')
log('TX2', TX2)
BPS = (TX2-TX1)/10
log('BPS', BPS)
How better calculate BPS??
BR,
Alex
As we can now receive bytes in and out 0ver SNMP, how correctly calculate bit/per second from received data?
I found very easy calculation method:
We can calculate the throughput of an interface using this technique:
take a sample of the total bytes-in, wait 60 seconds and take another sample bytes-in total.
TotalByteIn [t = 0s] is total bytes-in after 0 seconds
TotalByteIn [t = 60s] is total bytes-in after 60 second
The average throughput in this time interval is calculated using this formula (the value is Bps)
(TotalByteIn [t = 60s] - TotalByteIn [t = 0s]) / 60 = Throughput
So 60 here - time in seconds, delay between request of SNMP information. Question - how easier store previous data to calculate BPS (I need received value - last one or previous, or other variant - now and next value after 60 seconds).
I tried resident script with time 0, not working but strange - in log showing TX1 and TX2 the same values, but BPS different (in my case I receiving SNMP data every 10 seconds)..
TX1 = grp.getvalue('38/5/22')
log('TX1', TX1)
os.sleep(10)
TX2 = grp.getvalue('38/5/22')
log('TX2', TX2)
BPS = (TX2-TX1)/10
log('BPS', BPS)
How better calculate BPS??
BR,
Alex