Skip to content

Linux utility for monitoring bandwidth consumption by process name

Notifications You must be signed in to change notification settings

AymenDaoudi/NeTraf

Repository files navigation

NeTraf

Linux utility for monitoring Bandwidth usage for TCP/UDP connections by process name.

Description

NeTraf is a linux application that helps you monitor the bandwidth consumption of a specific process. NeTraf is written in C# on .Net-Core and uses the following linux utilities : Netstat, IPTraf and Gnuplot.

Prerequisites

Make sur you have the following tools installed before running NeTraf :

  1. Netstat : this utility comes installed on some linux distributions. To install it (Debian/Ubuntu) : # apt-get install net-tools.

  2. IPTraf : Download and install this utility from here, then follow these steps to install it:

    I. Decompress the .tar.gz file by entering tar zxvf iptraf-x.y.z.tar.gz.

    II. If your tar doesn't support the z option, you can separately decompress the tar.gz then extract the resulting .tar archive. gunzip iptraf-x.y.z.tar.gz tar xvf iptraf-x.y.z.tar

    III. This will decompress the sources into a directory called iptraf-x.y.z.

    IV. x.y.z here should be the IPTraf version number you're installing, like 3.0.0.

    V. Change to the src directory. It already contains ready-to-run distribution binaries for IPTraf and the accompanying rvnamed daemon.

    VI. To install the software, enter : make install. while you are logged in as "root". This will install the distribution binary in the /usr/local/bin directory. The necessary working directory /var/local/iptraf will also be created.

    VII. Configure IPTraf correctly : a. Enable Logging : IPTraf > Configuration > Logging > On. b. Configure log interval : IPTraf > Configuration > Timers > Logging Interval > 1 mins

  3. GnuPlot : apt-get install gnuplot-qt.

  4. .Net Core : Get .Net Core and the toolings here.

Compilation and running

  1. Download the project here.

  2. Navigate to the project's location ../NeTraf.

  3. Enter dotnet restore to restore the Nuget dependencies.

  4. Enter dotnet run + args :

    i. 1st argument : Network interface name. ii. 2nd argument : Process name. iii. 3rd argument : Monitoring interval (in minutes). iv. 4th argument : Output directory. v. Example : dotnet run ens33 skype 15 ../Desktop/OutputResult.

    i. 1st argument : Network interface name.

    ii. 2nd argument : Process name.

    iii. 3rd argument : Monitoring interval (in minutes).

    iv. 4th argument : Output directory.

    v. Example : dotnet run ens33 skype 15 ../Desktop/OutputResult.

Results

Once the profiling is finished, navigate to the output file you precised in the beginning, there you'll find tow directories :

  1. RawOutput files : these contain csv formatted output files describing the input/output bytes, packets and rate.

  2. GraphicalOutput files : contain plots describing the input/output bytes, packets and rate, like follows :

alt text

License

This project is under the [Creative Commons Attribution NonCommercial NoDerivs (CC-NC-ND)] (https://tldrlegal.com/license/creative-commons-attribution-noncommercial-noderivs-(cc-nc-nd)#summary) fully described in the (c.f. License.txt) file.

CC-NC-ND

Releases

No releases published

Packages

No packages published

Languages