[comp.os.vms] RMTMONITOR - Run MONITOR on a remote DECnet node

nagy%warner.hepnet@LBL.GOV (Frank J. Nagy, VAX Wizard & Guru) (04/14/88)

I have the RMTMONITOR.COM procedure store in my login area on all the VAXes
I deal with on our network.  We normally setup proxy logins between these
systems.  This allows me to define a RMONITOR command to invoke this
procedure to execute MONITOR on a remote system without having to do a
SET HOST to that system (see the help information at the end of the
command procedure).

SECURITY NOTE: This procedure uses DECnet task-to-task communications.
For security reasons, we disable use of the DECnet TASK object by the
default DECNET account and enable incoming and outgoing proxy access
for the TASK object.  (DECNET access was disabled by providing the
default DECNET account with a password and expliciting setting the
user to DECNET and password to its password on all objects for which
we wished to allow default DECnet access AND also enabling proxy
access as appropriate.  Doing this on FAL allows non-proxied users
access to our file base with permitting them to dump a procedure in
the default DECNET area and execute it with task-to-task communications.
In addition, the MAIL and PHONE objects use only the DECNET account
and do not use proxy logins).

Since I use proxy logins, all I have to do is have this procedure in
my login area on the destination nodes.  This can be made available
as a general DECnet object for all users by putting the procedure into
SYS$SYSTEM or by defining RMTMONITOR in the DECnet object database and
providing a file specification for a place other than SYS$SYSTEM.
I DO NOT SUGGEST YOU DO THIS UNLESS YOU ARE AWARE OF THE POSSIBLE
CONSEQUENCES AS NEITHER FERMILAB NOR I, ONLY YOU WILL BE RESPONSIBLE
IF SOMEONE DAMAGES YOUR SYSTEM USING THIS PROCEDURE.

= Frank J. Nagy   "VAX Guru & Wizard"
= Fermilab Research Division EED/Controls
= HEPNET: WARNER::NAGY (43198::NAGY) or FNAL::NAGY (43009::NAGY)
= BitNet: NAGY@FNAL
= USnail: Fermilab POB 500 MS/220 Batavia, IL 60510

....................... Cut between dotted lines and save ......................
$!..............................................................................
$! VAX/VMS archive file created by VMS_SHAR V-5.01 01-Oct-1987
$! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au)
$! To unpack, simply save and execute (@) this file.
$!
$! This archive was created by NAGY
$! on Thursday 14-APR-1988 08:13:40.75
$!
$! It contains the following 1 file:
$! RMTMONITOR.COM
$!==============================================================================
$ Set Symbol/Scope=(NoLocal,NoGlobal)
$ Version=F$GetSYI("VERSION") ! See what VMS version we have here:
$ If Version.ges."V4.4" then goto Version_OK
$ Write SYS$Output "Sorry, you are running VMS ",Version, -
                ", but this procedure requires V4.4 or higher."
$ Exit 44
$Version_OK: CR[0,8]=13
$ Pass_or_Failed="failed!,passed."
$ Goto Start
$Convert_File:
$ Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd
$No_Error1: Define/User_Mode SYS$Output NL:
$ Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' -
        VMS_SHAR_DUMMY.DUMMY
f:=Get_Info(Command_Line,"File_Name");b:=Create_Buffer("",f);
o:=Get_Info(Command_Line,"Output_File");Set(Output_File,b,o);
Position(Beginning_of(b));Loop x:=Erase_Character(1);Loop ExitIf x<>"V";
Move_Vertical(1);x:=Erase_Character(1);Append_Line;
Move_Horizontal(-Current_Offset);EndLoop;Move_Vertical(1);
ExitIf Mark(None)=End_of(b) EndLoop;Position(Beginning_of(b));Loop
x:=Search("`",Forward,Exact);ExitIf x=0;Position(x);Erase_Character(1);
If Current_Character='`' then Move_Horizontal(1);else
Copy_Text(ASCII(INT(Erase_Character(3))));EndIf;EndLoop;Exit;
$ Delete VMS_SHAR_DUMMY.DUMMY;*
$ Checksum 'File_is
$ Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR
$ Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd
$No_Error2: Return
$Start:
$ File_is="RMTMONITOR.COM"
$ Check_Sum_is=1630497864
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X$ verify = 'F$VERIFY(0)'
X$!.. RMTMONITOR.COM`009`009MONITOR a remote node over DECnet
X$!.. Description/history at end of file.
X$ IF F$MODE() .NES. "NETWORK" THEN $ GOTO LOCAL_END
X$!
X$! The trick here is to monitor everything in RECORD mode (w/o any display),
X$! but the record output goes out across the network link where its eaten
X$! by the remote end which does the display.
X$!
X$ MONITOR ALL /NODISPLAY /RECORD=SYS$NET /COMMENT="Remote Monitor" /INTERVAL=1
X$ EXIT`009F$VERIFY(verify).OR.1
X$LOCAL_END:
X$ ON CONTROL_Y THEN $ EXIT`009F$VERIFY(verify).OR.1
X$ ON ERROR THEN $ EXIT`009F$VERIFY(verify).OR.1
X$ DEFINE /USER_MODE SYS$INPUT`009SYS$COMMAND:
X$ MONITOR /INPUT='p1'::"""TASK=RMTMONITOR"""`009'p2' 'p3' 'p4' 'p5' 'p6' 'p7'
X$ EXIT`009F$VERIFY(verify).OR.1
X$!=============================================================================
X$!+ RMTMONITOR
X$! MONITOR a remote system using DECnet.  This procedure must be installed as a
X$! DECnet object or present in the login area of any account using it (and
X$! which has proxy login definitions in place).
X$!
X$!`009@RMTMONITOR  node  class-and-qualifiers
X$!
X$! The first parameter is the node name.  The remaining parameters are the
X$! MONITOR class(es) and qualifiers.  For instance to monitor a node and
X$! display the CPU usage histogram:
X$!
X$!`009@RMTMONITOR  node  PROCESSES/TOPCPU
X$!-
X$!=============================================================================
X$! Modifications:
X$!  23-Mar-88`009FJN`009Created from Ed Dambik's ideas he embedded in his
X$!`009`009`009MON.COM and REMON.COM procedures
$ GoSub Convert_File
$ Exit