
                               					27-Jun-1984 11:18:28	VAX-11 FORTRAN V3.5-62              Page   1
								27-Jun-1984 11:14:36	DRA1:[AWPSYS.DECUS.NODESHOW]NODESHOW.FOR;2  

00001	0001    	program nodeshow
00002	0002    *
00003	0003    *	Purpose:	to do a show whatever and dump it into the network
00004	0004    *
00005	0005    *	Date:		16 Jan 1984
00006	0006    *	Author:		Andrew W. Potter
00007	0007    *
00008	0008    *
00009	0009    *	This program uses the default network account to access remote
00010	0010    *	objects (transparently) and output their results into the network
00011	0011    *
00012	0012    *	Basicly it does a TYPE NODE""::"TASK=object"
00013	0013    *
00014	0014    *	However this program allows a list of nodes to specified
00015	0015    *	ex: $ NODESHOW NODE1,NODE2 object
00016	0016    *
00017	0017    *	The following CLD is necessary to use NODESHOW:
00018	0018    *
00019	0019    ******************************************************************************
00020	0020    *                                                                            *
00021	0021    *   define verb nodeshow                                                     *
00022	0022    *       image disk:[directory]nodeshow	 ! change to show where image lives  *
00023	0023    *                                                                            *
00024	0024    *       parameter P1,label=WHAT                                              *
00025	0025    *               prompt="Show What? "                                         *
00026	0026    *               value (required,list)                                        *
00027	0027    *       parameter P2,label=WHERE                                             *
00028	0028    *               prompt="On Node?   "                                         *
00029	0029    *               value (required,list,type=$INFILE)                           *
00030	0030    *                                                                            *
00031	0031    *                                                                            *
00032	0032    *   NOTE: a CLD is supplied that modifies the VMS "SHOW" command to accept   *
00033	0033    *         run nodeshow with the following syntax:                            *
00034	0034    *                                                                            *
00035	0035    *	  SHOW REMOTE object node[,node...]                                  *
00036	0036    *                                                                            *
00037	0037    ******************************************************************************
00038	0038    *
00039	0039    *	A simple object of the type below can be used to do a remote
00040	0040    *	"SHOW USERS" command
00041	0041    *
00042	0042    *      $! command file to show users and dump it into the network
00043	0043    *      $!
00044	0044    *      $ open /write fil sys$net
00045	0045    *      $ write fil " "
00046	0046    *      $ write fil "        Users on Node:  ''f$logical("SYS$NODE")'"
00047	0047    *      $ write fil " "
00048	0048    *      $ define/user sys$output fil
00049	0049    *      $ show users
00050	0050    *      $ close fil
00051	0051    *
00052	0052    *	At our decnet installation (currently 5 vax nodes) we have simple
00053	0053    *	objects of this type in the default decnet account. (we have made them
00054	0054    *	belong to SYSTEM and made them world readable so hackers cant ruin them
00055	0055    *	(if you have vms V3.4 or later then make the default DECNET directory
00056	0056    *	belong to the system account (keeps those NETSERVER.LOGS out also)
00057	0057    *  	and give only world read and execute (or execute only if you dont want 

                               					27-Jun-1984 11:18:28	VAX-11 FORTRAN V3.5-62              Page   2
								27-Jun-1984 11:14:36	DRA1:[AWPSYS.DECUS.NODESHOW]NODESHOW.FOR;2  

00058	0058    *	people to see what objects you have in the default account))
00059	0059    *
00060	0060    *	More complicated objects can be set up in a high level language to
00061	0061    *	do just about anything and this program "NODESHOW" can be a simple 
00062	0062    *	mechanism to access them.
00063	0063    *
00064	0064    *	This program forces the use of the DECnet default account even if
00065	0065    *	your installation has proxy logins enabled. 
00066	0066    *
00067	0067    *	With only slight modifications this program can be changed to 
00068	0068    *	access know objects. For more information consult the DECnet
00069	0069    *	Users Guide and the DECnet System Managers Guide.
00070	0070    *
00071	0071    *
00072	0072    	implicit integer(a-z)
00073	0073    	character*60,node,innode,errnode,what,taskname*80,line*132
00074	0074    	character*9 whatlist(10)
00075	0075    	external msg_cantfind
00076	0076    	integer*4 count
00077	0077    *
00078	0078    *
00079	0079    *	first get all the things that we need to see.
00080	0080    *
00081	0081    	count = 1
00082	0082    	do while (cli$get_value('WHAT',whatlist(count)))
00083	0083    	  count = count + 1
00084	0084    	  if (count.ge.9) goto 77
00085	0085    	end do
00086	0086    77	whatlist(count) = '         '
00087	0087    *
00088	0088    	do while (cli$get_value ('WHERE',innode))
00089	0089    	 count = 1
00090	0090             do while (whatlist(count).ne.'         ')
00091	0091    	     node = innode
00092	0092    	     what = whatlist(count)
00093	0093    	     call str$trim(what,what,l_what)
00094	0094    	     call str$trim(node,node,l_node)
00095	0095    	     loccol = index(node(1:l_node),'::')
00096	0096    	     if (loccol.eq.0) then
00097	0097    	  	node(1:l_node+4) = node(1:l_node)//'""::'
00098	0098    	        l_node= l_node+4
00099	0099    	     else
00100	0100    	        node(1:l_node+2) = node(1:loccol-1)//'""::'
00101	0101    	        l_node = l_node +2
00102	0102    	     endif
00103	0103    	     errnode(1:l_node-2) = node(1:l_node-4)//'::'
00104	0104    	     l_taskname = l_node+l_what+7
00105	0105    	     taskname(1:l_taskname) =
00106	0106         1          node(1:l_node)//'"TASK='//what(1:l_what)//'"'
00107	0107    		open (unit=10,readonly,access='SEQUENTIAL',status='OLD',
00108	0108         1          name=taskname(1:l_taskname),err=999)
00109	0109     
00110	0110    	    do while (.true.)
00111	0111    		l = 0
00112	0112    		read (10,100,err=222,end=400) l,line(1:l)
00113	0113    100	        format(q,a<l>)
00114	0114    222	   	if (l.lt.1) then

NODESHOW                       					27-Jun-1984 11:18:28	VAX-11 FORTRAN V3.5-62              Page   3
								27-Jun-1984 11:14:36	DRA1:[AWPSYS.DECUS.NODESHOW]NODESHOW.FOR;2  

00115	0115    			l=1
00116	0116    			line(1:2) = ' '
00117	0117    		endif
00118	0118    		call lib$put_output(line(1:l))
00119	0119    	    end do
00120	0120    *
00121	0121    400	    close (unit=10,err=410)
00122	0122    	    count = count + 1
00123	0123    	  end do	
00124	0124    	end do
00125	0125    *
00126	0126    410	call exit
00127	0127    *
00128	0128    999	call lib$stop(msg_cantfind,%val(2),what(1:l_what),
00129	0129         1         errnode(1:l_node-2))
00130	0130    	end




PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  588   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                  37   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                                 784   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG

    Total Space Allocated                 1409


ENTRY POINTS

    Address  Type  Name          

  0-00000000       NODESHOW      


VARIABLES

    Address  Type  Name              Address  Type  Name              Address  Type  Name              Address  Type  Name          

  2-00000220  I*4  COUNT           2-000000D2  CHAR ERRNODE         2-00000096  CHAR INNODE          2-00000234  I*4  L             
  2-0000019A  CHAR LINE            2-0000022C  I*4  LOCCOL          2-00000228  I*4  L_NODE          2-00000230  I*4  L_TASKNAME    
  2-00000224  I*4  L_WHAT          2-0000005A  CHAR NODE            2-0000014A  CHAR TASKNAME        2-0000010E  CHAR WHAT          


ARRAYS

    Address  Type  Name                Bytes  Dimensions

  2-00000000  CHAR WHATLIST               90  (10)

NODESHOW                       					27-Jun-1984 11:18:28	VAX-11 FORTRAN V3.5-62              Page   4
								27-Jun-1984 11:14:36	DRA1:[AWPSYS.DECUS.NODESHOW]NODESHOW.FOR;2  

LABELS

    Address   Label       Address   Label       Address   Label       Address   Label       Address   Label       Address   Label   

  0-0000002B  77        1-0000000E  100'      0-000001D2  222       0-000001FC  400       0-00000210  410       0-00000217  999     


FUNCTIONS AND SUBROUTINES REFERENCED

  Type  Name                              Type  Name                              Type  Name                            

   I*4  CLI$GET_VALUE                           FOR$CLOSE                               FOR$EXIT                        
        FOR$OPEN                           I*4  LIB$INDEX                               LIB$PUT_OUTPUT                  
        LIB$STOP                                MSG_CANTFIND                            STR$TRIM                        


COMMAND QUALIFIERS

  FORTRAN /LIST/NOOBJ NODESHOW

  /CHECK=(NOBOUNDS,OVERFLOW,NOUNDERFLOW)
  /DEBUG=(NOSYMBOLS,TRACEBACK)
  /STANDARD=(NOSYNTAX,NOSOURCE_FORM)
  /SHOW=(NOPREPROCESSOR,NOINCLUDE,MAP)
  /F77  /NOG_FLOATING  /I4  /OPTIMIZE  /WARNINGS  /NOD_LINES  /NOCROSS_REFERENCE  /NOMACHINE_CODE  /CONTINUATIONS=19


COMPILATION STATISTICS

  Run Time:           2.25 seconds
  Elapsed Time:       4.83 seconds
  Page Faults:        161
  Dynamic Memory:     98 pages
