Although this won’t fit the original poster’s needs as he is looking to 
implement this functionally in software, the following works very well:

netstat -b -I <device>


On Jun 8, 2015, at 6:43 PM, Jeff Meegan <je...@frob.org> wrote:

> If all you want are counters, I’d probably just enable
> snmp on the host and periodically snmpget ifInOctets and ifOutOctets,
> etc.  http://www.net-snmp.org/docs/mibs/interfaces.html  has a good
> overview of the Interface MIB so you can see what kind of data you
> have access to.  This is pretty scriptable, too.
> 
> —j
> 
>> On Jun 8, 2015, at 3:36 PM, Peter Lovell <plov...@mac.com> wrote:
>> 
>> Another suggestion - see if you can find or borrow on old-style "ethernet 
>> hub". Not the more modern "switch" variety, but an old-fashioned hub - the 
>> kind that broadcast all traffic on all its ports. 
>> 
>> If you can get one of these then you can put your traffic-collector on a 
>> separate machine and that way the monitoring doesn't interfere with the 
>> activity.
>> 
>> Jeremy's recommendation of tcpdump/Wireshark is right on target.
>> 
>> Cheers.....Peter
>> 
>> 
>> Jeremy Thompson <jer...@warehousesports.com> wrote:
>> 
>>> There are a couple of things you will need to do whether you use tools
>>> to capture information or write your own code.  The device will need to
>>> have some sort of shell access and tools built in to packet capture.  If
>>> its a OS X, BSD, Linux machine you will be able to use tcpdump.  You can
>>> send that capture to a file and process with a tool.  I would recommend
>>> Wireshark.  Wireshark can capture as well but if the machine can't run
>>> it or doesn't have a gui you will need to capture and then process on
>>> your machine.  If the device is fairly locked down you'll need to mirror
>>> the switch port its connected to.  On the mirrored port you can use
>>> Wireshark, tcpdump, or your own code to do a capture.
>>> 
>>> --
>>> Jeremy Thompson
>>> Sports Warehouse Inc.
>>> jer...@warehousesports.com
>>> 
>>> 
>>> 
>>> 
>>> 
>>>> On Jun 8, 2015, at 1:35 PM, Fabian Jäger
>>> <fabian.jae...@chungwasoft.com> wrote:
>>>> 
>>>> Dear experts,
>>>> is it possible to monitor the inbound/outbound traffic of a particular
>>> network device? I would like to print some statistics and would need the
>>> byte/s information...
>>>> 
>>>> Best regards,
>>>> Fabian
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/macnetworkprog/jeremy
>>> %40warehousesports.com
>>>> 
>>>> This email sent to jer...@warehousesports.com
>>> 
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/macnetworkprog/plovell%40mac.com
>>> 
>>> This email sent to plov...@mac.com
>> 
>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/macnetworkprog/jeffm%40frob.org
>> 
>> This email sent to je...@frob.org
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/macnetworkprog/tpmarchand%40gmail.com
> 
> This email sent to tpmarch...@gmail.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to