

Raging Paging Server Checking Program
by Alan Bowen, Summer-Fall 1995
Documentation

* * * * * * * *  
DISCLAIMER
Use of this software may send an extraordinary number of pages to your 
pager and could result in very high pager bills.   Furthermore, you must 
create a bindery user with a required password that has read access to 
your SYS:SYSTEM directory which may violate your security standards.  To 
use the time syncing features of this program, that user must be 
designated as a file server console operator.  You will need supervisor 
equivalent access to do this.  Please read this entire document.  Use 
this program entirely at your own risk.   
* * * * * * * * 

Email-Ware Registration
Please try out this program for thirty days.  If, at that time you wish
to continue using the servmon program, you must send email to one of the
addresses listed below including your name, company name, work phone
number, and return email address (if different from sending address).
You will receive a return email message including a registration number.

That is all that is required to register the product and continue using
it.  Note that this registration process does NOT make this program free
nor can you claim ownership.  Registration entitles you to a license to
use the program.   If you do not register the product, you must
discontinue use and delete all copies of the program.

If you require technical support, please register the program using the
described email-ware process.  You will receive information on how to
obtain technical support, which I must charge money for.  This program
has been an extremely rewarding experience (which also means time-
consuming) and since I already have a full time job, I cannot provide
the needed support without some compensation.

Please email registration requests or donation requests to ONE of the
following addresses:  abowen@lville.pvt.k12.nj.us, abowen@voicenet.com,
bowen@trenton.edu, or 72341.3167@compuserve.com.

Background

I originally wrote this software shortly after signing up for my first
alphanumeric beeper.  This software helped me to provide an
unprecedented level of service.  We would often know of server problems
before the users.  I can't say why we had so many server problems,
though.

Following is a very simplified description of how this program works:
1.	It tries to login to a specified server (with password).  If it
can't, it reports that server as being down.
2.	If the login was successful, then the program scans through the
system error log file looking for any new error messages.
3.	If new error messages exist and you have specified that you wish
to receive pages when that error message occurs, the program will send
you a page containing the server date and time of the error and the
error message.

Miscellaneous Information

The power of this program lies in what it can do for you, not in the
configuration program.  You won't find one.  Configuration is done using
plain ascii text files and your favorite text editor.  I recommend using
an old 386 computer with a large write back disk cache and 2400 bps
modem for the paging machine.  The disk cache will minimize the amount
of disk thrashing since the program updates data and log files
frequently.  It is not a good idea to run this program from a server
because if that server crashes you will receive pages stating that ALL
servers have crashed.  Since the servmon program has an internal
multitasking kernel, you shouldn't run the program under DesqView or
Windows 3.1.  Compatibility with Windows 95 has not yet been
established.  This program has been tested under OS/2 in a private,
virtual dos machine with success.  Also, you need to know the phone
number of your paging central computer and it must support the TAP ALPHA
protocol.

Two files (CHKSERV.DAT and PAGE.DAT) will be created and maintained by
the program containing frequently updated information.  Whenever you add
a pager or a server to the CHKSERV.INI or PAGER.INI file, you must
delete the corresponding DAT file.  It will be recreated the next time
SERVMON is executed.  Note that doing this will reset some counters,
such as total number of pages sent during that day/month.  Whenever the
CHKSERV.DAT file is recreated, you may receive pages from the error log
that are up to one hour old.  This requirement and behavior is leftover
from the debug/testing phase and may change in future versions.   A
third file (PAGES.DAT) exists only while there are pages queued for
sending.  You can safely delete this file when you wish to delete all
pending pages.

You'll find log files, PAGE and CHKSERV, with an extension of the
current date.  The first character of the extension will be the current
month, with the hex digits A, B, and C representing October, November,
and December respectively.  The second two digits are the current day.
New log files are created at midnight.  This facilitates the easiest
browsing of server & paging activity.

The Server Status Window contains a listing of servers as they are
checked for errors.  When the server name is displayed in green, all is
well.  When the color of that server name changes to yellow, a non-fatal
error has occurred (severity zero through four).  Red is reserved for
servers that are down or unreachable.  A blue server name is the server
currently being checked for errors.  This window provides a simple at-a-
glance status of all servers.

In your config.sys, a files setting of 40 or 50 should be sufficient.
If you get strange crash situations try a slightly larger setting.  You
may also want to load dos into high ram with himem.sys or other memory
manager to make more ram available for servmon.  I've successfully run
servmon to monitor 24 servers with all the network drivers in
conventional memory and only dos in high ram.

