Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Decnet traceroute

 
Paul Beaudoin
Regular Advisor

Re: Decnet traceroute

Sunil

Here is a procedure written a LONG time ago. As others have pointed out: it will work only when all nodes in the route are Phase IV and answer to NCP TELL commands.
Watch the wrapping
==========================================
$ ! Finds the network path between two nodes
$ ! It does this by NCP TELL commands and displaying the results on the
$ ! users screen. In each case the source node is asked fo the next node
$ ! and circuit to the destination and this is diplayed. The next node then
$ ! becomes the source and the process repeates until the source and
$ ! destination are the same. The destination is then asked for its ID
$ ! string and routing type. This is displayed and the procedure ends.
$ !
$ ! Author: Paul Beaudoin
$ ! Date: AUGUST 13 1988.
$ !
$ ! Files: No files are read or written by this procedure
$ !
$ ! Restrictions:
$ ! This procedure will fail if NML or DECnet account is protected on any
$ ! intervening node.
$ !
$ START:
$ ESCHEX[0,32]=%X1B !Setup escape chart.
$ ESC := 'ESCHEX' !Setup escape symbol1
$ ESCB := "''ESC'[" !Setup escape symbol2
$ WRITE SYS$OUTPUT "''escb'1;3m''escb'2J''escb'3;10H NETWORK PATH"
$ WRITE SYS$OUTPUT "''escb'0;3m
$ E= 0
$ INQ INP "Source Node for this one"
$ IF INP .NES. "" THEN GOTO SOURCE
$ E = 1
$ MC NCP SHO EXEC TO FILE.TMP
$ OPEN/READ INPT FILE.TMP
$ E_READ:
$ READ INPT REC
$ IF F$EXTRACT(0,4,REC) .NES. "Exec" THEN GOTO E_READ
$ CLOSE INPT
$ DEL/NOLOG FILE.TMP;*
$ POS = F$LOCATE("=",REC)
$ LEN = F$LOCATE("(",REC)
$ LEN = LEN-POS
$ TH_NUM = F$EXTRACT('POS+1,'LEN-1,REC)
$ POS = F$LOCATE("(",REC)
$ LEN = F$LOCATE(")",REC)
$ LEN = LEN-POS
$ TH_NAM = F$EXTRACT('POS+1,'LEN-1,REC)
$ GOTO TARGET
$ SOURCE:
$ MC NCP TELL 'INP SHO EXEC TO FILE.TMP
$ IF F$SEARCH("FILE.TMP") .EQS. "" THEN GOTO NO_NODE
$ OPEN/READ INPT FILE.TMP
$ GOTO E_READ
$ TARGET:
$ INQ INP "Target Node"
$ ASS/USER ERR.TMP SYS$ERROR
$ MC NCP TELL 'TH_NUM SHO NODE 'INP TO FILE.TMP
$ IF F$SEARCH("ERR.TMP") .NES. "" THEN GOTO NO_NODE
$ OPEN/READ INPT FILE.TMP
$ WRITE SYS$OUTPUT ""
$ WRITE SYS$OUTPUT " From Via
To"
$ WRITE SYS$OUTPUT ""
$ TG_LOOP:
$ READ INPT REC
$ IF F$LOCATE(")",REC) .EQ. F$LENGTH(REC) THEN GOTO TG_LOOP
$ CLOSE INPT
$ DEL/NOLOG FILE.TMP;*
$ T_NAM = ""
$ POS = F$LOCATE("(",REC)
$ IF POS .LT. 10 THEN GOTO GT_NAM
$ POS = 8
$ T_NAM = "UNKNWN"
$ GT_NAM:
$ T_NUM = F$EXTRACT(0,'POS-1,REC)
$ IF T_NAM .EQS. "UNKNWN" THEN GOTO GET_FIRST
$ LEN = F$LOCATE(")",REC)
$ LEN = LEN - POS
$ T_NAM = F$EXTRACT('POS+1,'LEN-1,REC)
$ GET_FIRST:
$ REC = F$EXTRACT(46,33,REC)
$ POS = F$LOCATE(".",REC)
$ CIRC = F$EXTRACT(0,'POS-3,REC)
$ LEN = F$LOCATE("(",REC)
$ LEN = LEN-POS
$ NX_NUM = F$EXTRACT('POS-2,'LEN+2,REC)
$ NX_NAM = "UNKNWN"
$ IF LEN .GT. 6 THEN GOTO GET_LOOP
$ POS = F$LOCATE("(",REC)
$ LEN = F$LOCATE(")",REC)
$ LEN = LEN-POS
$ NX_NAM = F$EXTRACT('POS+1,'LEN-1,REC)
$ GET_LOOP:
$ PS_NUM[1,7] := 'TH_NUM
$ PS_NAM[1,6] := 'TH_NAM
$ P_CIRC[1,15] := 'CIRC
$ PT_NUM[1,7] := 'NX_NUM
$ PT_NAM[1,6] := 'NX_NAM
$ WRITE SYS$OUTPUT PS_NUM," ",PS_NAM," ==> ",P_CIRC," ==> ",PT_NUM,
" ",PT_NAM
$ IF F$EDIT(NX_NUM,"TRIM") .EQS. F$EDIT(T_NUM,"TRIM") THEN GOTO ENDE
$ TH_NUM = NX_NUM
$ TH_NAM = NX_NAM
$ ASS/USER ERR.TMP SYS$ERROR
$ MC NCP TELL 'NX_NUM SHO NODE 'T_NUM TO FILE.TMP
$ IF F$SEARCH("ERR.TMP") .NES. "" THEN GOTO NO_NODE
$ OPEN/READ INPT FILE.TMP
$ CT = 7
$ N_LOOP:
$ READ INPT REC
$ CT = CT - 1
$ IF CT .GE. 0 THEN GOTO N_LOOP
$ CLOSE INPT
$ DEL/NOLOG FILE.TMP;*
$ REC = F$EXTRACT(46,33,REC)
$ POS = F$LOCATE(".",REC)
$ CIRC = F$EXTRACT(0,'POS-3,REC)
$ LEN = F$LOCATE("(",REC)
$ LEN = LEN-POS
$ NX_NUM = F$EXTRACT('POS-2,'LEN+2,REC)
$ NX_NAM = "UNKNWN"
$ IF LEN .GT. 6 THEN GOTO GET_LOOP
$ POS = F$LOCATE("(",REC)
$ LEN = F$LOCATE(")",REC)
$ LEN = LEN-POS
$ NX_NAM = F$EXTRACT('POS+1,'LEN-1,REC)
$ GOTO GET_LOOP
$ NO_NODE:
$ WRITE SYS$OUTPUT "Next node not responding"
$ IF F$SEARCH("*.TMP") .NES. "" THEN DEL/NOLOG *.TMP;*
$ INQ INP "Press Return to Exit"
$ EXIT
$ ENDE:
$ ASS/USER ERR.TMP SYS$ERROR
$ MC NCP TELL 'T_NUM SHO EXEC CHAR TO FILE.TMP
$ IF F$SEARCH("ERR.TMP") .NES. "" THEN GOTO NO_NODE
$ OPEN/READ INPT FILE.TMP
$ END_LOOP:
$ READ INPT REC
$ IF F$EXTRACT(0,4,REC) .NES. "Iden" THEN GOTO END_LOOP
$ WRITE SYS$OUTPUT T_NUM," ",T_NAM," ",F$EXTRACT(25,40,REC)
$ END_LOOP2:
$ READ INPT REC
$ IF F$EXTRACT(0,4,REC) .NES. "Type" THEN GOTO END_LOOP2
$ WRITE SYS$OUTPUT T_NUM," ",T_NAM," ",F$EXTRACT(25,30,REC)
$ CLOSE INPT
$ DEL/NOLOG *.TMP;*
$ WRITE SYS$OUTPUT ""
$ INQ INP "Press RETURN to exit"
$ EXIT
Sunil Kunnel
Occasional Advisor

Re: Decnet traceroute

Thanks to all for the help.
Highlighted
JohnDite
Frequent Advisor

Re: Decnet traceroute

For a matter of completeness nobody in this thread referred to DECNET_MIGRATE SHOW PATH command. See DECnet Management and/or Problem Solving Guide