RASLOG.TXT

This file contain 4 sections:
A. User Guide.
B. Registration Guide.
C. Requirement Notes.
D. Release Notes.

------------------------------------------------------------
A. User Guide.

"RAS Log" for Windows(R) NT reports login/logout events on a
Remote Access Server (RAS).  It filters the event log for 
login and logout events and report them.  It could also 
report general usage, port-based and user-based statistics.
It obtains the number of ports and the portnames from the 
RAS Admin for port-based statistics and tabulated listings.
It could be run either as a console or as a common gateway 
interface (CGI) program.

As a console program, it expects at least one argument which
is the offset in days from the last midnight.  With an 
offset of 0 (zero) the program will report all the login/
logout events since the last midnight ie today only.  With 
an offset of -1 the program will also report the previous 
day's login/logout events.  Running "raslog" on an RAS with
4 ports may produce a reports like:

  >raslog 0
  RAS Log
  Time     PORT   USER     ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1    login   1  0:10:05
  00:18:43 COM5   user2    login   2  0: 4:42
  00:23:25 COM4   user1    logout  1  0: 1:14
  00:24:39 COM5   user2    logout  0  8:45:15
  09:09:54 COM2   user3    login   1  0: 0:40
  09:10:34 COM2   user3    logout  0  0: 1:21
  09:11:55 COM3   user4    login   1  0: 7:02
  ...
  15:27:21 COM5   user3    login   1  0: 2:12
  15:29:33 COM5   user3    logout  0  2:51:03
  18:20:36 COM2   user4    login   1  0: 8:03
  18:28:39 COM2   user4    logout  0  0: 9:44
  18:38:23 COM3   user5    login   1  0: 1:00
  18:39:23 Ended.


Durations are reported in HH:MM:SS format - HH= hours, 
MM= minutes, SS= seconds.

The program can also report the events of another RAS 
computer if that computer's name is supplied as the 2nd 
argument in the "\\computername" format.  An example:

  >raslog 0 \\pc1
  RAS Log
  Time     PORT   USER     ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1    login   1  0:10:05
  00:18:43 COM5   user2    login   2  0: 4:42
  ...
  
  
A title can be placed in front of the title "RAS Log"
by supplying it as the 3rd argument to the program.  The default 
title can also be replaced by a 4th argument.  An example:

  >raslog 0 \\pc1 "User's Name"
  User's Name - RAS Log
  Time     PORT   USER     ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1    login   1  0:10:05
  00:18:43 COM5   user2    login   2  0: 4:42
  ...

  >raslog 0 \\pc1 "User's Name" "Log Report"
  User's Name - Log Report
  Time     PORT   USER     ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1    login   1  0:10:05
  00:18:43 COM5   user2    login   2  0: 4:42
  ...


By default, the report duration is from the midnight 
specified by the offset to the current time.  This duration
could be set via the "+dN" parameter where N is the report
duration in hours.  To set a duration of 1 hr, eg,:

  >raslog 0 +d1
  RAS Log
  Time     PORT   USER     ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1    login   1  0:10:05
  00:18:43 COM5   user2    login   2  0: 4:42
  00:23:25 COM4   user1    logout  1  0: 1:14
  00:24:39 COM5   user2    logout  0  8:45:15
  01:00:00 Ended.


The width of the user name's column could be set via the
parameter "+wN", where N is the width in characters subject
to a maximum of 20.  To set a width of 12, eg,:

  >raslog 0 +w12
  RAS Log
  Time     PORT   USER         ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1        login   1  0:10:05
  00:18:43 COM5   user2        login   2  0: 4:42
  ...


For the reported time's to be correct, the computer's time
zone setting and the environment variable TZ must be set.
By default, the TZ is set to Singapore's SGT-8 (GMT+8).
If it is inconvenient to set the TZ variable, it could be
specified via the "+z" parameter.  To set TZ for Eastern
Standard Time (GMT-5), eg,:

  >raslog 0 +zEST5EDT


