From 347db30cb8e92ae91889757382bcaa0f07e2afe0 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Wed, 23 Apr 2014 17:51:14 +0200 Subject: [PATCH] nethogs: Add package nethogs is a small 'net top' tool, grouping bandwidth by process. --- pkgs/tools/networking/nethogs/default.nix | 36 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/tools/networking/nethogs/default.nix diff --git a/pkgs/tools/networking/nethogs/default.nix b/pkgs/tools/networking/nethogs/default.nix new file mode 100644 index 000000000000..9747dc587711 --- /dev/null +++ b/pkgs/tools/networking/nethogs/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchgit, ncurses, libpcap }: + +stdenv.mkDerivation rec { + name = "nethogs-${version}"; + + version = "0.8.1-git"; + + src = fetchgit { + url = git://github.com/raboof/nethogs.git; + rev = "f6f9e890ea731b8acdcb8906642afae4cd96baa8"; + sha256 = "0dj5sdyxdlssbnjbdf8k7x896m2zgyyg31g12dl5n6irqdrb5scf"; + }; + + buildInputs = [ ncurses libpcap ]; + + preConfigure = '' + substituteInPlace Makefile --replace "prefix := /usr/local" "prefix := $out" + ''; + + meta = with stdenv.lib; { + description = "A small 'net top' tool, grouping bandwidth by process"; + longDescription = '' + 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. 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. + ''; + license = licenses.gpl2Plus; + homepage = http://nethogs.sourceforge.net/; + platforms = platforms.linux; + maintainers = with maintainers; [ wizeman ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index de155d48cc44..b1c0d5118808 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1503,6 +1503,8 @@ let netcat-openbsd = callPackage ../tools/networking/netcat-openbsd { }; + nethogs = callPackage ../tools/networking/nethogs { }; + netkittftp = callPackage ../tools/networking/netkit/tftp { }; netpbm = callPackage ../tools/graphics/netpbm { };