SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

gnetload - distributed network load meter and control

Copyright 2001 Olaf Titz <olaf@bigred.inka.de>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This is a network load meter, much like "xisdnload" from the isdn4linux package, but it works in a distributed setup. It consists of two parts:
- an agent program (devstata) runs on the machine with the interface to be monitored and periodically sends status info over the network - a display program (gnetload) collects and displays this info. Both can run on the same machine, but they can also be used to report the state of a dedicated router on another workstation machine. The communication works by devstata sending UDP datagrams. Using a multicast or broadcast address, one devstata can even feed more than one instance of gnetload.

gnetload sees the device in one of the following states: - off: no data is received from devstata. - dormant: data is received, but contains no device info, i.e. the network device is not configured.
- active: data is received with device info. - dialling: ISDN line info is received indicating a call in progress. - connected: ISDN line info is received indicating an active connection.
The -I flag to gnetload determines in which way these states should be interpreted. Without the -I flag, a standard network device or a PPP device is assumed. The states are interpreted as: - off: machine is dead (default color red) - dormant: machine is alive, no connection (default color yellow) - active: connection is alive (default color green) - dialling, connected: ignored
With the -I flag, an ISDN device is assumed. Here the states are: - off: machine is dead (default color red) - dormant: ISDN device is not configured (default color red) - active: ISDN device is alive and ready for dial on demand, but not connected (default color yellow)
- dialling: ISDN device is dialling (default color dark-yellow) - connected: ISDN device is connected (default color green) For a non-ISDN PPP device, unfortunately it is not easily possible to report the state "ready for dial-on-demand". If the dial-on-demand is handled by another device (like with diald or rrouted), it will report the dormant state, i.e. yellow, so the colors have (roughly) the same meaning as with ISDN.

gnetload counts all reports in the packets sent by devstata. This may be more than one device.

The display of gnetload looks like this:

                    +-----------------------------+
             state->|  12345678         13:43:23  |<-time when last went online
 grand total data ->|     1432k            46:21  |<-current online time
      transferred   +-----------------------------+
                    |                             |
                    | --------*------------------ |<-area bg color shows state
                    |                            |
 incoming load (blue)-->     *                   |<-clicking here gives menu
                    | --***--***----------------- |
                    |   ****                ^----scale lines
 outgoing load (red)--->#*## #*               |
                    +-----------------------------+

"state" is blank for off, ".." for dormant, "**" for active, ISDN number for dialling and connected.

gnetload has the ability to spawn an external program from a pop-up menu. This can be used e.g. to bring devices up and down. The default menu contains the items "On", "Off", "Connect", "Disconnect" as appropriate for ISDN. The menu script gets the name of the selected item and the current state (0=off, 1=dormant, etc.) as parameters. See the sample menu script. While the script runs, the label on gnetload is shown in yellow background, and spawning another script is not possible. (The intended use for this feature is that gnetload can be put on an xdm login screen and allow to control the network without logging in.)

This is a Gtk+ application. It can optionally use gconf to set colors and the menu (which are hardcoded if not using gconf). The implementation of devstata is Linux-specific, gnetload should be portable.

No UI for gconf is provided in this version. The configuration items have to be set manually. The gconf keys are (all string type):

/apps/gnetload/menus

  • Popup menu items, separated with \n /apps/gnetload/colors/load/incoming
  • Bar color for incoming load /apps/gnetload/colors/load/outgoing
  • Bar color for outgoing load /apps/gnetload/colors/load/executing
  • Label background color when executing menu /apps/gnetload/colors/MODE/STATE
  • Panel background color for
    • MODE: one of netload, isdnload
    • STATE: one of off, dormant, active, dialling, connected

$Id: README,v 1.4 2002/10/11 17:00:37 olaf Exp $


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.