

ISDNbar - a simple tool to monitor ISDN activities under Linux/X11.

(c) 1997 Florian Kalhammer - f.kalhammer@t-online.de

Last updated Oct. 26 1997


---------------------------------------------------------------------------
INTRODUCTION:

  When I was starting to use ISDN as an network interface (with i4l), I
  needed to have a program to watch the channel activities. While working
  with X11, I used isdnmon (a tcl/tk script) for that purpose. But using
  this program wastes a lot of CPU time, my xosview showed nearly 50 % CPU
  usage while isdnmon was working. On the other hand, there is a tty-based
  program named imon, which works fine without too much CPU time. I started
  to think about a possibility to bring both together, a tck/tk script
  without wasted CPU usage...

  First I had to write the tcl scripts to listen at the /dev/isdninfo
  device.  It seemed to work fine and I thought it would be no problem to
  fit it with a simple tk based output. But after I had written the
  tk-script, my program worked the same way as isdnmon, wasting CPU time...

  The reason for this huge amount of processor time was simply the
  architecture of tk itself. There are a lots of events to bind widgets with
  but there is no way for an endless loop in the background. (OK, I don't
  know the way for that. Perhaps there is a way but the author of isdnmon
  didn't know it, too) The only way to do this loop is the tcl-command
  "after", which waites a particular amount of milliseconds before the next
  loop.  Unfortunately this command needs lot of CPU time, the devil knows
  why...

  Thinking about an other way to solve the problem I read the book of John
  Ousterhout again and found the way how tk-scripts can communicate with
  each other. So I wrote a simple tcl-script which scans the /dev/isdninfo
  device only to check any changes there. If it recognizes any change, it
  sends a message to the tk script to rescan the device. This way there is
  not any loop in the tk script, only a new procedure called update, which
  is called from the tcl script.

  So there are two programs, one called isdnbar (the tk script) to display
  ISDN usage and the other called isdnwatch to scan the device. That brought
  up the next problem, killing the program means killing both programs. So I
  added an exit button to the display, which cleans both programs properly. 
  Adding the button I decided to add another one to open a xterm witch
  displays the /var/log/messages file (using tail -f).

HOW IT WORKS:

  The program works very simular like isdnmon. There are two (for the
  moment) lines with information about the ISDN-channels. Instead of the
  red, yellow and green textfields in isdnmon, I placed red, green and
  yellow led-images on the screen. Red means outgoing call is online, yellow
  means outgoing call not yet online or incoming call, and green means no
  activity on the channel.  

  I placed two buttons on the screen, one to exit the programm (and of
  course the isdnwatch, too) the other opens a xterm with a 

    tail -f /var/log/messages

  command. This is usefull to watch the isdn-messages from syslogd. You can
  change the filename to tail in the configuration section at the beginning
  of isdnbar.

  There are a few things to look at, before the program will work fine:

  - Using the "send" command with tk is a serious security problem, every
    tk-script could send commands to our program. So tk forces to use xauth
    authentication instead of host-based security. Isdnbar needs this
    feature, so it will only work with X11-Servers using the xauth security.
    (The simplest way to get this is to use the X-Display-Manager instead of
    startx and to disable any xhost commands...)

  - I included no way to configure the program with external config-files, so
    you have to change the location of the files inside the script if you don't 
    like the default ones. By default the two program-files are located in
    /usr/local/bin, the icon files reside in /usr/local/lib/isdnbar. It is 
    realy important for isndbar to know the location of isdnwatch because
    isdnwatch is invoked by isdnbar...

  - For the beginning I thought it would be enough to have two ISDN channels,
    (one card) because the layout of the window would be strange with more. 
    In future releases I will change this...

  - It is not possible to use more than one isdnbar at a time. OK, I think
    that is no major problem, who would want to do this... The reason is
    simple, the isdnwatch program would not know to witch isdnbar it should
    send its command. So if you try to have more than one isdnbars, the first
    one is the only one witch will be working.


COPYRIGHT/COPYING:

  The programs of this work can be freely redistributed and/or modified
  under the terms of the GNU General Public License as published by the Free
  Software Foundation; either version 2, or (at your option) any later
  version. I would be pleasured by getting any response of people who use
  the program. 

  This package is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  for more details. (File: COPYING)

  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  675 Mass Ave, Cambridge, MA 02139, USA.
 

INSTALLATION:

  The program uses the following files:

  - isdnbar		the main tcl/tk script. Call this program to start
			isdnbar. 
  - isdnwatch		The watchdog to recognize any changes in
			/dev/isdninfo. This program is invoked by isdnbar.
  - led_gruen.gif	the green,
  - led_gelb.gif	yellow
  - led_rot.gif		and red LED images
  - file.gif		the file-button to start and stop the
			/var/log/messages display.
  - exit.gif		the exit-button.

  The both program files reside in /usr/local/bin (by default - you can
  change this in isdnbar). The images should be found in a directory called 
  /usr/local/lib/isdnbar. You can change this too. 

  There is a Makefile, so you can install all files simple with a 

  make install

  I wrote the program using tcl7.6 and tk4.2. After getting the tcl/tk
  package 8.0b2 I tried to run it and it worked fine without any problems.

  Please send any bug-reports to f.kalhammer@t-online.de

  Have a lot of fun

    
			  




     
               



