1 | NVSSTB ;slciofo/mdb-options for VMS/Cache systems to start TM/Broker/MailMan; 04/01/04
|
---|
2 | ;;2.0;EMC SYSTEM UTILITIES; Apr 28, 2003
|
---|
3 | ;
|
---|
4 | ;Options to manually start and stop Taskman, Broker Listener(s) and the
|
---|
5 | ;network mail background listener.
|
---|
6 | ;
|
---|
7 | ; *****NOTE*****
|
---|
8 | ; additions made by MW@VISN20 on 9/9/04 to include options to
|
---|
9 | ; stop TaskMan and Broker listener(s).
|
---|
10 | ; **************
|
---|
11 | ;
|
---|
12 | ; the function OS^%ZOSV is not present in DSM systems, check for DSM system...
|
---|
13 | I $ZV'["Cache for OpenVMS" W !,"This routine is for Cache systems only." Q
|
---|
14 | ; VMS/Cache only...
|
---|
15 | I $$OS^%ZOSV()'="VMS" W !,"This routine is for VMS/Cache systems only." Q
|
---|
16 | ;
|
---|
17 | I $G(IOF)="" D HOME^%ZIS
|
---|
18 | S NVSVOL=$ZU(5)
|
---|
19 | S NVSCFG=$P($ZU(86),"*",2)
|
---|
20 | F D Q:$D(DIRUT)
|
---|
21 | .I $G(IOF)'="" W @IOF
|
---|
22 | .W !!,$$CJ^XLFSTR("START/STOP BROKER LISTENER(S), TASK MANAGER AND NETWORK MAIL LISTENER",80)
|
---|
23 | .W !!,$$CJ^XLFSTR("** NOTE **",80)
|
---|
24 | .W !,$$CJ^XLFSTR("Task Manager and any Broker listener(s) on this node",80)
|
---|
25 | .W !,$$CJ^XLFSTR("must be started by a call to a VMS command file to insure that",80)
|
---|
26 | .W !,$$CJ^XLFSTR("these processes are started with the appropriate privileges.",80)
|
---|
27 | .W !,$$CJ^XLFSTR("**********",80)
|
---|
28 | .W !!?3,"Current Node : ",$ZU(110)
|
---|
29 | .W !?3,"Namespace : ",NVSVOL
|
---|
30 | .W !?3,"Cache Config : ",NVSCFG
|
---|
31 | .S DIR(0)="NA^1:7"
|
---|
32 | .S DIR("A",1)=" 1 = Manually Start Task Manager"
|
---|
33 | .S DIR("A",2)=" 2 = Manually Start Broker Listener(s)"
|
---|
34 | .S DIR("A",3)=" 3 = Manually Start Network Mail Listener"
|
---|
35 | .S DIR("A",4)=" 4 = Manually Start All (Task Manager, Broker, Network Mail Listener)"
|
---|
36 | .S DIR("A",5)=" 5 = Stop Task Manager and Sub-managers"
|
---|
37 | .S DIR("A",6)=" 6 = Stop Broker Listener(s)"
|
---|
38 | .S DIR("A",7)=" 7 = Exit"
|
---|
39 | .S DIR("A",8)=" "
|
---|
40 | .S DIR("A")=" Select OPTION NUMBER (1-7): "
|
---|
41 | .S DIR("B")=7
|
---|
42 | .S DIR("?")="or enter ""^"" to exit."
|
---|
43 | .S DIR("?",1)="?? Please enter an OPTION NUMBER, 1 through 7"
|
---|
44 | .W ! D ^DIR K DIR
|
---|
45 | .I Y=7 S DIRUT=1
|
---|
46 | .I $D(DIRUT) Q
|
---|
47 | .S NVSANS=Y
|
---|
48 | .I NVSANS=1 D TM Q
|
---|
49 | .I NVSANS=2 D BL Q
|
---|
50 | .I NVSANS=3 D ML Q
|
---|
51 | .I NVSANS=4 D Q
|
---|
52 | ..D TM
|
---|
53 | ..D BL
|
---|
54 | ..D ML
|
---|
55 | .I NVSANS=5 D STM Q
|
---|
56 | .I NVSANS=6 D SBL
|
---|
57 | K DIRUT,DTOUT,NVSANS,NVSCFG,NVSVOL,X,Y
|
---|
58 | Q
|
---|
59 | ;
|
---|
60 | TM ; start Task Manager...
|
---|
61 | N DIR,DIRUT,DTOUT,X,Y
|
---|
62 | I NVSVOL="VAH" D
|
---|
63 | .W !!,"Submitting batch job for USER$:[CACHEMGR]TASKMAN_START.COM to start"
|
---|
64 | .W !,"TaskMan in VAH..."
|
---|
65 | .S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TASKMAN_START.COM")
|
---|
66 | I NVSVOL'="VAH" D
|
---|
67 | .W !!,"Submitting batch job for USER$:[CACHEMGR]PLATINUM_TASKMAN_START.COM to"
|
---|
68 | .W !,"start TaskMan in ",NVSVOL,"..."
|
---|
69 | .S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]PLATINUM_TASKMAN_START.COM")
|
---|
70 | ;I NVSVOL="TST" S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TST_TASKMAN_START.COM")
|
---|
71 | ;I NVSVOL'="VAH"&(NVSVOL'="TST") W !!,$C(7),"This Configuration is not VAH or TST."
|
---|
72 | S DIR(0)="EA"
|
---|
73 | S DIR("A")="Press <enter> to return to the main menu..."
|
---|
74 | W ! D ^DIR K DIR
|
---|
75 | Q
|
---|
76 | ;
|
---|
77 | BL ;start Broker Listeners...
|
---|
78 | N DIR,DIRUT,DTOUT,X,Y
|
---|
79 | I NVSVOL="VAH" D
|
---|
80 | .W !!,"Submitting batch job for USER$:[CACHEMGR]BROKER_START.COM to start Broker"
|
---|
81 | .W !,"listener(s) in VAH..."
|
---|
82 | .S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]BROKER_START.COM")
|
---|
83 | I NVSVOL'="VAH" D
|
---|
84 | .W !!,"Submitting batch job for USER$:[CACHEMGR]",NVSVOL,"_BROKER_START.COM to"
|
---|
85 | .W !,"start Broker listener(s) in ",NVSVOL,"..."
|
---|
86 | .S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]"_NVSVOL_"_BROKER_START.COM")
|
---|
87 | ;I NVSVOL="TST" S X=$ZF(-1,"SUBMIT/USER=CACHEMGR/QUE=SYS$BATCH USER$:[CACHEMGR]TST_BROKER_START.COM")
|
---|
88 | ;I NVSVOL'="VAH"&(NVSVOL'="TST") W !!,$C(7),"This Configuration is not VAH or TST."
|
---|
89 | S DIR(0)="EA"
|
---|
90 | S DIR("A")="Press <enter> to return to the main menu..."
|
---|
91 | W ! D ^DIR K DIR
|
---|
92 | Q
|
---|
93 | ;
|
---|
94 | ML ; start network mail listener...
|
---|
95 | W !!,"JOBbing the routine ^XMRONT..."
|
---|
96 | J ^XMRONT::5
|
---|
97 | I $T'=1 W !?2,"ERROR -- the command JOB ^XMRONT failed!"
|
---|
98 | I $T=1 W "JOB command executed successfully."
|
---|
99 | S DIR(0)="EA"
|
---|
100 | S DIR("A")="Press <enter> to return to the main menu..."
|
---|
101 | W ! D ^DIR K DIR
|
---|
102 | Q
|
---|
103 | ;
|
---|
104 | STM ; stop Task Manager and Sub-managers...
|
---|
105 | N DIR,DIRUT,DTOUT,NVSTMLIS,NVSTMPID,X,Y
|
---|
106 | D TMSTAT(.NVSTMLIS)
|
---|
107 | I +$G(NVSTMLIS)=0 D Q
|
---|
108 | .S DIR(0)="EA"
|
---|
109 | .S DIR("A")="Press <enter> to return to main menu..."
|
---|
110 | .W ! D ^DIR K DIR
|
---|
111 | W !
|
---|
112 | S NVSTMNOD=""
|
---|
113 | F S NVSTMNOD=$O(NVSTMLIS(NVSTMNOD)) Q:NVSTMNOD=""!($D(DIRUT)) D
|
---|
114 | .S DIR(0)="YA"
|
---|
115 | .S DIR("A")="Stop Task Manager in "_NVSTMNOD_"? "
|
---|
116 | .S DIR("B")="NO"
|
---|
117 | .S DIR("?")="Answer YES or NO, or enter ""^"" to abort"
|
---|
118 | .D ^DIR K DIR
|
---|
119 | .I $D(DIRUT) Q
|
---|
120 | .I Y'=1 Q
|
---|
121 | .W !?2,"stopping the manager..."
|
---|
122 | .D SMAN^ZTMKU(NVSTMNOD)
|
---|
123 | .S NVSTMPID=NVSTMLIS(NVSTMNOD)
|
---|
124 | .F I=1:1:10 Q:'$D(^%ZTSCH("STATUS",NVSTMPID)) W "." H 1
|
---|
125 | .I $D(^%ZTSCH("STATUS",NVSTMNOD)) W !?2,"ERROR -- Manager job would not stop!" Q
|
---|
126 | .W "done."
|
---|
127 | .W !?2,"stopping any idle sub-manager(s)..."
|
---|
128 | .D SSUB^ZTMKU(NVSTMNOD)
|
---|
129 | .W "done."
|
---|
130 | K DIRUT,DTOUT,X,Y
|
---|
131 | S DIR(0)="EA"
|
---|
132 | S DIR("A")="Press <enter> to return to the main menu..."
|
---|
133 | W ! D ^DIR K DIR
|
---|
134 | Q
|
---|
135 | ;
|
---|
136 | TMSTAT(LIST) ; check and list current Task Manager status...
|
---|
137 | ; LIST = an array name passed by reference into which current TM jobs are listed
|
---|
138 | ; returns LIST=number of TM manager jobs in ^%ZTSCH("STATUS")
|
---|
139 | ; LIST(node name)=TM job status line from ^%ZTSCH("STATUS",pid)
|
---|
140 | N NVSTMDAT,NVSTMPID
|
---|
141 | S LIST=0
|
---|
142 | W !!,"Current Task Manager status:"
|
---|
143 | I '+$O(^%ZTSCH("STATUS",0)) D Q
|
---|
144 | .W $C(7)
|
---|
145 | .W !,"**NO TASK MANAGER JOBS FOUND IN ^%ZTSCH(""STATUS"")!**"
|
---|
146 | W !!,"Process ID"
|
---|
147 | W ?20,"Node"
|
---|
148 | W ?35,"Status"
|
---|
149 | S NVSTMPID=0
|
---|
150 | F S NVSTMPID=$O(^%ZTSCH("STATUS",NVSTMPID)) Q:'NVSTMPID D
|
---|
151 | .S NVSTMDAT=^%ZTSCH("STATUS",NVSTMPID)
|
---|
152 | .W !,NVSTMPID
|
---|
153 | .W ?20,$P(NVSTMDAT,"^",3)
|
---|
154 | .W ?35,$P(NVSTMDAT,"^",2)," ",$P(NVSTMDAT,"^",4)
|
---|
155 | .S LIST=LIST+1
|
---|
156 | .S LIST($P(NVSTMDAT,"^",3))=NVSTMPID
|
---|
157 | .K NVSTMDAT
|
---|
158 | Q
|
---|
159 | ;
|
---|
160 | SBL ; stop broker listener...
|
---|
161 | N base,maxpid,DIR,DIRUT,DTOUT,NVSBDEV,NVSBLIS,NVSBPORT,NVSJPID,NVSROU,X,Y
|
---|
162 | ; search process table for Broker listener(s)...
|
---|
163 | S NVSBLIS=0
|
---|
164 | s base=$v($zu(40,2,47),-2,"S")
|
---|
165 | s maxpid=$v($zu(40,2,118),-2,4)
|
---|
166 | W !!,"Searching process table for any Broker listener(s) running in"
|
---|
167 | W !,"configuration ",NVSCFG,"..."
|
---|
168 | f i=1:1:maxpid s NVSJPID=$v(i*4+base,-3,4) I NVSJPID>0 D
|
---|
169 | .S NVSROU=$ZU(67,5,NVSJPID)
|
---|
170 | .I NVSROU'="XWBTCPL" K NVSROU Q
|
---|
171 | .S NVSBDEV=$ZU(67,7,NVSJPID)
|
---|
172 | .I NVSBDEV="" K NVSBDEV,NVSROU Q
|
---|
173 | .S NVSBLIS=NVSBLIS+1
|
---|
174 | .S NVSBLIS($P(NVSBDEV,"|",3))=""
|
---|
175 | .K NVSBDEV,NVSROU
|
---|
176 | I NVSBLIS=0 W !!,"**NO Broker listener jobs were found here!**"
|
---|
177 | I NVSBLIS>0 D K DIRUT,DTOUT,X,Y
|
---|
178 | .W !!,"Broker listener job",$S(NVSBLIS>1:"s",1:"")," found on "
|
---|
179 | .W $S(NVSBLIS>1:"these ",1:"this "),"port",$S(NVSBLIS>1:"s:",1:":")
|
---|
180 | .S NVSBPORT=0
|
---|
181 | .F S NVSBPORT=$O(NVSBLIS(NVSBPORT)) Q:'NVSBPORT W !?2,NVSBPORT
|
---|
182 | .F D Q:$D(DIRUT)
|
---|
183 | ..S DIR(0)="NA^"_+$O(NVSBLIS(0))_":"_+$O(NVSBLIS(""),-1)_"^K:'$D(NVSBLIS(X)) X"
|
---|
184 | ..S DIR("A")="Stop Broker Listener on PORT: "
|
---|
185 | ..I NVSBLIS=1 S DIR("B")=+$O(NVSBLIS(0))
|
---|
186 | ..S DIR("?")="Enter a PORT NUMBER from the list above"
|
---|
187 | ..W ! D ^DIR K DIR
|
---|
188 | ..I $D(DIRUT) Q
|
---|
189 | ..S NVSBPORT=+Y
|
---|
190 | ..W !?2,"Calling STOP^XWBTCP(",NVSBPORT,")..."
|
---|
191 | ..D STOP^XWBTCP(NVSBPORT)
|
---|
192 | ..K NVSBPORT
|
---|
193 | ..I NVSBLIS=1 S DIRUT=1
|
---|
194 | S DIR(0)="EA"
|
---|
195 | S DIR("A")="Press <enter> to return to the main menu..."
|
---|
196 | W ! D ^DIR K DIR
|
---|
197 | Q
|
---|