Calculating Ipkts and Opkts into bytes

Bruce M Simpson bms at spc.org
Wed Mar 31 11:13:49 BST 2004


On Wed, Mar 31, 2004 at 10:50:33AM +0100, Lee Brotherston wrote:
> You can't calculate number of bytes directly from the number of
> packets, as not all packets are the same size.  However if the email
> is generated using "netstat -i" (which is what that looks like) ...
> try using "netstat -ib" which also prints bytes in and out :)

Both the octet and packet counters are maintained as part of struct ifnet;
net-snmp will export both as part of the if mib.

Tools such as trafd and bpft can maintain statistics on a per-host basis.
I have some stuff in my local tree which will export trafd stats via a
custom SNMP MIB.

Regards,
BMS




More information about the Ukfreebsd mailing list