home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Troubleshooting Netware Systems
/
CSTRIAL0196.BIN
/
attach
/
pcc
/
v08n03
/
netwrk.exe
/
NETSCAN1.ZIP
/
NET_SCAN.TXT
< prev
Wrap
Text File
|
1993-11-03
|
12KB
|
269 lines
NET_SCAN : Network integrity checking package
---------------------------------------------
Copyright (c) Jean-Albert FERREZ (11.93)
╔══════════════════════════════════════════════════╗
║ This package is shareware. ║
║ ║
║ This package is provided "as is". There is no ║
║ warranty of any kind associated with the package ║
║ ║
║ You are free to distribute the whole unmodified ║
║ package as long as you don't charge more than ║
║ the usual small fee for handling and shipping. ║
║ ║
║ You are free to test it for one month, but if ║
║ you want to use it or include it in any product, ║
║ you have to register. Price and address follow. ║
╚══════════════════════════════════════════════════╝
The package includes the following files :
NET_SCAN.TXT : This text
NET_SCAN.EXE : Scanning TSR
NET_LOCK.COM : Lock-that-file TSR
The purpose of this package is to have a permanent scanning of a
network in order to be informed as early as possible of problems such
as :
- Terminal having been switched off
- Network cable having been pulled out
It is especially useful for terminals with no human activity.
Let's take the example given by the following network :
Front office Back office
╔════════════╗
║ terminal 1 ╟───────┐
╚════════════╝ │
╔══╧═══════╗ ╔════════════╗
║ server ╟─────────────────────╢ terminal S ║
╚══╤═══════╝ ╚════════════╝
╔════════════╗ │
║ terminal 2 ╟───────┘
╚════════════╝
On terminal S runs a background program without any user intervention.
At least one person is always present at either terminal 1 or 2.
We need a way to warn these people if terminal S looses connection
with the server, either because the cable has been pulled out or the
terminal has broken down or any other problem that the terminal can
neither detect nor take care of itself.
One possible solution is a permanent exchange of data between the
server and terminal S, detecting any unexpected end of communication.
The major drawback of this solution is that it requires a non-
negligible amount of network resources, both in terms of bandwidth and
server performance. (Other solutions might be offered by specific
network functions, but we wanted to have something that would run on
just anything, see Requirements below).
The idea
========
The idea behind NET_SCAN is to have terminal S open-and-lock a file on
the server and keep it open as long as it is running properly. Any
problem including abnormal program termination, terminal switching off
or cable cutting will cause the file to be unlocked by the server
after a few seconds. Therefore, all that is needed is to regularly
check from any other terminal if that file is accessible or not. If it
is not, everything is running properly, but if the file is accessible,
it is very likely that something has gone wrong. In the latter case,
just pop up a box with the hotline phone number or whatever. This
solution saves server performance and reduces network activity to a
minimum. The frequency for the check depends on how critical the
application on terminal S is, but this can usually be set to a couple
of minutes or even more.
All that is fairly easy to hardcode in your application, especially on
terminal S but a much smarter approach is to leave the job to a
background TSR-based routine that you just load at start-up and forget
about. This is highly preferable when front office people are likely
to use several applications. This is what the two programs NET_SCAN
and NET_LOCK have been written for.
NET_LOCK
========
NET_LOCK runs on terminal S. At start up, it takes from the command
line the full path of a file to open and lock. If the file does not
exist, it tries creates one with a zero-length. It then has to become
resident, because DOS automatically closes (and unlocks) any open file
when a program terminates, but stays inactive. The memory required by
that TSR is about 500 bytes. In addition, it can be loaded in high
memory.
For example, if a server's drive is locally available as drive S:
and the NET_SCAN package is in the C:\NET_SCAN\ directory,
you can include the following line in terminal S's AUTOEXEC.BAT :
C:\NET_SCAN\NET_LOCK.COM S:\NET_SCAN.SCN
As stated before, network-based application developers are very likely
to dismiss that TSR and include the open-and-lock process at the
beginning of their program, allowing them an extra possibility : just
unlock the file if you want the people to be aware of a difficult
situation although the terminal is physically OK. Examples of these
situations are buffer overflows or lost of serial connection with
whatever-you-want-including-coffee-machine...
NET_SCAN
========
NET_SCAN runs on any user-accessed terminal. This includes the server,
although it is neither required nor advised. (The server should
actually never run user application). It works on any station
independently from other stations. You have two strategies : install
it everywhere, increasing the chances for at least one person to be
warned, or install it only on the supervisor's terminal who is anyhow
the only person able to deal with the problem so why disturb other
people ? Once again the answer to that relies on how critical terminal
S is. However, NET_SCAN will keep popping up the warning message as
long as the situation has not been normalised (read: as long as the
file remains unlocked) so it doesn't really matter if the first
warning comes up while the whole office is having coffee.
To install NET_SCAN either from the command line or from AUTOEXEC.BAT
or from NETSTART.BAT or whatever, you have to give the full path of
the file which has to be checked. You will be warned if that file
either is not locked (it is likely that terminal S is already in
trouble) or does not exist (some mistake in the path name ?). You may
also specify as second parameter the frequency of the check in
seconds, which is otherwise set to 600 (i.e. 10 minutes). If you do
this, you may then give as third parameter the time during which the
warning box will be displayed. The terminal is locked while that box
is on screen but you can also remove it by pressing CTRL-ENTER. The
default is here 20 seconds.
Once NET_SCAN has been successfully installed, no sign of its presence
is visible as long as the file is locked. If during one check the file
happens to be unlocked, then a red box with a configurable message
pops up and locks the terminal until either the user presses CTRL-
ENTER, acknowledging the message, or 20 seconds (or whatever time you
have specified) have passed. That time limit is here to avoid long-
time lock-up in case of a lengthy user-less process such as background
printing or automatic file backup. It is however possible for the user
to make sure that NET_SCAN is installed and that terminal S is running
properly by pressing CTRL-ALT-T. If the file is not locked, you get
the same red box as usual, but if the file is locked you get a
reassuring green box with another configurable message telling you
everything is OK.
To go on with the example, provided the server's drive is still S:
the following line goes in AUTOEXEC.BAT on any terminal :
C:\NET_SCAN\NET_SCAN.EXE S:\NET_SCAN.SCN 600 10
This will scan every ten minutes on drive S: (ie on the server) for
the file NET_SCAN.SCN in the root directory. If any box is to be
displayed, it will remain at most ten seconds on the screen.
The Messages
============
The messages in the two boxes are hard-coded in the NET_SCAN.EXE file
avoiding the need for a configuration file which give - as you know -
a good opportunity for an end-user to smash the beautiful environment
you had set up for him. You can still modify these messages with Norton
or other similar HEX editors BUT MAKE A BACKUP OF THE ORIGINAL FILE !!
If you prefer a safer approach, we have a nice INSTALL program to do
the job. Please contact us.
Requirements
============
These programs will work on any PC with DOS 3.0 or above and SHARE.EXE
loaded. They do run on a single PC but only make sense on a network.
The nice detail about them is that they don't require any specific
network but just some way to read and write to a remote machine's hard
disk.
History and future developments
===============================
NET_SCAN was designed for the needs of the telephone logging program
we wrote as part of the Hotel Management System being developed here
at HotSoft in the marvellous resort of Verbier. Then we thought that
other people out there in the fog might have been facing the same
problem and decided to release it.
Although the programs might be improved for our own needs, it is not
likely that future versions will be publicly available. To get them,
you'll have to register. We may even consider writing a special
version for your needs. Contact us and we'll see if you can afford
it...
Disclaimer
==========
These programs have been tested and are currently being used by our
customers. That said, since TSR are by definition a possible cause of
trouble on a twelve years old OS and since you paid so little to have
them, we don't assume any responsibility for any problem due to the
use of these programs.
The name of HotSoft only appears here as an example of application
using NET_SCAN.
Known bugs
==========
With Lantastic (tm), after having run (and exited) Windows 3.1, the
box may not appear, eventually hanging up the computer. [Any technical
information about how Lantastic and Win deal with int 8h & 28h and the
indos flag would help.]
Registration
============
NET_SCAN is shareware. Anyone is granted the right to TEST NET_SCAN
for a period of one month. Anyone interested in USING NET_SCAN on a
network must first register. Anyone interested in INCLUDING NET_SCAN
as part of any product also has to register. Source code is also
available, feel free to ask.
Registration fee is US$ 20 (or 30 Swiss Francs), to be sent at the
following address :
Jean-Albert FERREZ
Route de Patier
CH-1936 VERBIER
(When registering please give E-mail address if any.)
Since we use NET_SCAN for our own needs, it will improve and by
registering you will receive the latest version. In particular,
NET_SCAN.EXE is being rewritten in assembler in order to cut its
memory requirements from 21K down to 2-3K
Should you have further questions about the package or related topics
please write at the same address or E-mail at ferrez@dma.epfl.ch
Addresses
=========
Jean-Albert FERREZ ferrez@dma.epfl.ch
Route de Patier on the InterNet
CH-1936 VERBIER
HotSoft Development [71540.2311]
Residence du Parc on CompuServe
CH-1936 VERBIER