PDA

Bekijk de volledige versie : how to set up IPTRAF on Asus



sodb
25-07-2004, 15:15
IPTRAF (see iptraf (http://cebu.mozcom.com/riker/iptraf/)) allows for monitoring traffic interactively. A few settings and a number of directories need to be set up in order to have it work on the ASUS:
Download mipsel iptraf package at distro.tar (http://home.comcast.net/~goody/distro.tar)

mirrored @ chupa.nl download it here:
http://files.wl500g.info/asus/wl500g/firmware/app/mipsel-iptraf.tar

Currently I boot system from USB and have the / filesystem mounted as rw, so I am flexibel in putting extra files within the original file structure. When you do not want that, use a USB fs to run programs from (/mnt/usbfs)

copy /etc/terminfo directory to root /etc/terminfo of asus
make the following dirs:

/tmp/var/log/iptraf
/tmp/var/run/iptraf
/tmp/var/local/iptraf

to store logging, locking and config files.

When files ar becoming large, make symbolic links to dirs on usb stick.

Create following environment variables:

TERMINFO = "/etc/terminfo" (or equivalent dir on /mnt/usbfs)
TERM="linux"

You can run iptraf interactively or in the backgorund (e.g. iptraf -d eth1 -B). Output can be shown using cgi-bin script of busybox_httpd deamon: e.g.


#!/bin/sh
echo "Content-type: text/html"
echo ""
echo "<html>"
echo "<title>IPTRAF output</title>"
echo "<body bgcolor="#5555aa">"
echo "<h1>iptraf output</h1>"
echo "<pre>"
cat /tmp/var/log/iptraf/iface_stats_detailed-eth1.log
echo "</pre>"
echo "</html>"

kfaessen
25-07-2004, 23:20
Doesn't work for me :( everything seems to be fine, but I get this:



/mnt/usbfs/distro # ./iptraf
Error opening terminal: linux.


I've set the variables and confirmed it with set.
I'm only not sure if the tmp dir is writable but I guess it is because i've created the directory's.

If I execute /mnt/usbfs/distro # ./iptraf -d eth1 -B, there is no output at the prompt (seems ok to me because it should be running in the background). Checking if it's running in the background with ps won't give the service in the list so it's NOT running in the background. :( Someone who can tell me what's wrong???. I'm using firmware release 1.7.5.9-3. Who can help me???

sodb
26-07-2004, 14:32
Seems that you still have the envornment variables not set properly. I used the export statement to set them, i.e., export TERMINFPO="/etc/terminfo" (inclusive the quotes). If set in a script file, include the call to iptraf within the script, otherwise the envirmonment variables will not be set.
The background option won't work when the /tmp/ directories used for logging and locking are not accessable by iptraf. Check write rights of the directrories. OS version should not be a problem.
good luck

kfaessen
26-07-2004, 17:35
Seems that you still have the envornment variables not set properly. I used the export statement to set them, i.e., export TERMINFPO="/etc/terminfo" (inclusive the quotes). If set in a script file, include the call to iptraf within the script, otherwise the envirmonment variables will not be set.
The background option won't work when the /tmp/ directories used for logging and locking are not accessable by iptraf. Check write rights of the directrories. OS version should not be a problem.
good luck

Ok i've made the temp dir's writable (silly me) and I've set the var's with the export command (i used just terminfo="/mnt/usbfs/distro/etc/terminfo" before) and it seems to work. The only problem I now have is the webserver started with "busybox_httpd -p 81" doesn't execute asp pages, it just displays them as html sites.

Styno
22-08-2004, 00:02
The only problem I now have is the webserver started with "busybox_httpd -p 81" doesn't execute asp pages, it just displays them as html sites.
Executing the cgi-bin script needs a special directory, see the following post for more info: http://wl500g.info/showpost.php?p=4377&postcount=17

Styno
22-08-2004, 15:46
I've setup iptraf successfully, but I'm having a problem with the logfiles:
Iptraf appends its traffic info to its logfile. Because of that the logfile keeps growing and ultimately the WL-500g will run out of RAM. To counter this problem the logfile has to be removed once in a while.

To delete the logfile one has to do the next steps:
1) rename the logfile
2) signal USR1 to iptraf to release the logfile
3) delete the renamed logfile
Iptraf will create a new logfile now.

My question is: how can I send USR 1 to iptraf with the kill command to iptraf?
I assume I have to do some sort of grep on ps somehow, but I can't figure that out (I'm not that experienced in Linux).

Miki
07-09-2004, 13:52
My question is: how can I send USR 1 to iptraf with the kill command to iptraf?
I assume I have to do some sort of grep on ps somehow, but I can't figure that out (I'm not that experienced in Linux).
The Asus firmware has the 'killall' command which allows you to send a signal to processes by name, so you can use:

killall -USR1 iptraf

--
Miki

pdbla
30-10-2004, 22:27
Pls a i am very sad :( , but i have also problem with running IPtraf on backround.
I tried set TERM and TERMINFO but i get the message : Your term variable is not set.

Pls, pls if exist somebody, who tell me step by step, what i have try. :eek:

Tks a lot

Styno
31-10-2004, 15:03
place these line in the shell script which starts iptraf:

export TERM="linux"
export TERMINFO="/mnt/usbfs/iptraf/etc/terminfo"

sodb
31-10-2004, 19:19
I installed iptraf in /mnt/usbfs/iptraf directory. Then I use the following script to activate iptraf:

start_iptraf

mkdir /tmp/var
mkdir /tmp/var/log
mkdir /tmp/var/run
mkdir /tmp/var/local
mkdir /tmp/var/log/iptraf
mkdir /tmp/var/run/iptraf
mkdir /tmp/var/local/iptraf
export TERMINFO="/mnt/usbfs/iptraf/etc/terminfo"
export TERM="linux"
./iptraf $1 $2 $3

Hope that works for you. The directories are needed for filtering, logging and keeiping track of run processes.

Viper_Jaro
28-12-2004, 23:22
hi i want to try iptraf, but icant install the iptraf.tar file. Can somebody help me?? I have tryed "tar -xvf iptraf.tar" but "tar: Invalid tar magic" :confused:

chupra
29-12-2004, 12:09
hi i want to try iptraf, but icant install the iptraf.tar file. Can somebody help me?? I have tryed "tar -xvf iptraf.tar" but "tar: Invalid tar magic"

Maybe the file is corrupted. The command is correct. Try redownloading the mirrored file from chupa.

Styno
30-12-2004, 08:39
Maybe you need a full tar (not the tar on WL-500g) of a normal Linux distribution. Or untar with Winzip or 7z....

hugo
30-12-2004, 11:05
you are on topic 666, so that's why it's not working :p

You can try to use a winzip or winrar to get the iptraf executable. It should deal with the compression format.

Otherwise, it mean your file is corrupted. You'll have to redownload it.

Try a file iptraf.tar on a linux box. It will tell you what format you really have

jago25_98
21-07-2005, 20:01
it's

tar xvf distro.tar (z = gunzip uncompress)

isn't export TERM="linux" broken? (doesn't find the linux term)i

byteZero
30-09-2005, 19:33
Could someone please advise if it is possible to install iptraf utility in the router's own memory instead of an external source ?

I'm running the latest Oleg's firmware, in a wl-500g.

Thank you.