home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 20163 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  3.4 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!sousa.tay.dec.com!keptin.enet.dec.com
  2. From: granoff@keptin.enet.dec.com (Mark H. Granoff)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: TT_AccPorNam field remains null on a SHOW USERS output ?
  5. Message-ID: <2353@sousa.tay.dec.com>
  6. Date: 31 Dec 92 15:22:29 GMT
  7. References: <1992Dec27.233720.1@woods.ulowell.edu>
  8. Sender: newsa@sousa.tay.dec.com
  9. Reply-To: granoff@ranger.enet.dec.com
  10. Organization: Digital Equipment Corporation, Littleton, MA
  11. Lines: 76
  12.  
  13.  
  14. In article <1992Dec27.233720.1@woods.ulowell.edu>,
  15.  sabotkap@woods.ulowell.edu writes:
  16. >From a terminal hardwired to the system (ours is VMS 5.4), the server/port
  17. >field is left blank (see below).  An attempt at using
  18. >f$getdvi("TT","TT_AccPorNam") also returns an empty string.
  19. >
  20. > [SHOW USER output deleted]
  21. >
  22. >When logged in from a server, or remote system, the server/remote port
  23. >information is sometimes left blank:
  24. >
  25. > [SHOW USER output deleted]
  26. >
  27. >When logged in from a non-hardwired terminal, when during login is the 
  28. >TT_AccPorNam information obtained ?  It seems a SET TERMINAL/INQUIRE in 
  29. >our SYLOGIN.COM is responsible for getting this field, but at other times, 
  30. >an otherwise normal login will not retreive this information.
  31. >
  32. >My motives: We have a captive account which we would like to monitor by 
  33. >            writing the login time, and any server/remote port information 
  34. >            to a log file.  
  35.  
  36. It might be useful to know the basic algorithm SHOW USERS uses to display
  37. terminal name, etc information.  Not only does it consider a process' terminal,
  38. physical device, and access port names, but also if the job is a subprocess
  39. and the job mode of the process.  (I hacked this out of something I wrote,
  40. after I figured out what SHOW USERS was doing).
  41.  
  42.     while (there are processes to look at)
  43.     {
  44.     ...
  45.         if (Process-PID != Master-Process-PID) {
  46.             printf("(subprocess of %08X)\n", Master-Process-PID);
  47.             continue;
  48.         }
  49.  
  50.         if (Physical-Devnam-Length == 0) {
  51.             if (jobmode == Batch)
  52.                 printf("(batch)\n");
  53.             else if (jobmode == Network)
  54.                 printf("(network)\n");
  55.             else if (jobmode == Other)
  56.                 printf("(detached process)\n");
  57.             else if (Terminal-Namelen != 0)
  58.                 printf("%s  Disconnected\n", Terminal-Name);
  59.             else
  60.                 putchar('\n');
  61.             continue;
  62.         }
  63.  
  64.         if ((Physical-Devnam == Terminal-Name) &&
  65.         Terminal-Name != NULL)
  66.             Physical-Devnam = NULL;
  67.         if (Terminal-Name != NULL) printf("%s ", Terminal-Name);
  68.         if (Physical-Devnam != NULL) printf("%s ", Physical-Devnam);
  69.         if (AccPorNam != NULL) printf("(%s)", AccPorNam);
  70.  
  71.         putchar('\n');
  72.     };
  73.  
  74. So, SHOW USERS displays all the information it can about a process' physical
  75. connection (or disconnection), that is appropriate for the process' current
  76. profile.
  77.  
  78. Does that help, or hurt?
  79.  
  80. --
  81. Mark H. Granoff | Personal Computing Systems Network S/W Development Group  
  82. ---------------------------------------------------------------------------
  83. Digital Equipment Corporation | Internet: granoff@keptin.enet.dec.com
  84. 30 Porter Road, LJO2/I4       | Usenet  : ...!decwrl!keptin.enet!granoff
  85. Littleton, MA 01460           | AT&T    : +1 508 486 2090
  86. ---------------------------------------------------------------------------
  87. Opinions herein are my own and do not necessarily reflect those of Digital.
  88.  
  89.