Troubleshooting Scripts Using DEVICE.LOG

Windows NT allows you to log all information passed between RAS, the modem, and the remote device, including errors reported by the remote device. This allows you to find errors that prevent your scripts from working.

The DEVICE.LOG file is created by enabling logging in the Registry. The DEVICE.LOG file is in the systemroot\SYSTEM32\RAS directory.

To create the DEVICE.LOG file

1. Hang up any connections, and then exit from Remote Access.

2. Start the Registry Editor by running the REGEDT32.EXE program.

3. Locate HKEY_LOCAL_MACHINE, and then access the following key:
\SYSTEM\CurrentControlSet\Services\RasMan\Parameters

4. Change the value of the Logging parameter to 1. When changed, the parameter should look like this:

Logging:REG_DWORD:0x1

5. Close the Registry Editor.

Logging begins when you restart Remote Access or start the Remote Access Server service (if your computer is receiving calls). You do not need to shut down and restart Windows NT.

After you dial a number and connect, a script will start. If an error is encountered during script execution, execution halts. You should exit RAS, and then determine the problem by using any text editor to view DEVICE.LOG. The following topic is an example of an incomplete script that failed and the DEVICE.LOG file created when a connection was attempted.

Note

The traces from all calls will be appended to DEVICE.LOG as long as RAS or the Remote Access Server service are not stopped and restarted. So, if you need to save a DEVICE.LOG file with useful information for later review or troubleshooting, make a copy of the file, giving the file another name before you restart RAS or the Remote Access Server service.

Example of an Incomplete SWITCH.INF Script

The following script is incomplete for the service to which the user tried to connect. This script was used with DEVICE.LOG to discover that the remote computer expected additional commands from the script. See the sample DEVICE.LOG for the complete output that was generated.


[Gibraltar Net Login for MariaG]
; FIRST COMMAND TO INITIALIZE REMOTE COMPUTER
COMMAND=

; Skip to login prompt. That is, loop through blocks of text
; separated by 2-second gaps until the login prompt is encountered.
OK=<match>"Login:"
LOOP=<ignore>

; Provide username to remote computer
COMMAND=MariaG<cr>

; Since no 2-second gap is present, immediately match "Password:"
OK=<match>"Password:"

; Provide password to remote computer
COMMAND=mUs3naB

Sample DEVICE.LOG

This is the DEVICE.LOG file created by using the sample generic script. Note that DEVICE.LOG comment lines in all uppercase letters are writer comments added after the file was created to help you understand the contents of the file.


Remote Access Service Device Log 08/23/1996 13:52:21
---------------------------------------------------------------
; THIS SECTION IS THE COMMUNICATION BETWEEN RAS AND THE MODEM
Port:COM1 Command to Device:AT&F&C1&D2 W2\G0\J0\V1 S0=0 S2=128 S7=55 Port:COM1 Echo from Device :AT&F&C1&D2 W2\G0\J0\V1 S0=0 S2=128 S7=55 Port:COM1 Response from Device:
OK
Port:COM1 Command to Device:AT\Q3\N7%C0M1 Port:COM1 Echo from Device :AT\Q3\N7%C0M1 Port:COM1 Response from Device:
OK
; COMMAND TO DIAL REMOTE COMPUTER AND SUCCESSFUL CONNECTION Port:COM1 Command to Device:ATDT1 206 555 5500 Port:COM1 Echo from Device :ATDT1 206 555 5500 Port:COM1 Response from Device:
CONNECT 14400/REL
Port:COM1 Connect BPS:19200
Port:COM1 Carrier BPS:14400
; INITIAL NULL COMMAND SENT TO DEVICE Port:COM1 Command to Device:
Port:COM1 Response from Device:
_[2J_[H
Welcome to Gibraltar Net, a service of: Trey Computing, Inc.

Problems logging in? Call us at 555-5500 between 8:00am and 8:00pm Mon-Sat.

NOTE: Your software must support VT100 (or higher) terminal emulation!

Port:COM1 Response from Device:P
; THE LINE ABOVE INDICATES A TWO-SECOND GAP IN THE MIDDLE
; OF THE WORD "PLEASE" IF YOUR SCRIPT FAILED AND DEVICE.LOG ENDED
; AFTER THE RESPONSE ABOVE, YOU WOULD ACCOUNT FOR THIS
; TWO-SECOND GAP IN YOUR SCRIPT BY USING A NULL COMMAND= LINE OR THE
; OK=response AND LOOP=<match> COMBINATION. Port:COM1 Response from Device:lease turn OFF your Caps Lock if it is on now.

Please enter your login name and password at the prompts below.
- Log in as "guest" to take a look around the system.
- Log in as "new" to create an account for yourself.
Login:
; SEND YOUR USERNAME AS A COMMAND Port:COM1 Command to Device:MariaG Port:COM1 Echo from Device :MariaG Port:COM1 Response from Device:
Password:
; SEND YOUR PASSWORD AS A COMMAND Port:COM1 Command to Device: mUs3naB Port:COM1 Echo from Device : mUs3naB ; THE LOGIN SEQUENCE CONTINUES ON THE REMOTE COMPUTER ; BUT THE SCRIPT DOES NOT CONTINUE FROM HERE. ; THE AUTOMATED LOG IN WOULD FAIL AT THIS POINT. Port:COM1 Response from Device:

This script would be complete for many remote computers, but the remote computer sent more responses and expected a command to start a service. To complete the script you must know the remainder of the responses from the remote computer. If you logged on manually using RAS Terminal and found the remainder of the logon sequence looked like this:


Gibraltar Net offers you several network services:

Service ---------------------------------------------------------------------- SHell
UPload
DOwnload
PAssword
PPP
SLIP

Please enter a service:

you would complete the script with these lines:

COMMAND=<cr>
OK=<match>"Please enter a service:"
LOOP=<ignore>

If you added the lines above to your script, restarted RAS and redialed, you would successfully connect.

If the generic script in RAS does not work, these guidelines should help you modify the generic script to work for your connections. It is suggested you first copy the generic script to the end of SWITCH.INF, then modify the copy to work with your connections.