From:	SMTP%"turion@research.ptt.nl" 21-MAR-1994 15:13:44.85
To:	EVERHART
CC:	
Subj:	what system info tool, looking for macro expert

X-Newsgroups: comp.os.vms,vmsnet.internals,vmsnet.alpha
From: turion_s@dnlts0research.ptt.nl. (Paul Turion)
Subject: what system info tool, looking for macro expert
Message-ID: <1994Mar21.143826.703@news.research.ptt.nl>
Keywords: performance, user information
Sender: turion_s@research.ptt.nl (Paul Turion)
Nntp-Posting-Host: dnlts0.research.ptt.nl
Reply-To: turion@research.ptt.nl
Organization: PTT Research
X-Newsreader: mxrn 6.18-4
Date: Mon, 21 Mar 1994 14:38:26 GMT
Lines: 419
To: Info-VAX@CRVAX.SRI.COM
X-Gateway-Source-Info: USENET


Hereby i post a VAX/VMS tool to show a finger like statusline clusterwide and 
user information cluster wide.
I'm looking for a AXP macro porting expert to port this software to ALPHA AXP. 
The LAVDRIVER is already ported to ALPHA AXP. This driver is included as INETDRIVER
So an VAX driver lavdriver and an AXPdriver is included in this 16 part share.
If anyone ports this software to AXP i would be very greatefull. ;-)
All 16 parts of this share are posted to COMP.OS.VMS. PART 1 is also posted to 
vmsnet.internals, vmsnet.alpha