A tabulated version of the event listing could be reported
via the parameter "+t".  It will, however, need to read the
number of ports and portnames from the RAS Admin and only 
members of the Administrator local group can successfully 
execute the functions.

  >raslog 0 +t
  RasAdminPortEnum: server result code=2123
  RasAdminPortEnum: Completed successfully
  RAS Log
  Time     COM2     COM3     COM4     COM5     NL Duration
  --- 18 Jan 1997 ---
  00:08:38                   user1              1  0:10:05
  00:18:43                   user1    user2     2  0: 4:42
  00:23:25                            user2     1  0: 1:14
  00:24:39                                      0  8:45:15
  09:09:54 user3                                1  0: 0:40
  09:10:34                                      0  0: 1:21
  09:11:55          user4                       1  0: 7:02
  ...
  15:27:21                            user3     1  0: 2:12
  15:29:33                                      0  2:51:03
  18:20:36 user4                                1  0: 8:03
  18:28:39                                      0  0: 9:44
  18:38:23          user5                       1  0: 1:05
  18:39:25 Ended.


General usage statistics could be reported by specifying the
"+g" parameter.

  >raslog 0 +g
  RAS Log
  Time     PORT   USER         ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1        login   1  0:10:05
  00:18:43 COM5   user2        login   2  0: 4:42
  ...


  General Statistics:
  Duration  =  18:38:23
    0 Lines =  16:34:43 ( 88.9%)
    1 Lines =   1:51:36 ( 10.0%)
    2 Lines =   0:12:04 (  1.1%)


Port-based usage statistics could be reported by specifying 
the "+p" parameter.  Like the tabulated listing, it will 
also need to read the information from the RAS Admin and 
only members of the Administrator local group can 
successfully execute the functions.

  >raslog 0 +p
  RAS Log
  Time     PORT   USER         ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1        login   1  0:10:05
  00:18:43 COM5   user2        login   2  0: 4:42
  ...


  Port-based Statistics:
  Port   Login  Duration
  COM2       6   1:18:40 (  9.0%)
  COM3       4   1: 9:57 (  8.0%)
  COM4       6   0:36:16 (  4.1%)
  COM5       7   0:42:33 (  4.9%)


User-based usage statistics could be reported by specifying 
the "+u" parameter.  

  >raslog 0 +u
  RAS Log
  Time     PORT   USER         ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1        login   1  0:10:05
  00:18:43 COM5   user2        login   2  0: 4:42
  ...


  User-based Statistics:
  User     Login  Duration
  user1        3   1:18:40
  user2        2   1: 9:57
  user3        1   0:36:16
  user4        1   0:42:33


The login/logout listing could be disabled by specifying
the parameter "-l".  This option is useful when only one
of the statistics is desired.

  >raslog 0 +g -l
  RAS Log
  
  General Statistics:
  Duration  =  18:38:23
    0 Lines =  16:34:43 ( 88.9%)
    1 Lines =   1:51:36 ( 10.0%)
    2 Lines =   0:12:04 (  1.1%)


As a CGI program, it expects an input called "offset" (case-
sensitive).  The effect of this input is the same as the 
console mode.  If an input called "computername" is received, 
it will report the login/logout events of the named computer.  
If an input called, "title1" is received, it will be placed 
in front of the default title "RAS Log".  If an 
input called "title2" is received, it will replaced the 
default title.  The program can receive inputs from both 
"POST" and "GET" methods.  Examples of possible URLs are:

  RAS Log for 
  <a href= "/cgi/raslog.exe?offset=0"  >Today</a>,
  <a href= "/cgi/raslog.exe?offset=-1" >Last 2 Days</a> or
  <a href= "/cgi/raslog.exe?offset=-6" >Last 7 Days</a>

The output is similar to the console output, eg:

  RAS Log
  Time     PORT   USER     ACTION NL Duration
  --- 18 Jan 1997 ---
  00:08:38 COM4   user1    login   1  0:10:05
  00:18:43 COM5   user2    login   2  0: 4:42
  00:23:25 COM4   user1    logout  1  0: 1:14
  00:24:39 COM5   user2    logout  0  8:45:15
  09:09:54 COM2   user3    login   1  0: 0:40
  09:10:34 COM2   user3    logout  0  0: 1:21
  09:11:55 COM3   user4    login   1  0: 7:02
  ...
  15:27:21 COM5   user3    login   1  0: 2:12
  15:29:33 COM5   user3    logout  0  2:51:03
  18:20:36 COM2   user4    login   1  0: 8:03
  18:28:39 COM2   user4    logout  0  0: 9:44
  18:38:23 COM3   user5    login   1  0: 1:00
  18:39:23 Ended.