As for network drivers, you must use VLM drivers.  Note that servmon
knows nothing about NDS, so the user that you create on your servers for
error log checking must be a bindery object!  The VLM drivers have
different critical error handling & "no server found" routines.  You've
probably seen the NETX message "the next time your try to change to an
invalid drive, netx will try to attach to a server" or when a server
can't be found that NETX removes itself from memory.  These are two
situations that will cause servmon to report that all servers are down
because of the way NETX handles these situations.  VLMs, on the other
hand, are generally much more graceful.  The VLM redirector will load
even if no servers are present and doesn't report a failed login attempt
to a nonexistent server (via ncp) as a dos critical error.  So, install
VLMs whether or not you are running Netware 4.x and use the default
configuration.  You don't need to worry about bindery mode vs. NDS mode
or protocol bind statements in your net.cfg.

Quick Configuration

Pagers

The PAGE.INI file contains modem and pager configuration.  The included
sample PAGE.INI file contains all configuration settings and possible
combinations.  Here is a description of each line:

1.	# Comment
All lines beginning with a # sign are considered comments.

2.	[Config]
Denotes the start of the modem configuration section.

3.	Debug=0
Turns debug mode off.  Debug=1 will probably tell you more than you want
to know.

4.	Verbose=1
Turns verbose mode on.  Verbose mode will display the disposition of all
pages in the log file and in the paging status window.  It also provides
more information for each page (i.e. displays the message to be sent
instead of  just who the message is going to).

5.	ComPort=1
Comm port of your modem.  Should be 1, 2, 3, or 4.  Nonstandard comm
port settings are not supported at this time.

6.	BaudRate=300
Baud rate that you communicate at with your paging dispatch computer for
alphanumeric pages.  I recommend 300 or 1200 because the connection will
be established quicker than at a higher baud rate (the modems will train
less) and since the messages to be sent are usually less than 100
characters there is no benefit to a higher baud rate.

7.	Parity=Even
None, Even, Odd are supported.  Most paging dispatches use even parity.

8.	DataBits=7
Any number is supported here, but usually you will only use 7 or 8.
Note that if you are using even parity you will almost always use 7
databits and with no parity you will almost always use 8 data bits.

9.	StopBits=1
Any number is supported here, but you will usually only use 1.

10.	ModemInit=ATM1X4E0
Your modem init string.  The simpler the better.  The above string turns
the modem speaker on, displays the most advanced level of messages, and
does not echo characters back to the modem.  You MUST turn off character
echo (E0) for the paging software to work.

11.	PageRetries=3
The number of  times to retry sending a page that was not successful
before discarding it.

12.	InputTimeout=4
The number of seconds to wait for a response from the paging dispatch
computer before doing an internal retry.

13.	InternalRetries=4
The number of  times to retry "handshaking" with the dispatch computer.
InputTimeout and InternalRetries work together.  If  InputTimeout
seconds elapse, an internal counter is incremented until InternalRetries
is reached.  When InternalRetries is reached, PageRetries will be
incremented.  The InputTimeout and InternalRetries settings of 4 are
currently in use on a 386dx16 computer.  Don't change these settings
unless you are getting an unusual amount of unsuccessful pages.

14.	CycleUntilDone=0
This parameter is no longer used.

15.	ExitOnKeypress=1
This parameter is no longer used.

16.	Truncate=1
You will see further down that you can limit the number of characters
that a pager will receive per day or per month.  If Truncate is on,
messages that will exceed this limit will be truncated.  Otherwise, they
will be discarded.

17.	DailyLimits=0
Specifies to use daily (1) or monthly (0) limits for pagers.

18.	[Pagers]
This denotes the pager configuration section.

The following information is required to define a pager:
Name=usually the name of the pager owner
Type=Alpha, Numeric, TwoWay  - Specifies which type of pager this unit
is.
Delay=Seconds to wait for carrier for an alphanumec or TwoWay pager.
For a numeric pager this is the number of seconds to wait before sending
the numeric message.
Phone=Phone number of numeric pager, or central dispatch computer for
alphanumeric or two way pagers.  The central dispatch must support he
TAP protocol.
Pin=Pin number of alphanumeric or two way pager.  Skip this field for
numeric.
Daily=Daily limit in characters that an alphanumeric pager will receive,
or number of  pages that a two  way or numeric pager will receive.
Monthly=Monthly limit in characters that an alphanumeric pager will
receive, or number of pages that a two way or numeric pager will
receive.   If you're paying your own pager bill, you will appreciate
these options.  Note that only one of these limits is active.
Options=NoAsterisk.  SkyTel pagers use the asterisk key on the telephone
keypad as an abort signal while most other pager companies us the
asterisk key as a dash.  This setting will not use the asterisk key
while sending pages to this pager (numeric pagers only).

