NVSSTB ;MB/SLCOIFO START BROKER,MAILMAN,TASKMAN
;;2.0;;NVSMENU;;Build 19
; originally written by Mike Boggess SLCOIFO 4/28/03
; bpn/hsp modified for IRIS 02/03/20
; ------------------------------------------------------------------------
; check for Cache
;I $ZV'["Cache" W !,"This routine is for Cache systems only." Q
;call NVSSTM if Cache 2011 or greater; added itanium 2/14/13 bjs
I $$OS^%ZOSV="UNIX"&($E($P($ZV,"x86-64)",2),2,10)>2011) G ^NVSSTM
I $$OS^%ZOSV="UNIX"&($E($P($ZV,"x86-32)",2),2,10)>2011) G ^NVSSTM
I $$OS^%ZOSV="VMS"&($E($P($ZV,"(Alpha)",2),2,10)>2011) G ^NVSSTM
I $$OS^%ZOSV="VMS"&($E($P($ZV,"(Itanium)",2),2,10)>2011) G ^NVSSTM
; VMS/Cache only...
;
I $$OS^%ZOSV()'="VMS" W !,"This routine is for VMS/Cache systems only." Q
;
I $G(IOF)="" D HOME^%ZIS
S NVSNODE=$ZU(110)
S NVSVOL=$ZU(5)
S NVSCFG=$P($ZU(86),"*",2)
F D Q:$D(DIRUT)
.I $G(IOF)'="" W @IOF
.W !!,$$CJ^XLFSTR("START/STOP BROKER LISTENER(S), TASK MANAGER AND NETWORK MAIL LISTENER",80)
.W !!,$$CJ^XLFSTR("** NOTE **",80)
.W !,$$CJ^XLFSTR("Task Manager and any Broker listener(s) on this node",80)
.W !,$$CJ^XLFSTR("must be started by a call to a VMS command file to insure that",80)
.W !,$$CJ^XLFSTR("these processes are started with the appropriate privileges.",80)
.W !,$$CJ^XLFSTR("**********",80)
.W !!?3,"Current Node : ",NVSNODE
.W !?3,"Namespace : ",NVSVOL
.W !?3,"Cache Config : ",NVSCFG
.; -----------------------------------------------------------------------------------
.S DIR(0)="NA^1:7"
.S DIR("A",1)=" 1 = Start Task Manager for config "_NVSCFG_" on node "_NVSNODE
.S DIR("A",2)=" 2 = Start Broker Listener(s) for config "_NVSCFG_" on node "_NVSNODE
.S DIR("A",3)=" 3 = Start Network Mail Listener for config "_NVSCFG_" on node "_NVSNODE
.S DIR("A",4)=" 4 = Start All (TM, Broker, Network Mail) for config "_NVSCFG_" on node "_NVSNODE
.S DIR("A",5)=" 5 = Stop Task Manager and Sub-managers for config "_NVSCFG_" on node "_NVSNODE
.S DIR("A",6)=" 6 = Stop Broker Listener(s) for config "_NVSCFG_" on node "_NVSNODE
.S DIR("A",7)=" 7 = Exit"
.S DIR("A",8)=" "
.S DIR("A")=" Select OPTION NUMBER (1-7): "
.S DIR("B")=7
.S DIR("?")="or enter ""^"" to exit."
.S DIR("?",1)="?? Please enter an OPTION NUMBER, 1 through 7"
.W ! D ^DIR K DIR
.I Y=7 S DIRUT=1
.I $D(DIRUT) Q
.S NVSANS=Y
.I NVSANS=1 D TM Q
.I NVSANS=2 D BL Q
.I NVSANS=3 D ML Q
.I NVSANS=4 D Q
..D TM
..D BL
..D ML
.I NVSANS=5 D STM Q
.I NVSANS=6 D SBL
K DIRUT,DTOUT,NVSANS,NVSCFG,NVSNODE,NVSVOL,X,Y
Q
;
TM ; start Task Manager...
;check TM status
D RUN^ZTMON
I $D(^%ZTSCH("STATUS")) W !!,"It appears Taskman is already running for config ",NVSCFG
K DIR S DIR(0)="Y",DIR("A")="Are you sure you want to start Taskman",DIR("B")="NO"
W ! D ^DIR K DIR
Q:$D(DIRUT)!(Y'=1)
;
N DIR,DIRUT,DTOUT,X,Y
I NVSVOL="VAH" D
.W !!,"Submitting batch job for USER$:[CACHEMGR]TASKMAN_START.COM to start"
.W !,"TaskMan in VAH..."
.S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TASKMAN_START.COM")
I NVSVOL'="VAH" D
.W !!,"Submitting batch job for USER$:[CACHEMGR]",NVSVOL,"_TASKMAN_START.COM to"
.W !,"start TaskMan in ",NVSVOL,"..."
.S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]"_NVSVOL_"_TASKMAN_START.COM")
;I NVSVOL="TST" S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TST_TASKMAN_START.COM")
;I NVSVOL'="VAH"&(NVSVOL'="TST") W !!,$C(7),"This Configuration is not VAH or TST."
S DIR(0)="EA"
S DIR("A")="Press <enter> to return to the main menu..."
W ! D ^DIR K DIR
Q
;
BL ;check/start Broker Listeners...
W !!,"Checking for existing TCPIP Broker Services...",!
S NVSBLTCP=0
S HFSDIR=$P($G(^XTV(8989.3,1,"DEV")),"^") S:HFSDIR="" HFSDIR="USER$:[TEMP]"
S X=$ZF(-1,"TCPIP SHOW SERVICE/OUTPUT="_HFSDIR_"NVSBLTCP.TXT")
S X=$$FTG^%ZISH(HFSDIR,"NVSBLTCP.TXT","NVSTEMP(1)",1,"OVF")
I X=0 W !,"TCPIP SERVICE LISTING NOT AVAILABLE - CHECK VMS DIRECTORY ",HFSDIR
S NVS=0
F S NVS=$O(NVSTEMP(NVS)) Q:NVS="" D
.S NVSTCPIP=$G(NVSTEMP(NVS))
.I NVSTCPIP["BROKER" I NVSTCPIP["Enabled" W !,NVSTCPIP S NVSBLTCP=1
.K NVSTCPIP
.Q
I NVSBLTCP=1 D
.W !!,"It appears you are running the Broker Listener as a TCPIP Service."
.Q
S X=$ZF(-1,"DEL/NOLOG/NOCONFIRM "_HFSDIR_"NVSBLTCP.TXT;")
K HFSDIR,NVSBLTCP,NVSTEMP,NVS,X
K DIR S DIR(0)="Y",DIR("A")="Are you sure you want to do this",DIR("B")="NO"
W ! D ^DIR K DIR
Q:$D(DIRUT)!(Y'=1)
; -- submit to sys$batch --
N DIR,DIRUT,DTOUT,X,Y
I NVSVOL="VAH" D
.W !!,"Submitting batch job for USER$:[CACHEMGR]BROKER_START.COM to start Broker"
.W !,"listener(s) in VAH..."
.S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]BROKER_START.COM")
I NVSVOL'="VAH" D
.W !!,"Submitting batch job for USER$:[CACHEMGR]",NVSVOL,"_BROKER_START.COM to"
.W !,"start Broker listener(s) in ",NVSVOL,"..."
.S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]"_NVSVOL_"_BROKER_START.COM")
;I NVSVOL="TST" S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TST_BROKER_START.COM")
;I NVSVOL'="VAH"&(NVSVOL'="TST") W !!,$C(7),"This Configuration is not VAH or TST."
S DIR(0)="EA"
S DIR("A")="Press <enter> to return to the main menu..."
W ! D ^DIR K DIR
Q
;
ML ; check/start network mail listener if tcpip service not used...
W !!,"Checking for existing TCPIP XMINETMM Service...",!
S NVSXMTCP=0
S HFSDIR=$P($G(^XTV(8989.3,1,"DEV")),"^") S:HFSDIR="" HFSDIR="USER$:[TEMP]"
S X=$ZF(-1,"TCPIP SHOW SERVICE/OUTPUT="_HFSDIR_"NVSXMTCP.TXT")
S X=$$FTG^%ZISH(HFSDIR,"NVSXMTCP.TXT","NVSTEMP(1)",1,"OVF")
I X=0 W !,"TCPIP SERVICE LISTING NOT AVAILABLE - CHECK VMS DIRECTORY ",HFSDIR
S NVS=0
F S NVS=$O(NVSTEMP(NVS)) Q:NVS="" D
.S NVSTCPIP=$G(NVSTEMP(NVS))
.I NVSTCPIP["XMINETMM" I NVSTCPIP[" 25 TCP" W !,NVSTCPIP S NVSXMTCP=1
.K NVSTCPIP
.Q
I NVSXMTCP=1 D
.W !!,"It appears you are running mailman as a TCPIP Service that is using port 25."
.W !,"Attempting to use this option will fail since it also wants to use port 25."
.Q
S X=$ZF(-1,"DEL/NOLOG/NOCONFIRM "_HFSDIR_"NVSXMTCP.TXT;")
K HFSDIR,NVSXMTCP,NVSTEMP,NVS,X
K DIR S DIR(0)="Y",DIR("A")="Are you sure you want to do this",DIR("B")="NO"
W ! D ^DIR K DIR
Q:$D(DIRUT)!(Y'=1)
;
W !!,"JOBbing the routine ^XMRONT..."
J ^XMRONT::5
I $T'=1 W !?2,"ERROR -- the command JOB ^XMRONT failed!"
I $T=1 W "JOB command executed successfully."
S DIR(0)="EA"
S DIR("A")="Press <enter> to return to the main menu..."
W ! D ^DIR K DIR
Q
;
STM ; stop Task Manager and Sub-managers...
N DIR,DIRUT,DTOUT,NVSTMLIS,NVSTMPID,X,Y
D TMSTAT(.NVSTMLIS)
I +$G(NVSTMLIS)=0 D Q
.S DIR(0)="EA"
.S DIR("A")="Press <enter> to return to main menu..."
.W ! D ^DIR K DIR
W !
S NVSTMNOD=""
F S NVSTMNOD=$O(NVSTMLIS(NVSTMNOD)) Q:NVSTMNOD=""!($D(DIRUT)) D
.S DIR(0)="YA"
.S DIR("A")="Stop Task Manager in "_NVSTMNOD_"? "
.S DIR("B")="NO"
.S DIR("?")="Answer YES or NO, or enter ""^"" to abort"
.D ^DIR K DIR
.I $D(DIRUT) Q
.I Y'=1 Q
.W !?2,"stopping the manager..."
.D SMAN^ZTMKU(NVSTMNOD)
.S NVSTMPID=NVSTMLIS(NVSTMNOD)
.F I=1:1:10 Q:'$D(^%ZTSCH("STATUS",NVSTMPID)) W "." H 1
.I $D(^%ZTSCH("STATUS",NVSTMNOD)) W !?2,"ERROR -- Manager job would not stop!" Q
.W "done."
.W !?2,"stopping any idle sub-manager(s)..."
.D SSUB^ZTMKU(NVSTMNOD)
.W "done."
K DIRUT,DTOUT,NVSTMNOD,X,Y
S DIR(0)="EA"
S DIR("A")="Press <enter> to return to the main menu..."
W ! D ^DIR K DIR
Q
;
TMSTAT(LIST) ; check and list current Task Manager status...
; LIST = an array name passed by reference into which current TM jobs are listed
; returns LIST=number of TM manager jobs in ^%ZTSCH("STATUS")
; LIST(node name)=TM job status line from ^%ZTSCH("STATUS",pid)
N NVSTMDAT,NVSTMPID
S LIST=0
W !!,"Current Task Manager status:"
I '+$O(^%ZTSCH("STATUS",0)) D Q
.W $C(7)
.W !,"**NO TASK MANAGER JOBS FOUND IN ^%ZTSCH(""STATUS"")!**"
W !!,"Process ID"
W ?20,"Node"
W ?35,"Status"
S NVSTMPID=0
F S NVSTMPID=$O(^%ZTSCH("STATUS",NVSTMPID)) Q:'NVSTMPID D
.S NVSTMDAT=^%ZTSCH("STATUS",NVSTMPID)
.W !,NVSTMPID
.W ?20,$P(NVSTMDAT,"^",3)
.W ?35,$P(NVSTMDAT,"^",2)," ",$P(NVSTMDAT,"^",4)
.S LIST=LIST+1
.S LIST($P(NVSTMDAT,"^",3))=NVSTMPID
.K NVSTMDAT
Q
;
SBL ; stop broker listener...
N base,maxpid,DIR,DIRUT,DTOUT,NVSBDEV,NVSBLIS,NVSBPORT,NVSJPID,NVSROU,X,Y
; search process table for Broker listener(s)...
S NVSBLIS=0
s base=$v($zu(40,2,47),-2,"S")
s maxpid=$v($zu(40,2,118),-2,4)
W !!,"Searching process table for any Broker listener(s) running in"
W !,"configuration ",NVSCFG,"..."
f i=1:1:maxpid s NVSJPID=$v(i*4+base,-3,4) I NVSJPID>0 D
.S NVSROU=$ZU(67,5,NVSJPID)
.I NVSROU'="XWBTCPL" K NVSROU Q
.S NVSBDEV=$ZU(67,7,NVSJPID)
.I NVSBDEV="" K NVSBDEV,NVSROU Q
.S NVSBLIS=NVSBLIS+1
.S NVSBLIS($P(NVSBDEV,"|",3))=""
.K NVSBDEV,NVSROU
I NVSBLIS=0 W !!,"**NO Broker listener jobs were found here!**"
I NVSBLIS>0 D K DIRUT,DTOUT,X,Y
.W !!,"Broker listener job",$S(NVSBLIS>1:"s",1:"")," found on "
.W $S(NVSBLIS>1:"these ",1:"this "),"port",$S(NVSBLIS>1:"s:",1:":")
.S NVSBPORT=0
.F S NVSBPORT=$O(NVSBLIS(NVSBPORT)) Q:'NVSBPORT W !?2,NVSBPORT
.F D Q:$D(DIRUT)
..S DIR(0)="NA^"_+$O(NVSBLIS(0))_":"_+$O(NVSBLIS(""),-1)_"^K:'$D(NVSBLIS(X)) X"
..S DIR("A")="Stop Broker Listener on PORT: "
..I NVSBLIS=1 S DIR("B")=+$O(NVSBLIS(0))
..S DIR("?")="Enter a PORT NUMBER from the list above"
..W ! D ^DIR K DIR
..I $D(DIRUT) Q
..S NVSBPORT=+Y
..W !?2,"Calling STOP^XWBTCP(",NVSBPORT,")..."
..D STOP^XWBTCP(NVSBPORT)
..K NVSBPORT
..I NVSBLIS=1 S DIRUT=1
S DIR(0)="EA"
S DIR("A")="Press <enter> to return to the main menu..."
W ! D ^DIR K DIR
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNVSSTB 9855 printed Nov 22, 2024@17:27:43 Page 2
NVSSTB ;MB/SLCOIFO START BROKER,MAILMAN,TASKMAN
+1 ;;2.0;;NVSMENU;;Build 19
+2 ; originally written by Mike Boggess SLCOIFO 4/28/03
+3 ; bpn/hsp modified for IRIS 02/03/20
+4 ; ------------------------------------------------------------------------
+5 ; check for Cache
+6 ;I $ZV'["Cache" W !,"This routine is for Cache systems only." Q
+7 ;call NVSSTM if Cache 2011 or greater; added itanium 2/14/13 bjs
+8 IF $$OS^%ZOSV="UNIX"&($EXTRACT($PIECE($ZV,"x86-64)",2),2,10)>2011)
GOTO ^NVSSTM
+9 IF $$OS^%ZOSV="UNIX"&($EXTRACT($PIECE($ZV,"x86-32)",2),2,10)>2011)
GOTO ^NVSSTM
+10 IF $$OS^%ZOSV="VMS"&($EXTRACT($PIECE($ZV,"(Alpha)",2),2,10)>2011)
GOTO ^NVSSTM
+11 IF $$OS^%ZOSV="VMS"&($EXTRACT($PIECE($ZV,"(Itanium)",2),2,10)>2011)
GOTO ^NVSSTM
+12 ; VMS/Cache only...
+13 ;
+14 IF $$OS^%ZOSV()'="VMS"
WRITE !,"This routine is for VMS/Cache systems only."
QUIT
+15 ;
+16 IF $GET(IOF)=""
DO HOME^%ZIS
+17 SET NVSNODE=$ZU(110)
+18 SET NVSVOL=$ZU(5)
+19 SET NVSCFG=$PIECE($ZU(86),"*",2)
+20 FOR
Begin DoDot:1
+21 IF $GET(IOF)'=""
WRITE @IOF
+22 WRITE !!,$$CJ^XLFSTR("START/STOP BROKER LISTENER(S), TASK MANAGER AND NETWORK MAIL LISTENER",80)
+23 WRITE !!,$$CJ^XLFSTR("** NOTE **",80)
+24 WRITE !,$$CJ^XLFSTR("Task Manager and any Broker listener(s) on this node",80)
+25 WRITE !,$$CJ^XLFSTR("must be started by a call to a VMS command file to insure that",80)
+26 WRITE !,$$CJ^XLFSTR("these processes are started with the appropriate privileges.",80)
+27 WRITE !,$$CJ^XLFSTR("**********",80)
+28 WRITE !!?3,"Current Node : ",NVSNODE
+29 WRITE !?3,"Namespace : ",NVSVOL
+30 WRITE !?3,"Cache Config : ",NVSCFG
+31 ; -----------------------------------------------------------------------------------
+32 SET DIR(0)="NA^1:7"
+33 SET DIR("A",1)=" 1 = Start Task Manager for config "_NVSCFG_" on node "_NVSNODE
+34 SET DIR("A",2)=" 2 = Start Broker Listener(s) for config "_NVSCFG_" on node "_NVSNODE
+35 SET DIR("A",3)=" 3 = Start Network Mail Listener for config "_NVSCFG_" on node "_NVSNODE
+36 SET DIR("A",4)=" 4 = Start All (TM, Broker, Network Mail) for config "_NVSCFG_" on node "_NVSNODE
+37 SET DIR("A",5)=" 5 = Stop Task Manager and Sub-managers for config "_NVSCFG_" on node "_NVSNODE
+38 SET DIR("A",6)=" 6 = Stop Broker Listener(s) for config "_NVSCFG_" on node "_NVSNODE
+39 SET DIR("A",7)=" 7 = Exit"
+40 SET DIR("A",8)=" "
+41 SET DIR("A")=" Select OPTION NUMBER (1-7): "
+42 SET DIR("B")=7
+43 SET DIR("?")="or enter ""^"" to exit."
+44 SET DIR("?",1)="?? Please enter an OPTION NUMBER, 1 through 7"
+45 WRITE !
DO ^DIR
KILL DIR
+46 IF Y=7
SET DIRUT=1
+47 IF $DATA(DIRUT)
QUIT
+48 SET NVSANS=Y
+49 IF NVSANS=1
DO TM
QUIT
+50 IF NVSANS=2
DO BL
QUIT
+51 IF NVSANS=3
DO ML
QUIT
+52 IF NVSANS=4
Begin DoDot:2
+53 DO TM
+54 DO BL
+55 DO ML
End DoDot:2
QUIT
+56 IF NVSANS=5
DO STM
QUIT
+57 IF NVSANS=6
DO SBL
End DoDot:1
if $DATA(DIRUT)
QUIT
+58 KILL DIRUT,DTOUT,NVSANS,NVSCFG,NVSNODE,NVSVOL,X,Y
+59 QUIT
+60 ;
TM ; start Task Manager...
+1 ;check TM status
+2 DO RUN^ZTMON
+3 IF $DATA(^%ZTSCH("STATUS"))
WRITE !!,"It appears Taskman is already running for config ",NVSCFG
+4 KILL DIR
SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to start Taskman"
SET DIR("B")="NO"
+5 WRITE !
DO ^DIR
KILL DIR
+6 if $DATA(DIRUT)!(Y'=1)
QUIT
+7 ;
+8 NEW DIR,DIRUT,DTOUT,X,Y
+9 IF NVSVOL="VAH"
Begin DoDot:1
+10 WRITE !!,"Submitting batch job for USER$:[CACHEMGR]TASKMAN_START.COM to start"
+11 WRITE !,"TaskMan in VAH..."
+12 SET X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TASKMAN_START.COM")
End DoDot:1
+13 IF NVSVOL'="VAH"
Begin DoDot:1
+14 WRITE !!,"Submitting batch job for USER$:[CACHEMGR]",NVSVOL,"_TASKMAN_START.COM to"
+15 WRITE !,"start TaskMan in ",NVSVOL,"..."
+16 SET X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]"_NVSVOL_"_TASKMAN_START.COM")
End DoDot:1
+17 ;I NVSVOL="TST" S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TST_TASKMAN_START.COM")
+18 ;I NVSVOL'="VAH"&(NVSVOL'="TST") W !!,$C(7),"This Configuration is not VAH or TST."
+19 SET DIR(0)="EA"
+20 SET DIR("A")="Press <enter> to return to the main menu..."
+21 WRITE !
DO ^DIR
KILL DIR
+22 QUIT
+23 ;
BL ;check/start Broker Listeners...
+1 WRITE !!,"Checking for existing TCPIP Broker Services...",!
+2 SET NVSBLTCP=0
+3 SET HFSDIR=$PIECE($GET(^XTV(8989.3,1,"DEV")),"^")
if HFSDIR=""
SET HFSDIR="USER$:[TEMP]"
+4 SET X=$ZF(-1,"TCPIP SHOW SERVICE/OUTPUT="_HFSDIR_"NVSBLTCP.TXT")
+5 SET X=$$FTG^%ZISH(HFSDIR,"NVSBLTCP.TXT","NVSTEMP(1)",1,"OVF")
+6 IF X=0
WRITE !,"TCPIP SERVICE LISTING NOT AVAILABLE - CHECK VMS DIRECTORY ",HFSDIR
+7 SET NVS=0
+8 FOR
SET NVS=$ORDER(NVSTEMP(NVS))
if NVS=""
QUIT
Begin DoDot:1
+9 SET NVSTCPIP=$GET(NVSTEMP(NVS))
+10 IF NVSTCPIP["BROKER"
IF NVSTCPIP["Enabled"
WRITE !,NVSTCPIP
SET NVSBLTCP=1
+11 KILL NVSTCPIP
+12 QUIT
End DoDot:1
+13 IF NVSBLTCP=1
Begin DoDot:1
+14 WRITE !!,"It appears you are running the Broker Listener as a TCPIP Service."
+15 QUIT
End DoDot:1
+16 SET X=$ZF(-1,"DEL/NOLOG/NOCONFIRM "_HFSDIR_"NVSBLTCP.TXT;")
+17 KILL HFSDIR,NVSBLTCP,NVSTEMP,NVS,X
+18 KILL DIR
SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to do this"
SET DIR("B")="NO"
+19 WRITE !
DO ^DIR
KILL DIR
+20 if $DATA(DIRUT)!(Y'=1)
QUIT
+21 ; -- submit to sys$batch --
+22 NEW DIR,DIRUT,DTOUT,X,Y
+23 IF NVSVOL="VAH"
Begin DoDot:1
+24 WRITE !!,"Submitting batch job for USER$:[CACHEMGR]BROKER_START.COM to start Broker"
+25 WRITE !,"listener(s) in VAH..."
+26 SET X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]BROKER_START.COM")
End DoDot:1
+27 IF NVSVOL'="VAH"
Begin DoDot:1
+28 WRITE !!,"Submitting batch job for USER$:[CACHEMGR]",NVSVOL,"_BROKER_START.COM to"
+29 WRITE !,"start Broker listener(s) in ",NVSVOL,"..."
+30 SET X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]"_NVSVOL_"_BROKER_START.COM")
End DoDot:1
+31 ;I NVSVOL="TST" S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TST_BROKER_START.COM")
+32 ;I NVSVOL'="VAH"&(NVSVOL'="TST") W !!,$C(7),"This Configuration is not VAH or TST."
+33 SET DIR(0)="EA"
+34 SET DIR("A")="Press <enter> to return to the main menu..."
+35 WRITE !
DO ^DIR
KILL DIR
+36 QUIT
+37 ;
ML ; check/start network mail listener if tcpip service not used...
+1 WRITE !!,"Checking for existing TCPIP XMINETMM Service...",!
+2 SET NVSXMTCP=0
+3 SET HFSDIR=$PIECE($GET(^XTV(8989.3,1,"DEV")),"^")
if HFSDIR=""
SET HFSDIR="USER$:[TEMP]"
+4 SET X=$ZF(-1,"TCPIP SHOW SERVICE/OUTPUT="_HFSDIR_"NVSXMTCP.TXT")
+5 SET X=$$FTG^%ZISH(HFSDIR,"NVSXMTCP.TXT","NVSTEMP(1)",1,"OVF")
+6 IF X=0
WRITE !,"TCPIP SERVICE LISTING NOT AVAILABLE - CHECK VMS DIRECTORY ",HFSDIR
+7 SET NVS=0
+8 FOR
SET NVS=$ORDER(NVSTEMP(NVS))
if NVS=""
QUIT
Begin DoDot:1
+9 SET NVSTCPIP=$GET(NVSTEMP(NVS))
+10 IF NVSTCPIP["XMINETMM"
IF NVSTCPIP[" 25 TCP"
WRITE !,NVSTCPIP
SET NVSXMTCP=1
+11 KILL NVSTCPIP
+12 QUIT
End DoDot:1
+13 IF NVSXMTCP=1
Begin DoDot:1
+14 WRITE !!,"It appears you are running mailman as a TCPIP Service that is using port 25."
+15 WRITE !,"Attempting to use this option will fail since it also wants to use port 25."
+16 QUIT
End DoDot:1
+17 SET X=$ZF(-1,"DEL/NOLOG/NOCONFIRM "_HFSDIR_"NVSXMTCP.TXT;")
+18 KILL HFSDIR,NVSXMTCP,NVSTEMP,NVS,X
+19 KILL DIR
SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to do this"
SET DIR("B")="NO"
+20 WRITE !
DO ^DIR
KILL DIR
+21 if $DATA(DIRUT)!(Y'=1)
QUIT
+22 ;
+23 WRITE !!,"JOBbing the routine ^XMRONT..."
+24 JOB ^XMRONT::5
+25 IF $TEST'=1
WRITE !?2,"ERROR -- the command JOB ^XMRONT failed!"
+26 IF $TEST=1
WRITE "JOB command executed successfully."
+27 SET DIR(0)="EA"
+28 SET DIR("A")="Press <enter> to return to the main menu..."
+29 WRITE !
DO ^DIR
KILL DIR
+30 QUIT
+31 ;
STM ; stop Task Manager and Sub-managers...
+1 NEW DIR,DIRUT,DTOUT,NVSTMLIS,NVSTMPID,X,Y
+2 DO TMSTAT(.NVSTMLIS)
+3 IF +$GET(NVSTMLIS)=0
Begin DoDot:1
+4 SET DIR(0)="EA"
+5 SET DIR("A")="Press <enter> to return to main menu..."
+6 WRITE !
DO ^DIR
KILL DIR
End DoDot:1
QUIT
+7 WRITE !
+8 SET NVSTMNOD=""
+9 FOR
SET NVSTMNOD=$ORDER(NVSTMLIS(NVSTMNOD))
if NVSTMNOD=""!($DATA(DIRUT))
QUIT
Begin DoDot:1
+10 SET DIR(0)="YA"
+11 SET DIR("A")="Stop Task Manager in "_NVSTMNOD_"? "
+12 SET DIR("B")="NO"
+13 SET DIR("?")="Answer YES or NO, or enter ""^"" to abort"
+14 DO ^DIR
KILL DIR
+15 IF $DATA(DIRUT)
QUIT
+16 IF Y'=1
QUIT
+17 WRITE !?2,"stopping the manager..."
+18 DO SMAN^ZTMKU(NVSTMNOD)
+19 SET NVSTMPID=NVSTMLIS(NVSTMNOD)
+20 FOR I=1:1:10
if '$DATA(^%ZTSCH("STATUS",NVSTMPID))
QUIT
WRITE "."
HANG 1
+21 IF $DATA(^%ZTSCH("STATUS",NVSTMNOD))
WRITE !?2,"ERROR -- Manager job would not stop!"
QUIT
+22 WRITE "done."
+23 WRITE !?2,"stopping any idle sub-manager(s)..."
+24 DO SSUB^ZTMKU(NVSTMNOD)
+25 WRITE "done."
End DoDot:1
+26 KILL DIRUT,DTOUT,NVSTMNOD,X,Y
+27 SET DIR(0)="EA"
+28 SET DIR("A")="Press <enter> to return to the main menu..."
+29 WRITE !
DO ^DIR
KILL DIR
+30 QUIT
+31 ;
TMSTAT(LIST) ; check and list current Task Manager status...
+1 ; LIST = an array name passed by reference into which current TM jobs are listed
+2 ; returns LIST=number of TM manager jobs in ^%ZTSCH("STATUS")
+3 ; LIST(node name)=TM job status line from ^%ZTSCH("STATUS",pid)
+4 NEW NVSTMDAT,NVSTMPID
+5 SET LIST=0
+6 WRITE !!,"Current Task Manager status:"
+7 IF '+$ORDER(^%ZTSCH("STATUS",0))
Begin DoDot:1
+8 WRITE $CHAR(7)
+9 WRITE !,"**NO TASK MANAGER JOBS FOUND IN ^%ZTSCH(""STATUS"")!**"
End DoDot:1
QUIT
+10 WRITE !!,"Process ID"
+11 WRITE ?20,"Node"
+12 WRITE ?35,"Status"
+13 SET NVSTMPID=0
+14 FOR
SET NVSTMPID=$ORDER(^%ZTSCH("STATUS",NVSTMPID))
if 'NVSTMPID
QUIT
Begin DoDot:1
+15 SET NVSTMDAT=^%ZTSCH("STATUS",NVSTMPID)
+16 WRITE !,NVSTMPID
+17 WRITE ?20,$PIECE(NVSTMDAT,"^",3)
+18 WRITE ?35,$PIECE(NVSTMDAT,"^",2)," ",$PIECE(NVSTMDAT,"^",4)
+19 SET LIST=LIST+1
+20 SET LIST($PIECE(NVSTMDAT,"^",3))=NVSTMPID
+21 KILL NVSTMDAT
End DoDot:1
+22 QUIT
+23 ;
SBL ; stop broker listener...
+1 NEW base,maxpid,DIR,DIRUT,DTOUT,NVSBDEV,NVSBLIS,NVSBPORT,NVSJPID,NVSROU,X,Y
+2 ; search process table for Broker listener(s)...
+3 SET NVSBLIS=0
+4
*** ERROR ***