1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
Copyright (C) 1996 Luis Falcon (lfalcon@csun.edu)
( Freeware. Please read LICENSE for more information ).
*****************************************************************************
"netload" is an application that displays the network load for different
devices. It uses ncurses to display the information, and the use of a
gauge to show the network load.
It shows the absolute load, relative load, and other statistics,
as well as the maximum load on the system so far.
The way to run it is simple :
netload device [-t secs]
where the device is the name of your NIC, ppp, etc.. as shown in ifconfig.
Typical names are "ppp0" "eth0" or "lo" (the later is for localhost).
The -t flag reprensents the refresh rate of the application. The default is
1 second.
NOTE:
I made this program using a 28.8 modem and a regular ethernet. The way I checked
for maximum load was by using "ping -f" with the two devices, aswell as for
localhost. This would give me a rough estimate on how many packets/seconds each
device was able to send/receive in a second. This number would be used to
control the behavior of the "gauge" that represents grahically the load.
This means that there's a factor to avoid overflowing such gauge. In the case
of the modem, I used a factor of 2, and for the rest (lo, and ehternet), I
used a factor of 20.
If you have a faster NIC, or ISDN modem, etc.. you might want to increase
the values in the following lines (in defaults.h). This are
the default :
#define PPP 2 /* factor fot a regular 28.8 modem */
#define ETHER 20 /* factor for the ethernet 10Mbs */
Bear in mind that the load gauge is of size 48 chars. From this point on,
you can do your math ;-)
***************************************************************************
Just fiddle with this only if you know what you're doing, and if it's really
necessary to change the original values. Otherwise, leave it alone.
****************************************************************************
ok, with that said...let me explain the colors of the gauge
white : low load
green : moderate load
magenta : high load ( red wasn't very clear...)
OK, that's about it.
Remember that this is a Beta version, so you might
(most certainly) find bugs..
Please send comments and bugs to lfalcon@csun.edu.
or check for "guanche" in the IRC ;-)
Luis.
|