Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Phone/ 'Finger' for VMS

7 views
Skip to first unread message

Chris

unread,
Jan 17, 1994, 10:50:26 AM1/17/94
to


With people wanting to know how to 'finger' and machine on a system, I
put together a bit of code with the one that came through on the
conference last week to look at remote VMS machines.
I've edited and merged a few bits of code i had lying around and it
should now show both people on VMS nodes and Unix nodes.
The DCL below uses DecNet to access information on the remote unix node
and thus Decnet wpould have to be running on the remote node in order
for it to work. Two files are also written to the current sys$login
area into which the /usr/utmp file of the remote unix node is
copied. the exchange utility should be installed for this.
All i can say if that makes no sense (like it does to me) is, edit the
code out and try it.
I'd like to thank the original author of the VMS remote node finger (ie.
the one that uses the Phone object)
I've also made it a bit more robust (maybe too robust?)

Chris

PS. I hope this is of use to someone (ANYONE!) :-)

------------------------------8<--[ CUT HERE ]-->8------------------------------
$!
$!******************************************************************************
$!* LOOK - 1994 Enigma at Staffordshire University *
$!* Uses: RWHO - 1992 Weirdbeard at Staffordshire University *
$!* Phone code - 1994 Author Unknown on the Internet *
$!* 'Tweeked', Tidied up and Merged by Enigma *
$!* Will recognise VMS and UNIX nodes *
$!* Email: c.ro...@staffordshire.ac.uk (as at 1994) *
$!******************************************************************************
$!
$look:
$rwho:
$ p2=p1 ! p2 is redefined to remain compatibility with original code
$ ver:='f$verify(0)
$ set message/noid/nofac/nosev/notext
$ on error then goto lookexit
$ on warning then goto lookexit
$ on severe_error then goto lookexit
$ on control_y then goto lookexit
$ if p2 .eqs. "" then inquire/nopunc p2 "Please enter node to list: "
$ if p2 .eqs. "" then exit
$ p2 = p2-":"-":"
$ wr:=write sys$output
$ num = 0
$ cmd[0,8] = 15
$ close/nolog phn ! make sure it's closed
$ wr "Attempting connection to node ''p2'..."
$ tstring="Users on "+p2+" at "+f$time()
$ open/read/write/share/error=lookexit phn 'p2'::"29="
$ wr ""
$ wr tstring
$ wr ""
$ wr " Username Process Name Terminal Phone Status"
$ wr ""
$looklupe:
$ write/error=lookclose phn cmd
$ read/end=lookclose/error=lookclose phn str
$ if f$length(str).eq.0 then goto lookclose
$ username=f$extract(15,13,str)
$ process_name=f$extract(0,15,str)
$ str[0,13]:="''username'"
$ str[13,15]:="''process_name'"
$ wr str
$ num = num+1
$ goto looklupe
$lookclose:
$ close/nolog phn
$ wr ""
$ wr f$fao("!SL person!%S listed.",num)
$lookexit:
$ if .not. $status then goto lookrwho
$ close/nolog phn
$ set message/id/fac/sev/text
$ exit
$lookrwho:
$ close/nolog phn ! close phn just incase left open
$ conv:="sys$login:rwho.conv"
$ tmp:="sys$login:rwho.tmp"
$ on severe_error then goto rwhoerr
$ on warning then goto rwhoerr
$ on error then goto rwhoerr
$ on control_y then goto rwhoerr
$rwhostart:
$ copy 'p2'::"/etc/utmp" sys$login:rwho.tmp
$ found=0
$ exchange copy 'tmp 'conv/transfer_mode=block
$ wr ""
$ wr tstring
$ wr ""
$ close/nolog file
$ open/read/error=rwhoerr file 'conv
$ g=""
$rwholoop:
$ read/end=eof/error=rwhoerr file line
$ line=g+line
$rwholoop1:
$ lenline=f$len(line)
$ if lenline .gt. 35 then gosub rwhoprocess
$ if lenline .gt. 35 then line=f$extract(36,lenline,line)
$ if lenline .gt. 35 then goto rwholoop1
$ g=line
$ goto rwholoop
$eof:
$ close/nolog file
$ wr ""
$ wr f$fao("!SL person!%S listed.",num)
$rwhobye:
$ close/nolog file ! close file just incase left open
$ if f$search("''tmp';*") .nes. "" then delete/noconfirm 'tmp;*
$ if f$search("''conv';*") .nes. "" then delete/noconfirm 'conv;*
$ set message/id/fac/sev/text
$ exit
$rwhoerr:
$ if .not. $status then wr "''p2' is an unknown node."
$ goto rwhobye
$rwhoprocess:
$ if f$cvui(0,8,line) .eq. 0 .or. f$cvui(64,8,line) .eq. 0 then return
$ tty=f$extract(0,8,line)
$ uid=f$extract(8,8,line)
$ where=f$extract(16,16,line)
$ a=1
$rwhopadtty:
$ if f$cvui(0,8,f$extract(a,1,tty)) .eq. 0 then tty=f$extract(0,a,tty)+" "+f$extract(a+1,f$len(tty),tty)
$ a=a+1
$ if a .lt. f$len(tty) then goto rwhopadtty
$ a=1
$rwhopaduid:
$ if f$cvui(0,8,f$extract(a,1,uid)) .eq. 0 then uid=f$extract(0,a,uid)+" "+f$extract(a+1,f$len(uid),uid)
$ a=a+1
$ if a .lt. f$len(uid) then goto rwhopaduid
$ if found .eq. 0
$ then
$ wr " Username Terminal Logged on From"
$ wr ""
$ else
$ wr " ",uid," ",tty," ",where
$ num=num+1
$ endif
$ found=1
$ return
--------------------------8<--[ CUT HERE ]-->8----------------------------------

