Hello,
I'm writing an application that uses SNMP to retrieve some device data and to show the average bandwidth usage over a given period of time (like 5 minutes for example). The problem is that for some reason I can't get an accurate reading of the usage so either my calculations are off or the readings are off.
If it helps with something the application is written in PHP and the test was done on a Debian install.
Test procedure:
- did a reading via snmpwalk (doesn't matter if it's from command line or the application)
- run a test on speedtest.net (results were ~93Mbps on download)
- did a reading again via snmpwalk
Results: ~28MB/s inbound - done over a 100Mbps uplink (basically it's ~18MB/s over the maximum physical capabilities of the interface)
Note: The interval between the pools was 30 seconds.
The OID I used is 1.3.6.1.2.1.2.2.1.10 which corresponds to ifInOctets and the formula I used is: (ifInOctets(reading2) - ifInOctets(reading1)) * 8 / poolInterval.
Does anyone know why I get these results and not the actual usage?
I'm writing an application that uses SNMP to retrieve some device data and to show the average bandwidth usage over a given period of time (like 5 minutes for example). The problem is that for some reason I can't get an accurate reading of the usage so either my calculations are off or the readings are off.
If it helps with something the application is written in PHP and the test was done on a Debian install.
Test procedure:
- did a reading via snmpwalk (doesn't matter if it's from command line or the application)
- run a test on speedtest.net (results were ~93Mbps on download)
- did a reading again via snmpwalk
Results: ~28MB/s inbound - done over a 100Mbps uplink (basically it's ~18MB/s over the maximum physical capabilities of the interface)
Note: The interval between the pools was 30 seconds.
The OID I used is 1.3.6.1.2.1.2.2.1.10 which corresponds to ifInOctets and the formula I used is: (ifInOctets(reading2) - ifInOctets(reading1)) * 8 / poolInterval.
Does anyone know why I get these results and not the actual usage?