Skip to content

Latest commit

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

iftop

Use the power and speed of iftop to get flow rates and totals of traffic incident on a network device.

Note that the user running this process will need capture permissions on the specified device.

Examples of how this is typically done:

linux:

sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/iftop

macOS:

sudo chmod +r /dev/bpf*

Usage

constIftopParser=require('iftop');IftopParser.iftopPath="/usr/sbin/iftop";// only if iftop is not on the pathvariftop=newIftopParser("eth0");// set up error handleriftop.on('error',(e)=>{console.error(e);});// set up data handleriftop.on('data',(d)=>{console.log(d);});iftop.start();// optional manipulations after start() has been called (these are passed to iftop)iftop.toggleAggregateSrc();iftop.toggleAggregateDst();iftop.toggleDNSResolution();iftop.togglePortDisplay();

License

ISC

About

runs and parses iftop output into js objects

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages