How to monitor per-port bandwidth using SNMP
Solution 1:
The table OID 1.3.6.1.2.1.2.2.1 contains all important network interfaces objects. You found the right objects ifInOctets
(1.3.6.1.2.1.2.2.1.10)/ifOutOctets
(1.3.6.1.2.1.2.2.1.16) for tracking received/transmitted octets to/from the interface. If you need to get such statistics per port you need to append an index of port to the table OID, e.g. 1.3.6.1.2.1.2.2.1.10
.1 for received octets of port 1 and 1.3.6.1.2.1.2.2.1.16
.1 for transmitted octets.
With such data, you are already able to calculate input/output utilization per port with simple formulas
(ifInOctets(time1) - ifInOctets(time2)) / (time2 - time1)
(ifOutOctets(time1) - ifOutOctets(time2)) / (time2 - time1)
You get received/transmitted octets per second as a result. You can either write your own script and to incorporate it in your monitoring tool or you can leverage 3rd party tools like Nagios, Cacti, Munin, Mrtg and so on to do such calculations automatically and present them in nice graphs.