• Stars
    star
    2,761
  • Rank 16,495 (Top 0.4 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created about 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Linux 'net top' tool

Nethogs

Build Status

Introduction

NetHogs is a small 'net top' tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process.

screenshot

NetHogs does not rely on a special kernel module to be loaded. If there's suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. This makes it easy to identify programs that have gone wild and are suddenly taking up your bandwidth.

Since NetHogs heavily relies on /proc, most features are only available on Linux. NetHogs can be built on Mac OS X and FreeBSD, but it will only show connections, not processes.

Status

Nethogs is a mature piece of software included in most Linux distributions.

Ideas for features, as well as open bugs, can be found on issues' label:enhancement.

Downloading

You can clone this repo or get a source release from https://github.com/raboof/nethogs/releases

Building from source

Nethogs depends on ncurses for the text-based interface and libpcap for user-level packet capture. So you need to install both development libraries before building nethogs.

Debian/Ubuntu

apt-get install build-essential libncurses5-dev libpcap-dev

Yum-based distro's

yum install gcc-c++ libpcap-devel.x86_64 libpcap.x86_64 "ncurses*"

Getting the source

The master branch is intended to be stable at all times:

git clone https://github.com/raboof/nethogs

Building

After that, simply

make
sudo ./src/nethogs

Installing

For all distributions
sudo make install
hash -r
sudo nethogs
On Debian
sudo apt-get install checkinstall
sudo checkinstall -D make install
sudo dpkg -i nethogs*.deb
On Arch Linux
sudo pacman -S nethogs

Upgrading

When upgrading (or downgrading), you can simply install the new version 'over' the old one.

Uninstalling

If you want to remove Nethogs from your system, you can:

sudo make uninstall

Running without root

In order to be run by a non-root user, nethogs needs the cap_net_admin and cap_net_raw capabilities; additionally, to read and display process names, cap_dac_read_search and cap_sys_ptrace capabilities are required. These can be set on the executable by using the setcap command, as follows:

sudo setcap "cap_net_admin,cap_net_raw,cap_dac_read_search,cap_sys_ptrace+pe" /usr/local/sbin/nethogs

Coding standards

We use the LLVM coding standards, with the exception that we do allow 'return' after 'else' if it makes the code more readable.

Note to contributors: feel free to request more exceptions and we'll list them here.

Not all code currently adheres to this standard. Pull requests fixing style are welcome, and do write new code in the proper style, but please do not mix style fixes and new functionality in one pull request.

When writing new code, at least run 'make format' to have clang-format fix some superficial style aspects.

libnethogs

Apart from the 'nethogs' tool, this codebase now also builds as a 'libnethogs' library. This is highly experimental, and we expect to break source and binary compatibility while we look for the right abstraction points. Packaging libnethogs as an independent package is currently discouraged, as the chance of different applications successfully using the same libnethogs are slim.

Build it with make libnethogs, install with make install_lib or make install_dev.

libnethogs is being used in https://github.com/mb-gh/gnethogs

links

Nethogs monitors traffic going to/from a machine, per process. Other tools rather monitor what kind of traffic travels to, from or through a machine, etcetera. I'll try to link to such tools here. By all means open an issue/PR if you know another:

  • nettop shows packet types, sorts by either size or number of packets.
  • ettercap is a network sniffer/interceptor/logger for ethernet
  • darkstat breaks down traffic by host, protocol, etc. Geared towards analysing traffic gathered over a longer period, rather than `live' viewing.
  • iftop shows network traffic by service and host
  • ifstat shows network traffic by interface in a vmstat/iostat-like manner
  • gnethogs GTK-based GUI (work-in-progress)
  • nethogs-qt Qt-based GUI
  • hogwatch A bandwidth monitor(per process) with graphs for desktop/web.
  • iptraf-ng is a console-based network monitoring program for Linux that displays information about IP traffic.
  • nettop (by Emanuele Oriani) is a simple process/network usage report for Linux.
  • iptstate is a top-like interface to your netfilter connection-tracking table.
  • flowtop is a top-like netfilter connection tracking tool.
  • BusyTasks is a Java-based app using top, iotop and nethogs as backend.
  • bandwhich is a terminal bandwidth utilization tool.
  • sniffer is a modern alternative network traffic sniffer.

License

Copyright 2004-2005, 2008, 2010-2012, 2015 Arnout Engelen [email protected] License: nethogs may be redistributed under the terms of the GPLv2 or any later version. See the COPYING file for the license text.

More Repositories

1

notion

Tiling tabbed window manager
C
269
star
2

realtimeconfigquickscan

Linux configuration checker for systems to be used for real-time audio
Perl
257
star
3

dualfisheye2equirectangular

Convert 'dual-fisheye' 360 image material to equirectangular mapping
C
113
star
4

sfarkxtc

Basic sfArk decompressor
C++
92
star
5

sfArkLib

Original library for SoundFont compression
C++
83
star
6

connbeat

Agent exposing connection-related information, based on the Elastic Beats framework
Go
55
star
7

beats-output-http

HTTP output producer for the Elastic Beats framework
Go
44
star
8

zshprof

zsh script profiling
OCaml
40
star
9

sbt-reproducible-builds

Make your published artifacts bit-by-bit reproducible, and compare with other certifications
Scala
31
star
10

serverless-wiki

A wiki that tries to require as little logic on the server as possible
Python
18
star
11

todo-backend-akka

www.todobackend.com implementation based on scala, akka-http and akka-persistence
Scala
16
star
12

xrandr

xrandr improvements
C
10
star
13

todo-backend-ocaml

OCaml
9
star
14

reszoom

Chrome extension to automatically adjust page zoom settings based on screen resolution
JavaScript
9
star
15

learnyouacity

Game to teach yourself where the streets of a city are, web/OSM-based
JavaScript
9
star
16

akka-http-backpressure

Slides and code for reactive streams, backpressure, akka streams and akka http talk
Java
6
star
17

akka-grpc-intro-video

Scala
6
star
18

ewd

Presenting Edsger W. Dijkstra's writings in a more appealing way
HTML
6
star
19

unsfark

DEPRECATED - use https://github.com/raboof/sfArkXTm to uncompress sfArk files instead
C
4
star
20

xfce4-panel

from git://git.xfce.org/xfce/xfce4-panel
C
4
star
21

auditcalltree

Dispatcher for the Linux auditd that shows the process hierarchy leading up to the process performing the audited action.
C
4
star
22

akka-grpc-http-video

Scala
4
star
23

scala-icalendar

icalendar (RFC5545) library for scala
Scala
4
star
24

debbugs

Debian BTS
Perl
3
star
25

notion-doc

Documentation for the 'notion' project
TeX
3
star
26

SHA2017Game

Game played at SHA2017 using the electronic badge
Python
3
star
27

jack_interposer

Library to check at run-time whether an application makes non-RT-safe calls inside JACK's process() callback
C
3
star
28

alsa-midi-latency-test

alsa midi latency test
C
3
star
29

reproducible-builds-jvm-stripper

Library to make your JVM artifacts byte-for-byte reproducible.
Java
2
star
30

AlgoScore

graphical environment for algorithmic composition
C
2
star
31

supybot

Python
2
star
32

xf86-video-nouveau

xorg nouveau nvidia driver
C
2
star
33

xmltv2ical

Automatically exported from code.google.com/p/xmltv2ical
Scala
1
star
34

spray-json-on-scala3

Using spray-json from a scala3 project
Scala
1
star
35

linux-debugging-tools-zine-print

Preparing Julia Evans' "Linux debugging tools you'll love" zine for print
Makefile
1
star
36

fitnesse-meetup-slimtables

Examples for using various FitNesse SliM table types
Java
1
star
37

github-ticker.js

JavaScript
1
star
38

treeview

Display a plaintext tree (like output from xwininfo -tree, lsusb -v, lspci -v, etc) in an easy-to-browse manner
Haskell
1
star
39

nix-TSDZ2-Smart-EBike-1

Nix derivation for building TSDZ2-Smart-EBike-1
Nix
1
star
40

vormenstoof

silly language
Scala
1
star
41

ectrace

Trace a Scala ExecutionContext
Scala
1
star
42

leveldb-http

Expose LevelDB through a HTTP interface
JavaScript
1
star
43

hacker-hotel-reproducible-builds-talk

Slides for the Reproducible Builds talk at Hacker Hotel 2019
CSS
1
star
44

cloudflow-grpc-experiment

experimenting with using cloudflow and gRPC together
Scala
1
star
45

akka-blocking-dispatcher

demo code for blocking dispatcher instructions
Scala
1
star
46

mastodon-bot-nix

resources to help package mastodon-bot into a nixos image
Makefile
1
star
47

pitch-match-ear-trainer

'pitch match' ear trainer game
Elm
1
star
48

akka-actor-metrics

Scala
1
star
49

reproduce-akka-http-2851

(so far failed) attempt to reproduce https://github.com/akka/akka-http/pull/2851
Scala
1
star