[comp.os.vms] Remote commands across DECNET

SYSMGR%UK.AC.KCL.PH.IPG@AC.UK (04/25/87)

There seem to have been a number of queries recently of the form "How
do I find out what is happening on another decnet node without setting host
to it?". The appended command procedure might be rather useful to these
people. To use it, you define TELL:==@this-command-procedure in your (site)
login.com, and then

    $ TELL <node> <DCL-command>

for example

    $ TELL PHSAR:: SHOW SYSTEM    !find out what is running on PHSAR::
    $ TELL PHIPG:: SHOW NET        !look at net, if local node is end-node

or even
    $ TELL ABC::  CC   XYZ::'F$DIR()'QWERTY /OBJ=XYZ::'F$DIR()'

which, if executed on XYZ will compile QWERTY.C in the current directory and
send the object file back there, even though XYZ has no C compiler (ABC does).

As a system-wide utility, put TELL.COM into your system command procedures
directory (on all nodes on which it is required) and tell NCP about it with

    NCP> DEFINE OBJECT NUMBER 0 FILE <whatever>
    NCP> SET KNOWN OBJECT ALL

If you have proxy login enabled, the command will execute in your own personal
DCL environment (with your LOGIN.COM having been done first). If not, it will
execute as DECNET which may be a bit restrictive.

The technique used here is "transparent task-to-task communication", and the
"guide to Networking on VAX/VMS" is very helpful further reading. I have used
the same technique to allow our graphics libraries to drive devices attached
to controllers on a different node, and it can also be used to BACKUP to a
remote tape drive (see pageswapper article).

Nigel Arnot (Dept. Physics, Kings college, Univ. of London;  U.K)

Bitnet/NetNorth/Earn:   sysmgr@ipg.ph.kcl.ac.uk (or) sysmgr%kcl.ph.vaxa@ac.uk
       Arpa         :   sysmgr%ipg.ph.kcl.ac.uk@ucl-cs.arpa


$! start of TELL.COM -------------------------------------------------------
$! N. R. Arnot, dept. Physics, Kings College, London WC2R 2LS, England.
$ if f$mode().EQS."NETWORK" then goto remote
$ if "''P1'".EQS."" then inquire/nopunc p1 "_Node:    "
$ if "''P2'".EQS."" then inquire/nopunc p2 "_Command: "
$ p1 = p1 - "::"
$ if p1.eqs."" then $exit
$ open/write net 'p1'::"task=tell"
$ write net "''p2' ''P3' ''P4' ''P5' ''P6' ''P7' ''P8'"
$ type net:
$ close net
$ exit
$
$remote:
$ if "''tell_first_use'".nes."" then goto setup_done
$! there is a bug somewhere that prevents us getting local DCL tables through
$! the user's UAF entry by proxy login. So, if you want them, ...
$! uncomment and suitably modify the next line
$! set command/tables=sys_qec:dcl_tables.exe    ! <--- NB SYSTEM SPECIFIC bit
$ tell_first_use == "FALSE"
$setup_done:
$ open/write net sys$net:
$ read net command
$ ass net.out sys$output
$ set noon
$ 'command'
$ stat = $status
$ deass sys$output
$ set on
$ if f$search("net.out").eqs."" then goto no_out
$ copy net.out net:
$ delete net.out;*
$ goto out_done
$no_out:
$ write net "%TELL-I-NO_OUTPUT, command did not write to SYS$OUTPUT"
$out_done:
$ if .not.stat then write net f$message(stat)
$ close net
$! end of TELL.COM ----------------------------------------------------