wmnet -- network monitor for WindowMaker using kernel IP accounting
for Linux.  version 1.04

Jesse B. Off <joff@iastate.edu>  6/19/1998


This little program polls /proc/net/ip_acct and does a few things with
the data it gets.  It has small blinking lights for the rx and tx of ip
packets, a digital speedometer of your watched accounting rule's current
speed and neatest of all, a bar graph like xload et. al which has a
tx speed graph from bottom-up and rx speed graph from the top-down.
The speedometer keeps track of the current speed per second and shows
it in a color corresponding to which of rx or tx that has the highest
speed at the moment.  Also, the graph is drawn in a way that the highest
speed is drawn on top of the other while the other is in the background.
I tried to make the look similar to my other dock apps like wmmail
asclock, etc.  Depending on whether  you are running ppp or ethernet
connections, you should set the -x parameter to about 1.5 times the
high speed of your connection...  the default is 6000 which will be
stupid if you're on a ethernet line with a max of about 800 kb/sec.
I've found the best for an ethernet line is '-x 10000000 -l'  Having
the logarithmic scale lets you see any speed of traffic from a telnet
session to downloadeding something from across the hall at 600 kb/sec.

I tried to keep this is as small and efficient as possible CPU time on my
K5 PR100 with the default poll time of 25000 microseconds (1 microsecond
== 1 millionth of a second.)  is less than 20 seconds per 24 hours ;)
Which is less than even wmmixer uses for me.

You WILL need ip accounting in your kernel and at least two ip firewall
rules This version allows you to specify which accounting rule to watch
for tx and rx and you will have to enter them in ipfwadm.  Having a
facility in wmnet to do this would be pretty spiffy, but would take up
too much memory for my tastes.  So, if you don't want to fool around with
ipfwadm but want some generic rules that will work.  Put the following
two lines in your startup scripts.  (/etc/rc.d/rc.local on most systems)
in this order!

ipfwadm -A in -i -S 0.0.0.0/0 
ipfwadm -A out -i -D 0.0.0.0/0

You will be able then to use wmnet.  If the -T -R options are omitted,
wmnet defaults to watching the first two accounting rules.  rx as rule 1,
tx as rule 2.

In version 1.04 I have added (among others) the --promisc option.
This makes your IP accounting rules apply across the whole of your
network segment.  This could be useful for monitoring your whole subnet
traffic bandwidth.  However, using this option as a normal user requires
wmnet to be suid root, which is something many people dispise so it is
not suid by default.  To make wmnet suid, as root:

chmod u+s /usr/X11R6/bin/wmnet 

Please only do this if you need to.  I did write this program with it
possibly being suid in mind so I am fairly confident that this can be
suid without any security concerns. But then again, thats what they all
say ;-).  Read the code then judge for yourself if need be, I WONT have
it done automatically for you.

For those afterstep users out there using wmnet, you may have noticed that
when wmnet is swallowed, not the whole thing is visible.  This is due to
the afterstep wharf's inability to swallow a dock.app as large as wmnet.
(Sorry guys, theres nothing I can do about that!)  Theres supposedly an
unofficial patch around for afterstep that allows it to fully display,
consult your local afterstep guru in your neighborhood on the what
and where.


homepage for wmnet:
http://isufug.ee.iastate.edu/~joff/wmnet.html



TO INSTALL from tar.gz: 
tar xfzv wmnet-1.04.tar.gz 
cd wmnet-1.04 
xmkmf 
make 
strip wmnet 
make install
make install.man


Enjoy!

ideas/comments/bug reports -----> joff@iastate.edu
http://isufug.ee.iastate.edu/~joff/wmnet.html

