From: granoff@keptin.enet.dec.com (Mark H. Granoff)
Newsgroups: comp.os.vms
Subject: Re: TT_AccPorNam field remains null on a SHOW USERS output ?
Date: 31 Dec 92 15:22:29 GMT
Reply-To: granoff@ranger.enet.dec.com
Organization: Digital Equipment Corporation, Littleton, MA


In article <1992Dec27.233720.1@woods.ulowell.edu>,
 sabotkap@woods.ulowell.edu writes:
>From a terminal hardwired to the system (ours is VMS 5.4), the server/port
>field is left blank (see below).  An attempt at using
>f$getdvi("TT","TT_AccPorNam") also returns an empty string.
>
> [SHOW USER output deleted]
>
>When logged in from a server, or remote system, the server/remote port
>information is sometimes left blank:
>
> [SHOW USER output deleted]
>
>When logged in from a non-hardwired terminal, when during login is the 
>TT_AccPorNam information obtained ?  It seems a SET TERMINAL/INQUIRE in 
>our SYLOGIN.COM is responsible for getting this field, but at other times, 
>an otherwise normal login will not retreive this information.
>
>My motives: We have a captive account which we would like to monitor by 
>            writing the login time, and any server/remote port information 
>            to a log file.  

It might be useful to know the basic algorithm SHOW USERS uses to display
terminal name, etc information.  Not only does it consider a process' terminal,
physical device, and access port names, but also if the job is a subprocess
and the job mode of the process.  (I hacked this out of something I wrote,
after I figured out what SHOW USERS was doing).

    while (there are processes to look at)
    {
	...
        if (Process-PID != Master-Process-PID) {
            printf("(subprocess of %08X)\n", Master-Process-PID);
            continue;
        }
 
        if (Physical-Devnam-Length == 0) {
            if (jobmode == Batch)
                printf("(batch)\n");
            else if (jobmode == Network)
                printf("(network)\n");
            else if (jobmode == Other)
                printf("(detached process)\n");
            else if (Terminal-Namelen != 0)
                printf("%s  Disconnected\n", Terminal-Name);
            else
                putchar('\n');
            continue;
        }

        if ((Physical-Devnam == Terminal-Name) &&
		Terminal-Name != NULL)
            Physical-Devnam = NULL;
        if (Terminal-Name != NULL) printf("%s ", Terminal-Name);
        if (Physical-Devnam != NULL) printf("%s ", Physical-Devnam);
        if (AccPorNam != NULL) printf("(%s)", AccPorNam);

        putchar('\n');
    };

So, SHOW USERS displays all the information it can about a process' physical
connection (or disconnection), that is appropriate for the process' current
profile.

Does that help, or hurt?

--
Mark H. Granoff | Personal Computing Systems Network S/W Development Group  
---------------------------------------------------------------------------
Digital Equipment Corporation | Internet: granoff@keptin.enet.dec.com
30 Porter Road, LJO2/I4       | Usenet  : ...!decwrl!keptin.enet!granoff
Littleton, MA 01460           | AT&T    : +1 508 486 2090
---------------------------------------------------------------------------
Opinions herein are my own and do not necessarily reflect those of Digital.

Newsgroups: comp.os.vms