$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.1-004  3-AUG-1989
$!   On 21-MAR-1994 13:20:12.70   By user TURION_S 
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$!+ THIS PACKAGE DISTRIBUTED IN 16 PARTS, TO KEEP EACH PART
$!  BELOW 30 BLOCKS
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. AAAREADME.TXT;1
$!       2. AA_FIX_FILES.COM;1
$!       3. BUILD_WHAT.COM;1
$!       4. DAE_FUNC.MAR;1
$!       5. GETNCB.MAR;1
$!       6. INETDRIVER.MAR;1
$!       7. INETDRIVER.OPT;2
$!       8. INSTALL.COM;1
$!       9. LAVDRIVER.MAR;3
$!      10. LAVDRIVER.OPT;1
$!      11. LAVDRIVER.TXT;1
$!      12. ND.C;1
$!      13. ND.OPT;1
$!      14. PRINT_WHAT.COM;1
$!      15. START_WHAT.COM;12
$!      16. WHAT.CLD;1
$!      17. WHAT.DOC;1
$!      18. WHAT.HLP;2
$!      19. WHAT.OPT;1
$!      20. WHAT.PAS;3
$!      21. WHATLOG.COM;8
$!      22. WHAT_BUILDUSERS.MAR;1
$!      23. WHAT_DEFS.PAS;1
$!      24. WHAT_LOOK.MAR;1
$!      25. WHAT_MSG.MSG;1
$!      26. WHAT_PARSEIMAGE.MAR;1
$!      27. WHAT_RETNODES.MAR;1
$!      28. WHAT_STATUS.MAR;1
$!      29. WHAT_TRNLNM.MAR;1
$!      30. WHAT_UPTIME.MAR;1
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ if f$getsyi("version") .ges. "V4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete/nolog 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete/nolog 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");
buff:=CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(buff))
;LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(buff));g:=0;LOOP EXITIF MARK(NONE)=END_OF(buff);x:=
ERASE_CHARACTER(1);IF g = 0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x=
"V" THEN APPEND_LINE;MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;
IF x="+" THEN g:=1;ERASE_LINE;ENDIF;ELSE IF x="-" THEN g:=0;ENDIF;ERASE_LINE;
ENDIF;ENDLOOP;p:="`";POSITION(BEGINNING_OF(buff));LOOP r:=SEARCH(p,FORWARD);
EXITIF r=0;POSITION(r);ERASE(r);COPY_TEXT(ASCII(INT(ERASE_CHARACTER(3))));
ENDLOOP;o:=GET_INFO(COMMAND_LINE,"output_file");WRITE_FILE(buff,o);
ENDPROCEDURE;Unpacker;EXIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create/nolog 'f'
X********** NOTE:   Several files have been broken up to accomodate a
X                   infovax distribution   you MUST run AA_FIX_FILES.COM
X                   Before building the procedure.
X
X                                - Awp
X
X                              WHAT Version 1.1
X
X****************************************************************************
X
X                                15 June 1988
X
X   This is a newer version than the one submitted to the Sprting 88,
X   Cincinatti DECUS Symposia Tape.  Improvements over version 1.0
X   include:
X
X        1) Callable system sort is replaced by an internal Quick sort.
X           Performance on a MicroVAXes is substantually improved.
X
X        2) Numerous minor bug fixes.
X
X        3) Format change for the /STATUS display
X
X    This version of What is upward and downward compatible with version of
X    1.0 so you do not need to upgrade all WHAT systems at the same time.
X
X                - Awp
X
X****************************************************************************
V*
X
X   A FAST Cluster and network-wide SHOW USERS (and Much more) type command.
X
X        Authors:
X
X        Pete Portante, (most of the work)
X        Andrew W. Potter
X        David Mulvihill
X        Rochester Institute of Technology
X
X        Distributed and supported by:
X
X        Andrew W. Potter
X        Systems Programmer
X        Information Systems and Computing
X        Rochester Institute of Technology
X        Rochester NY, 14623  PH (716) 475-6994
X        Email:    awpsys@ritvax.BITNET
X                  awp8101@ritcv.UUCP
X
X
X        **** Installation instructions are in WHAT.DOC ***
X
X
XWHAT is a very fast utility that uses DECnet non-transparent communications
Xto produce three different displays. These displays are:
X
X        1) A SHOW USERS like display from one or more DECnet nodes.
X
X        2) A full user activity display. (Similar to the Unix "w"
X             command.
X
X        3) A one line summary of system activity, (User counts,uptime...)
X
X        Qualifiers exist to effectly subset the user list. (I.E.
X        look only for users A,B and C on nodes X, Y, and Z)
X
X        Complete online help exists.
X
XWhat use a detached process that provides very fast response to
Xmultiple incomming network requests when serving a request from a
Xremote system.
X
X        WHAT uses some of the following techniques for speed.
X
X        1) Looks at process state BEFORE calling $getjpi to retrieve
X           information in P1 space.  This allows WHAT to NOT request
X           that information if doing so would require a inswap.
X
X        2) Does NOT use DECnet to retreive information from the local
X           node.  For example assume the user is logged on to
X           LARRY and he issues the command:
X                $ WHAT/NODE=(CURLY,LARRY,MOE)
X           What would connect to the non-transparent object only to
X           retrieve the info from CURLY and MOE.
X
X        3) Sends the qualifing information (/USER=userlist) to the
X           remote node for remote subsetting.  This prevents having
X           to transmit over the net large data buffers of ALL users
X           just to filter it all out locally.
$ CALL UNPACK AAAREADME.TXT;1 777722743
$ create/nolog 'f'
X$!   Procedure to reassemble pieces of what that were to big to send
X$!   over the net.
X$!
X$ write sys$output "Reassembling big files"
X$!
X$ write sys$output " "
X$ copy/conc DAE_FUNC.MAR_1,DAE_FUNC.MAR_2 DAE_FUNC.MAR/log
X$ write sys$output " "
X$ copy/conc nd.c_1,nd.c_2 nd.c/log
X$ write sys$output " "
X$ copy/conc WHAT_LOOK.MAR_1,WHAT_LOOK.MAR_2 what_look.mar/log
$ CALL UNPACK AA_FIX_FILES.COM;1 556497912
$ create/nolog 'f'
X$ set protection = (world:re)/def
X$ IF p1 .eqs. "LINK" THEN GOTO LINK
X$
X$! Creating What
X$
X$ pascal /noobj/envi what_defs
X$ pascal /nodebug/nocheck what
X$ macro /nodebug what_parseimage
X$ macro /nodebug what_look
X$ macro /nodebug what_status
X$ macro /nodebug dae_func
X$ macro /nodebug what_trnlnm
X$ macro /nodebug what_uptime
X$ macro /nodebug what_retnodes
X$ macro /nodebug what_buildusers
X$ message  what_msg
X$ !
X$ ! Creating Daemon
X$ !
X$ cc /nodebug nd
X$ macro /nodebug getncb
X$ macro /nodebug what_parseimage
X$ macro /nodebug what_look
X$ macro /nodebug what_status
X$ !
X$ ! Link them
X$ !
X$ LINK:
X$ link/exe=what /nodebug/notrace what, what_parseimage, what_look, -
X  what_status, dae_func, what_trnlnm, what_uptime, what_retnodes, -
X  what_buildusers, what_msg, what/Option
X$ link/exe=nd  /nodebug/notrace nd, getncb, what_parseimage, what_look, -
X  what_status, nd.opt/option
$ CALL UNPACK BUILD_WHAT.COM;1 1668703245
$ create/nolog 'f'
X;***************************************************************************
V****
X;* *
X;* Daemon Functions *
X;* *
X;***************************************************************************
V****
X;
X                .title  DAE_FUNC
X;
X                $dscdef                         ; Get the descriptor codes
X                $ssdef                          ; Get the system return code
Vs
X                $iodef                          ; Get the IO definitions
X                $prvdef                         ; Get the privilege definiti
Vons
X                $syidef                         ; Get the system value defin
Vitions
X;
X;       Mask and function codes for daemon and look routine
X;
X;
XDAE_M_CHANNEL = 128                             ; Mask to use channel to get
V information
XDAE_M_STATUS = 64                               ; Mask to get the status fro
Vmthe node
XDAE_M_USER = 32                                 ; Mask to get the users on t
Vhe specified list
XDAE_M_NODE = 16                                 ; Mask for the node to be in
Vcluded in what ever format
XDAE_M_FULL = 8                                  ; Mask for the full format
XDAE_M_SILENT = 4                                ; Mask to shut off signaling
V of node errors
XDAE_M_ALL = 1                                   ; Mask to get all processes
X;
XDAE_V_CHANNEL = 7                               ; Bit which selects whether
V to use a channel or a buffer
XDAE_V_STATUS = 6                                ; Bit which selects whether
V or not to just get the status info
XDAE_V_USER = 5                                  ; Bit which selects whether
V to get the users specified
XDAE_V_NODE = 4                                  ; Bit which selects whether
V the node should be included
XDAE_V_FULL = 3                                  ; Bit which selects brief or
V full format
XDAE_V_SILENT = 2                                ; Bit which shuts off error
V messages
XDAE_V_ALL = 0                                   ; Bit which selects either u
Vsers or all system processes
X;
X;               Sort constants
X;
XBRIEF_USER_OFFSET = 1                           ; Offset of brief username
XFULL_USER_OFFSET = 0                            ; Offset of full username
XBRIEF_NODE_OFFSET = 11                          ; Offset of brief node
XFULL_NODE_OFFSET = 9                            ; Offset of full node
XSTAT_NODE_OFFSET = 0                            ; Offset of status node
X;
X;               Constants for transfer values and storage
X;
XDAE_USER_LEN = 8                                ; Length the username takes
XDAE_MAX_NODE_LEN = 6                            ; Current maximum length of
V anode
XDAE_MAX_NODES = 128                             ; Max number of nodes to get
V info
XDAE_MAX_USERS = 128                             ; Max number of users we can
V get
XDAE_MAX_USER_STR = <DAE_USER_LEN + 1> * DAE_MAX_USERS ; Maximum size of user
V string to search
XDAE_LRL = 80                                    ; Length of the return recor
Vd
XDAE_MAX_REC = 2560                              ; Maximum number of records
XSTAT_LEN = 52                                   ; Length of status returned
XINFO_SIZE = 24000                               ; Twenty four thousand bytes
V are capable of being sent
XMAX_BUFFER = DAE_MAX_REC * DAE_LRL              ; The maximum number of 80 b
Vyte records we'll accept is 2560.
X;
X;               Offsets into the status record
X;
XTOTAL_INT = 28
XTOTAL_BAT = 30
XTOTAL_NET = 32
XTOTAL_PRC = 34
X;
X;               Data areas for network information
X;
X                .psect  dae_data, noexe, pic, noshr, lcl, wrt, rd, rel, con
X;
X;       Stat_buf is where we keep all the status information from the nodes.
X;       We have record size of STAT_LEN. The format of the record we store
X;       here is:
X;
X;
X;       Data for SOR$ routines
X;
Xuser_offset:    .word   BRIEF_USER_OFFSET       ; Key off set in string
Xnode_offset:    .word   BRIEF_NODE_OFFSET       ; Where the key is in string
X;
Xret_len:        .word   0                       ; Length of return string
X;
Xsignal_bool:    .long   0                       ; If this is clear, signal e
Vrrors
X;
X;       Data for Network stuff
X;
Xnet_device:     .ascid  "_NET:"                 ; Descriptor for the net wor
Vkname
X;
Xnet_obj:        .ascii  '::"252="'              ; Net work object to connect
V to
Xlen_net_obj = .-net_obj                         ; Length of string
X;
Xtrans_length:   .long   0                       ; Number of bytes to transfe
Vr
Xfunc_code:      .byte   0                       ; User function code
Xusers_len:      .word   0                       ; Initialy we aren't looking
V for anybody
Xusers:          .byte   32`091DAE_MAX_USER_STR`093    ; String of users to s
Vearch for
XREQUEST_SIZE = . - func_code                    ; Determine size of string t
Vosend over in function request
X;
Xusers_descr:    .long   DAE_MAX_USER_STR
X                .address users                  ; Descriptor for passing the
V users string
X;
Xncb:            .blkb   100                     ; Net work connect block stu
Vcture
Xncb_descr:      .long   len_net_obj             ; Length of ncb
X                .address ncb                    ; Descriptor for connect blo
Vck
X;
Xnode_descr:     .long   DAE_MAX_NODE_LEN        ; How long our node is
X                .address node                   ; Node we are currently talk
Ving to
X;
Xnode_len:       .long   0                       ; Length of node
Xnode:           .byte   32`091DAE_MAX_NODE_LEN`093    ; Node we are currentl
Vy talking to
X;
Xcurr_node_len:  .long   0                       ; Length of this node
Xcurr_node:      .byte   32`091DAE_MAX_NODE_LEN`093    ; Node we are currentl
Vy residing on
X;
Xlocal_look:     .byte   0                       ; Can we look locally
Xprv_mask:       .long   PRV$M_WORLD             ; Set these privileges
X                .long   0                       ; Priv mask must be a quad w
Vord
X;
X;       SYI item list to get the system wide information
X;
Xsyi_list:       .word   6
X                .word   SYI$_NODENAME
X                .address curr_node
X                .address curr_node_len
X;
X                .long   0                       ; End of SYI list
X;
+-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-



-- 
 ------- --------------------  			Paul Turion 
| p t t |  r e s e a r c h   |			The Netherlands
|      _|                    | 			e-mail address
|    _|_|   .  .  .  .  .    |			P.Turion@research.ptt.nl
|___|_|      
My interest is in the future because
I am going to spend the rest of my life there.

