Quicky iftop web page without luci

Time to give back! Many people are looking for a luci interface to iftop. Maybe someday.

For the time being, I have iftop dumping to a file in /www and then accessing the file via a web browser.

NOTE: You need to ssh into the router and it really helps to know just a few basics about the text editor vi. Both of which our out of the scope of this post.

This is my iftop config file (~/.iftoprc):

interface: br-lan
sort: 10s
line-display: one-line-both
hide-source: yes
max-bandwidth: 20M

NOTE: The line-display: is only taking affect for me when using curses (without -t option)

I put this script in a file I call "iftop2www":

#!/bin/sh
while true
do
  iftop -t -L 5 -s 60 > /www/iftop_1.txt
  mv -f /www/iftop_1.txt /www/iftop.txt
done

To make it executable:
chmod 700 iftop2www

then kick it off in the background with

./iftop2www &

then exit from the session.

The page is then accessed via your OpenWrt IP address/iftop.txt:
http://192.168.1.1/iftop.txt

It's been a great help since now the rest of my family can see what's slowing us down.

Is there a way to do this sort of thing right through luci?

Just place this to run in System > Scheduled Tasks.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.