The other options could be specified by input with the 
appropriate names, as follows: 
  duration=N  to set the duration to N hrs
  width=N     to set the width of user names
  tz=tznNN    to set TZ to tznNN
  table=1     to enable non-tabulated listing
  gstat=1     to enable general statistics
  port=1      to enable port-based statistics
  user=1      to enable user-based statistics
  nolist=1    to disable listing

An example of possible URL:

  <form method="POST" action="/cgi/raslog.exe">
  <input type="SUBMIT" value="View RAS Log" >
  <select name="offset" >
    <option value="0" selected>Today
    <option value="-1">-2 Days
    <option value="-6">-7 Days
  </select><br>
  Duration:
  <select name="duration" >
    <option value="24" selected>24 hrs (1 day)
    <option value="48" >48 hrs (2 days)
    <option value="168">168 hrs (7 Days)
  </select><br>
  <input type="CHECKBOX" name="table" >:Tabulated<br>
  <input type="CHECKBOX" name="gstat" >:General Stats<br>
  <input type="CHECKBOX" name="port" >:Port-based Stats<br>
  <input type="CHECKBOX" name="user" >:User-based Stats<br>
  <input type="CHECKBOX" name="nolist" >:No Listing<br>
  Width:<select name="width" >
    <option value="8" selected>8
    <option value="12">12
    <option value="16">16
    <option value="20">20
  </select><br>
  TZ:<input type="TEXT" name="tz" value="" size="8" >
  </form>


------------------------------------------------------------
B. Registration Guide.

This "RAS Log" for Windows(R) NT is copyrighted by TCS Operations 
Research ("TCS OR") with all rights reserved.  You may 
examine "raslog" for 30 days.  If at the end of that time you 
are satisfied and would like to use it, you should register 
it.  Registration is encouraged since it not only funds 
further development of the Tutorial, but also gives you
a warm feeling deep down inside.

Before you register please see read the Licence Terms and 
Conditions.

Registration is on a per user basis.  To register, please 
send name or appointment, organisation or company (if 
applicable), email (if any), and address along with a 
registration fee of S$20.00 (Twenty Singapore Dollars) in 
cash or cheque to:

TCS Operations Research
Serangoon Garden P.O. Box 487
Singapore 915533
Republic of Singapore

The author can also be contacted via email:
tohcs@pobox.org.sg

Please add shipping: S$2.00 for Singapore/Malaysia; S$5.00 
all other countries.  A 3.5" diskette containing the most 
recent version will be sent to you.

As a registered user, you will receive support for up to 12 
months from the date of registration.  Support will include 
any upgrades or bug fixes released within that 12 months.  
After 12 months, upgrades for previously registered users 
will cost 25% of the prevailing registration fee.

------------------------------------------------------------
C. Requirement Notes.

1. The software requires that the Remote Access Server 
service be started at the computer to which the queries is 
sent.

2. Only members of the Administrator local group can 
successfully execute the "table=1"/"+t" and "port"/"+p" 
options.  As a console program, the user must be a member
of the Administrator local group.  As a CGI program on 
MIIS, its file permissions could be set to execute-able
only by the Administrator local group.

3. For the reported time's to be correct, the computer's 
time zone setting and the environment variable TZ must be 
set. The general format of TZ is as follows:

TZ=tzn[+|-]hh[:mm[:ss]][dzn]
tzn  Three-letter time-zone name, such as PST. 
hh   Difference in hours between UTC and local time. 
mm   Minutes. Separated from hh by a colon (:).
ss   Seconds. Separated from mm by a colon (:).
dzn  Three-letter daylight-saving-time zone such as PDT. If 
     daylight saving time is never in effect in the locality,
     set TZ without a value for dzn. The program assumes the
     United Statess rules for implementing the calculation 
     of Daylight Saving Time (DST). 
For example, to set the TZ environment variable to correspond 
to the current time zone in Germany, you can use one of the 
following statements:
  
set TZ=GST1GDT
set TZ=GST+1GDT
  
  These strings use GST to indicate German standard time, 
assume that Germany is one hour ahead of UTC, and assume 
that daylight savings time is in effect.  

  The TZ variable could be set via the control panel-
system icon, or via the "TZ=tznNN" (CGI) or "+ztznNN"
(console).

4. Among others, the program requires rassapi.dll & 
msvcrt.dll to be installed on the computer.

------------------------------------------------------------
D. Release Notes.

1.00  Initial Version (called WHO)
1.05  Renamed RASLOG
1.07  Initial Release as RASLOG