Please see the PAGE.INI file for examples of  these settings.

Servers

The CHKSERV.INI file contains configuration information for servers and
pager messages.  Here is a description of each setting:

1.	# - All lines beginning with a # sign are considered comments.

2.	Username=SERVMON
This is the netware user that you have created that will log in and
check the file server error log.  This user must have read and file scan
access to the SYS:SYSTEM directory of every server that you wish to
check.  You can also make this user a file server console operator if
you wish to use the time syncing features of this program.  The time
syncing features are not recommended for use with Netware 4.x since
these functions are a part of the operating system.  Use any suitable
username of your choice.

3.	Password=HELLO
Password for the username list above.  Use any suitable password of your
choice.

4.	Mapdrive=M
Drive letter to use for mapping to SYS:SYSTEM.

5.	Debug=0
Turning this option on will probably provide more information that you
want to know.

6.	Verbose=1
Verbose mode will provide much more information regarding the
disposition of server error messages & pages.  Turning off verbose mode
will keep the screen and log file a little neater, but I recommend the
"clutter mode".

7.	SyncDate=1
This option turns on the date and time synchronization feature.  On
Netware 3.x servers, there's no simple (read: cheap) way to keep all the
dates and times in sync across the network, especially around early
April and late October.  To use this option make the username in option
#2 a file server console operator (on every server) and turn the
SyncDate option on.  At approximately midnight every day the SERVMON
program will set the date and time on every server (that you've
configured the user in option #2 as a file server console operator ONLY)
to the current date and time of the machine that SERVMON is being run
from.  If you don't make the username in option #2 a file server console
operator then that server's date and time will not be updated.

8.	[Windows]
This section configures the SERVMON console windows.  Included in the
comments in CHKSERV.INI are the settings for colors and border
selection.  To arrive at the correct color number, simply add the chosen
foreground and backround number together.

9.	There are four windows that you can configure:  Console, Server
Status, Paging Window, and Server Log.  They are preconfigured so that
each occupies one quarter of the screen with a "liberal" color scheme.
Please feel free to modify these.  The format for the window settings
are:

window name, starting row, staring column, rows to occupy, columns to
occupy, color attribute to use in that window, color attribute for the
window border, border type

These settings must be one continuous line.  Please see the CHKSERV.INI
file for examples.

10.	[SeverityKeywords]
This section contains all of the server error messages that any pager
will ever receive.  These keywords are defined by a unique ID that is a
single printable character or letter.  This ID is used later to define
which pager will receive which exact error messages.  The format is as
follows:

A:  Terse/555,  X,  Y,  String 

A is the unique severity ID.  This can be any letter, number, or 
punctuation character. Terse is the message that will be sent to an 
alphanumeric pager in terse mode.  (Note that this terse/verbose mode is 
set per PAGER and has nothing to do with the verbose mode setting in the 
PAGER.INI or CHKSERV.INI config sections.)  In verbose mode, the 
alphanumeric pager will receive the entire error message from the server 
error log.  The `/' slash is a required delimiter.  The 555 is the 
message that will be sent to a numeric pager when this error condition 
exists.  A three digit numeric message is recommended (i.e. use 001 
instead of just 1).  X is the total number of times this error condition 
will be sent to a pager in Y seconds. 

For example, if you know a server will be down for maintenance, you 
wouldn't want to be paged once every ten minutes for an entire weekend.  
A more likely setting will be twice in twelve hours.  Note that these 
thresholds are set per server so that if server A is down for a day and
has already sent X pages in the Y time frame and then, suddenly, server 
B crashes you will receive X pages in the Y time frame for server B.  
These values are maintained seperately for each server.   

The String value is the group of words that denote this error condition 
in the server error log.  For example, "Bindery Open Requested by the 
SERVER" (without quotes) would be a group of words that denote a server 
just being booted and the bindery just opened.  You'll find six settings 
that should always be defined, denoted by keyword ID's 0 through 5.  
Every Netware error message contains a severity level of from zero 
through four.   Five is used when a server is down.   Using the string 
search method, you can customize any alert condition that may arise on 
your server.

Please see the CHKSERV.INI file for more examples.

11.	[Pagers]
This section defines what pager will receive what severity messages 
(defined in section #10) and when the pager is considered active.  I've
been footing my own pager bill for some time, so it's my decision to not 
be paged at 3AM and this is the section where you set that up.

A sample pager description line is:

Pager Name, Type, Severity Ids, Sun, Mon, Tue, Wed, Thu, Fri, Sat, 
Option1, Option2

Pager Name is the name of the pager as defined in the PAGE.INI file.  If 
these names are not identical, you will never receive a page.  Type is 
either alphanumeric or numeric.  Note the omission of a two way type.  
This setting controls the type of message that is going to be sent to 
your pager, not the type of pager you have.  So, you could define a 
numeric type for your alphanumeric pager so that you only receive 
numeric error messages.  I don't know why you'd want to do this, but you 
can.  Sorry, no way to configure it the other way around.    

Severity Ids contain a listing of all the severity ids you want to 
receive on your pager.  Sun through Sat provides a section for you to
define when your pager will be considered active.  You won't ever
receive a page from the server checking program if your pager is not in
the active list.  Option1 allows you to define terse or verbose mode for
your pager.  Remember, terse mode will only send the severity id keyword
(the word just before the slash) to your pager while verbose mode will
include the entire server error log message.  Option2 can be asterisk or
noasterisk and tells the program to use the asterisk character as a dash
to offset the severity number on numeric pagers only.

Okay, that's a lot to swallow.  Here's an example:

Alan's Pager, Alpha, ABC, 99-99, 07-23, 07-23, 07-23, 07-23, 07-24, 07-
24, Terse

My pager name is "Alan's Pager" and much match exactly my pager setup in
the PAGE.INI file.  Alpha is the type of message I will receive on my
pager.  ABC is the listing of severity ids I wish to receive.  I will
receive severity ids of A, B, and C.  These are defined in section #10.
Note that I will only ever receive Ids of type A, B, or C.  Next, we see
what times my pager is considered active, starting with Sunday when my
pager is never active (99-99).  An invalid starting time will render a
pager inactive for that entire day.  For Monday through Thursday, my
pager is active from 7AM to11PM.  Note that on Friday and Saturday my
pager is active from 7AM to Midnight (24 is valid for midnight only in
the second, or "until", time slot).

Next, we see that I've elected Terse mode so that I will only be sent
the single identifying word of the error message, rather than the entire
message from the error log.  The noasterisk/asterisk setting does not
apply to my alphanumeric pager setting.

12.	[Servers]

Finally, the entire reason for this program:  servers.   You must supply
the server name, a substitute numeric description for the server, the
frequency to check for errors, and whom to page when errors arise.

A more detailed explanation is:

Server/Numeric Description,  Frequency (seconds):  Pager/Severity Ids,
PagerN/Severity IDs

It's a good idea to use the phone number nearest the server for the
numeric description to help minimize confusion.   If I were responsible
for a server named SHIPWRECK, a sample configuration would be:

SHIPWRECK/5555, 120:  Alan's Pager/ABC5X

This tells us that, for alpha pagers, any error message will contain the
server name SHIPWRECK.  A numeric pager will receive the message 5555.
Every 120 seconds the server checking program will log into this server
and look for errors.   Error messages corresponding to severity ids A,
B, C, 5, and X will be sent to Alan's Pager.   Using the sample pager
configuration from section #11, we can see that I only want to receive
error messages corresponding to severity ids A, B, and C.  Thus, any
error message of 5 or X will be discarded for my pager.  For a certain
error message to be sent to a pager, the severity ids must be both in
the pager list on the server description line and in the pager
configuration section (section #11).

This is a feature, not a bug.

One day at work, we were concerned that someone had snarfed the rconsole
password.  We had defined severity ids to send a page when someone uses
the RCONSOLE utility to remotely access a file server console and added
that severity id to every pager list in the [Pagers] configuration
(section #11), but did not add it to any pager list in the [Server]
configuration (section #12).  On a typical day no one would ever receive
a message about rconsole.  Now, we could quickly and easily add it to
every pager for any or all servers and immediately receive alerts.  (And
our fears were unfounded).  You could also configure it the other way,
where all severity ids are listed in every pager list in the [Server]
section and then add the id to the pager config in the [Pagers] section,
but then you'd receive a message from every server instead of select
ones.  But, hey, that's up to you.

Running Servmon

Simply load the appropriate network drivers, followed by servmon.
That's it.  It's also a good idea to copy castoff to the local hard
drive and run "castoff all" to prevent extraneous error messages from
halting the servmon program.  The quickest way to get up and running is
to replace my name with yours, input your pager number & pin (if
applicable), add your server names, and create the servmon username of
your choice.

Type "help" in the console window for complete information on the
program commands.  Good luck and I hope you enjoy your experience with
servmon.  I look forward to hearing from you.  Please send me your
impressions and comments.

Alan  Bowen
November 17, 1995