--
+-------------------------------+----------------------------------------------+
| Chris Roberts, | " Remember man thou art but dust; " |
| 70. Corporation Street, | " And back to dust thou shalt return. " |
| Stafford, |----------------------------------------------|
| Staffordshire, | E-Mail: c.ro...@staffordshire.ac.uk |
| ST16 3LT, |----------------------------------------------|
| England. | School of Computing |
| +44 (0)785 226195 | Staffordshire University, England |
+-------------------------------+----------------------------------------------+


cr...@cuppa.curtin.edu.au

unread,
Jan 18, 1994, 8:03:49 PM1/18/94
to
In Article <1935...@MVB.SAIC.COM>

Chris <cm2b...@uk.ac.staffs.bs83u> writes:
>
>
> With people wanting to know how to 'finger' and machine on a system, I
>put together a bit of code with the one that came through on the
>conference last week to look at remote VMS machines.
> I've edited and merged a few bits of code i had lying around and it
>should now show both people on VMS nodes and Unix nodes.
> The DCL below uses DecNet to access information on the remote unix node
>and thus Decnet wpould have to be running on the remote node in order
>for it to work.
[...]

.. and what percentage of Unix machines in the world run Decnet?
/---------------------------------------------------------------------------\
| Robert Wright | Wrig...@cupid.curtin.edu.au |
| Curtin University | R.Wr...@icarus.curtin.edu.au |
| Perth, Western Australia | psi%0505294523000:Wright_RJ |
| Voice:+61 9 351 7385 | Wright_RJ%cc.curti...@cunyvm.bitnet |
| FAX: 09-351-2673 | uunet!munnari.oz!cc.curtin.edu.au!Wright_RJ |
|-----------------------------------------------------------------------------|
| Duncan's First Law of Modelling: the stimulation of simulation is greater |
| the pleasurement of the measurement, but it makes you go blind. |
\---------------------------------------------------------------------------/

Chris

unread,
Jan 20, 1994, 5:16:18 AM1/20/94
to
>
> .. and what percentage of Unix machines in the world run Decnet?
> /---------------------------------------------------------------------------\
> | Robert Wright | Wrig...@cupid.curtin.edu.au |
> | Curtin University | R.Wr...@icarus.curtin.edu.au |
> | Perth, Western Australia | psi%0505294523000:Wright_RJ |
> | Voice:+61 9 351 7385 | Wright_RJ%cc.curti...@cunyvm.bitnet |
> | FAX: 09-351-2673 | uunet!munnari.oz!cc.curtin.edu.au!Wright_RJ |
> |-----------------------------------------------------------------------------|
> | Duncan's First Law of Modelling: the stimulation of simulation is greater |
> | the pleasurement of the measurement, but it makes you go blind. |
> \---------------------------------------------------------------------------/
>
We have a mixed VAX/VMS and VAX(Ultrix) clutsers at this University
and most first time unix users don't know how to address in the
standaed unix format (ie. user@site) so dnet has to run in the back
ground. It also enables us to use the space on the ultrix machines
for storage from out VMS accounts. We just use the standard VMS copy
command to achieve it. (/tmp is most useful for storage).
Personally, i hate the DECNet format.

Chris


--
Chris Roberts "Remember man thou art but dust;"
E-Mail: c.ro...@staffordshire.ac.uk "And back to dust thou shalt return."


0 new messages