You are not logged in.

#1 2004-05-23 22:58:16

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

traffic - network traffic analyzer for console

Just PKGBUILD for a nice network traffic monitoring tool that served me very well so far:

pkgname=traffic-devel
pkgver=0.1rc3
pkgrel=1
pkgdesc="Network traffic analyzer for console"
url="http://darkzone.ma.cx/resources/unix/traffic/index.php"
depends=('ncurses' 'libpcap')
makedepends=('sed')
source=(http://darkzone.ma.cx/resources/unix/traffic/traffic-current.tar.gz)
md5sums=('b427c393f2b0202d0188af07b4a1c02c')

build() {
  cd $startdir/src/traffic-current
  ./configure --prefix=/usr
  sed -i "511,548s/$/\n\/g" $startdir/src/traffic-current/src/show_stats.c
  sed -i "31,50s/$/\n\/g" $startdir/src/traffic-current/src/routines.c
  make || return 1
  make prefix=$startdir/pkg/usr install
}

The pkgbuild needs some explanation:
I called this traffic-devel because I used traffic-current version. There are other releases but they are too old IMO. The last current version is dated December 14th 2003 (check traffic homepage for details). I also set pkgver=0.1rc3 because that's how traffic-current reports it's version (traffic -v).
I had some problems with compiling it with gcc 3.4 - it reported some syntax errors (you now it's more strict now - it doesn't accept multiline strings without n at the end of each line). This is why I put sed lines in the PKGBUILD. So be careful with compiling it with newer current sources - it may require changing line numbers before s (or you can change sed starting and ending address to regular expressions instead of line numbers).
This my favourite set of traffic options:

traffic -c xxx.xxx.xxx.0/24 -i eth0 -r 1 -u KB -U MB -t -C hMct -s t

Replace xxx.xxx.xxx with the ip of the network you want to monitor. There are more interesting options and combinations (like output to text log which you could place on your webpage) - read traffic manpage.

Offline

#2 2004-05-27 11:13:05

Loki|muh
Member
Registered: 2004-05-25
Posts: 17

Re: traffic - network traffic analyzer for console

[root@sucker traffic-devel]# makepkg
==> Making package: traffic-devel  (Thu May 27 13:12:32 CEST 2004)
==> Checking Runtime Dependencies...
==> Missing Dependencies:
==> 
requires: libpcap 
==>

where can I find libcap?

pacman -Ss libcap returns no matching result... sad

Offline

#3 2004-05-27 11:26:04

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: traffic - network traffic analyzer for console

It's libpcap not libcap that's why you can't find it. And libpcap is in current repo: http://www.archlinux.org/packages.php?id=3636

Offline

#4 2004-05-27 11:31:10

Loki|muh
Member
Registered: 2004-05-25
Posts: 17

Re: traffic - network traffic analyzer for console

uh my fault sad

thx, now its working smile

Offline

#5 2004-07-29 20:57:12

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: traffic - network traffic analyzer for console

update: new current sources do not require patching to compile with new gcc

pkgname=traffic-devel
pkgver=0.1rc3
pkgrel=1
pkgdesc="Network traffic analyzer for console"
url="http://darkzone.ma.cx/resources/unix/traffic/index.php"
depends=('ncurses' 'libpcap')
source=(http://darkzone.ma.cx/resources/unix/traffic/traffic-current.tar.gz)
md5sums=('a9b8fa60692766b337cbd39ccc2ac21c')

build() {
  cd $startdir/src/traffic-current
  ./configure --prefix=/usr
  make || return 1
  make prefix=$startdir/pkg/usr install
}

and some options changed a little too (read traffic manpage for details and change C hMct -s t to C hMcs -s s if you are using this syntax - the symbol for total colum is now s not t).
BTW if you want to see how this works here are two screenshots from traffic author page:
http://darkzone.ma.cx/resources/unix/tr … nshot1.jpg
http://darkzone.ma.cx/resources/unix/tr … nshot2.jpg

Offline

#6 2004-07-30 01:11:34

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: traffic - network traffic analyzer for console

nice tool! thanks 8)

Offline

#7 2004-08-02 01:06:28

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: traffic - network traffic analyzer for console

hmm, i had to reinstall, and it seems that darkzone.ma.cx is no longer up. do you have an alternate location?

Offline

#8 2004-08-03 00:42:43

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: traffic - network traffic analyzer for console

You are right - darkzone site is down for the moment :-(. I couldn't find any mirror for newest sources. I could find only older (Dec 2003) version mirror.

You can download the sources from this site http://www.lanrat.webpark.pl/traffic-current.tar.gz I uploaded sources form my cache to this temporary place (please save it somewhere because I don't know what is the limit, etc. for this site - it's really temporary :-))

Offline

#9 2004-08-03 00:53:15

slackhack
Member
Registered: 2004-06-30
Posts: 738

Re: traffic - network traffic analyzer for console

okay, i 've got it, thanks a lot. smile when darkzone comes back online again or you get a hold of the newer version let me know, i could mirror it. it's really a nice monitor.

Offline

Board footer

Powered by FluxBB