To effectively administer a UNIX system consisting of
more than 100
users in five offices throughout most of New York State,
staff needed a way to have the system contact us in
the event of a
problem. The main need was for a system monitoring tool
to be used
in conjunction with our automated backup program. This
provide status pages at certain points in the process;
receiving a page at a certain point meant that there
was a problem.
We also needed to give end users a way to contact the
in the event of an emergency, since we're frequently
out of the office
providing training, performing installations, or problem
I wrote one shell script that allows the automated processes
systems staff in the event of a problem -- with backups,
disk space, etc. -- and one front-end script that allows
to contact either the staff members on call for that
day or a user-supplied
name. The second script prompts for the person to be
called and the
call-back number, and could be used to contact sales
tech support personnel, etc.The implementation uses existing hardware and software,
and also works under the bourne and korn shells.
The one significant disadvantage is that, since this
uses a table to store names and pager numbers, the names
this file must be unique.
Our system is a Dell 4066/XE running Interactive UNIX
v3.2 and Hayes
9600-baud modems. The uucp implementation is based on
System V w/HoneyDanBer or BNU uucp. The pager is a standard
Motorola Bravo Express numeric pager (Motorola Advisor
was also tested for the purpose of receiving a numeric
paging service has a standard procedure, whereby the
user dials the
pager number, waits to hear three beeps, enters the
number to be displayed
on the pager, and then hangs up.
The implementation requires that you modify two uucp
-- /usr/lib/uucp/Dialers and /usr/lib/uucp/Devices
-- and add five new files to your UNIX system. I placed
files under the /usr/local/bin directory. Figure 1
and Figure 2
are excerpts from the two uucp files, showing standard
and new additions with detailed explanations for the
To understand the overall implementation, it's useful
to first take
a look at how cu normally operates. By default, cu
wants to connect to another system; once the systems
interaction between them can take place. When the interaction
you issue a ~. and a carriage return to terminate the
session. When you are communicating with a paging service,
no other computer to connect with, so my implementation
for whether the paging service answered the phone or
a busy signal
was received. I use the modem's result codes and the
exit status code from the cu session to determine whether
the paging service call was successful.
Figure 1, the /usr/lib/uucp/Dialers file, shows the
entry I created for our modem to use with the cu session.
The chat script is very similar to the other entries
file, but there are some significant differences. The
modem code S7=10
specifies the number of seconds to wait for a carrier
the answering modem. Since the connection is not to
a modem, I set
this value to 10 seconds; if the rest of the proper
received within this time, the code exits the chat script.
The only other change is at the end of the chat script
where CARRIER is the expected result code. In reality,
only result codes possible here are NO CARRIER or BUSY.
If the result code is BUSY, the code tries again. If
code is NO CARRIER, it sends a BREAK command and exits
the cu process, which continues to get the rest of its
from the numpager script (Listing 1).
A modem result code of BUSY would cause the chat script
to exit with a status code of 1. A NO CARRIER result
code (which would mean that the paging service had answered
would cause the script to exit with a status code of
codes are what the numpager script looks for to determine
the next step in the process. Figure 2, the /usr/lib/uucp/Devices
file, shows the hayespag entry I created for our modem
use with the cu session. Specifying a speed setting,
on the cu line in the numpager script (Listing 1),
causes cu to search /usr/lib/uucp/Devices for an ACU
entry with a speed of 2400. This speed must be unique
for all ACU
references to ensure that the hayespag Dialers entry
selected. This speed must also be one that the modem
Listing 1, numpager, is the paging script that actually
the call. This script verifies that it has two parameters,
the first one to see if the page is for one of the on-call
and if so, replaces the variable $PAGPERSON with the
user's name. It then verifies that this person has a
valid entry in
the PAGER_LIST file. Using the UNIX expr command,
the script then does a quick addition of 1 to the error
number to make sure that the user has entered only numbers.
the script uses cu to place the call and check for a
error code return value -- otherwise, the phone number
Remember that the speed parameter used must be unique
to the ACU entries
in the /usr/lib/uucp/Devices file, and also must be
that the modem can deal with. Using cu in this way eliminates
the need for specific entries in the /usr/lib/uucp/Systems
file, which is what allows us to use a table-driven
of names and pager numbers.
Listing 2, syspage, is the front-end script to numpager.
syspage asks users who they want to page, allows them
the call-back number, and then executes the numpager
Listing 3 and Listing 4 are the one-line
entries in the files
for the on-call
personnel handling UNIX problems and PC-related problems.
have the following permissions:
owner = root, group = adm, mode = -rw-r--r--
Listing 5 is a sample of the pager list table, which
consists of names
and pager numbers, separated by tabs, with one line
per name. The
phone number has a "9-" prefix to allow for
local access on
our phone system, with a two-second delay for dial tone.
is interpreted by the entry in the /usr/lib/uucp/Dialers
This file has the following permissions:
owner = root, group = adm, mode = -rw-r--r--
To test the scripts once you've installed them, un-comment
line in numpager that includes the -d parameter just
before the speed setting. Insert a comment at the next
line (the cu
line that doesn't have the -d parameter). This will
you to see the diagnostics as the script runs. When
you have completed
testing, restore the comment to the first cu line and
the comment from the second.
There are two other changes that may be necessary:
You will need to add a termination character if your
pager service requires it. Some services require transmission
# after you have entered the call-back number. You can
this as the last character in the $PAGERCODE variable,
on the cu line in numpager.
These scripts have been extremely useful in monitoring
and beneficial to our users as a support tool. The performance
been excellent, and I have successfully transmitted
20-40 number sequences
through the paging service, primarily for testing purposes.
pages of 3 to 10 numbers have gone through without a
O'Reilly, Tim, and Grace Todino. Managing UUCP
and Usenet. Sebastopol, CA: O'Reilly & Associates,
1992. ISBN 0-937175-93-5.
About the Author
Mark McDonagh is the UNIX Systems Manager with the
Court, Northern District of New York. Mark has set up,
cabled, trained, supported, and written custom software
for the UNIX,
PC, and network environments for the past 15 years.
He can be reached