Merge lp:~jontai/openvista-gtm-integration/bug701554 into lp:openvista-gtm-integration
- bug701554
- Merge into mainline
Proposed by
Derek_
Status: | Needs review |
---|---|
Proposed branch: | lp:~jontai/openvista-gtm-integration/bug701554 |
Merge into: | lp:openvista-gtm-integration |
Diff against target: |
636 lines (+603/-7) 2 files modified
kids/XU_80_1510.KID (+556/-0) mumps/MSCZJOBS.m (+47/-7) |
To merge this branch: | bzr merge lp:~jontai/openvista-gtm-integration/bug701554 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
jeff.apple | Approve | ||
Review via email: mp+54723@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
- 150. By Jon Tai
-
add patch number to second line of routine
- 149. By Jon Tai
-
add KIDS build with updated MSCZJOBS routine
- 148. By Jon Tai
-
refactor the netstat call so it's in its own subroutine and will only be called once per call of %SS
- 147. By Jon Tai
-
first pass at calling netstat to get the local port number
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'kids/XU_80_1510.KID' | |||
2 | --- kids/XU_80_1510.KID 1970-01-01 00:00:00 +0000 | |||
3 | +++ kids/XU_80_1510.KID 2011-03-24 16:18:29 +0000 | |||
4 | @@ -0,0 +1,556 @@ | |||
5 | 1 | KIDS Distribution saved on Jan 11, 2011@11:23:04 | ||
6 | 2 | artf10950 - %SS port number fix | ||
7 | 3 | **KIDS**:XU*8.0*1510^ | ||
8 | 4 | |||
9 | 5 | **INSTALL NAME** | ||
10 | 6 | XU*8.0*1510 | ||
11 | 7 | "BLD",7341,0) | ||
12 | 8 | XU*8.0*1510^KERNEL^0^3110111^n | ||
13 | 9 | "BLD",7341,4,0) | ||
14 | 10 | ^9.64PA^^ | ||
15 | 11 | "BLD",7341,6.3) | ||
16 | 12 | 2 | ||
17 | 13 | "BLD",7341,"ABPKG") | ||
18 | 14 | n | ||
19 | 15 | "BLD",7341,"KRN",0) | ||
20 | 16 | ^9.67PA^8989.52^19 | ||
21 | 17 | "BLD",7341,"KRN",.4,0) | ||
22 | 18 | .4 | ||
23 | 19 | "BLD",7341,"KRN",.401,0) | ||
24 | 20 | .401 | ||
25 | 21 | "BLD",7341,"KRN",.402,0) | ||
26 | 22 | .402 | ||
27 | 23 | "BLD",7341,"KRN",.403,0) | ||
28 | 24 | .403 | ||
29 | 25 | "BLD",7341,"KRN",.5,0) | ||
30 | 26 | .5 | ||
31 | 27 | "BLD",7341,"KRN",.84,0) | ||
32 | 28 | .84 | ||
33 | 29 | "BLD",7341,"KRN",3.6,0) | ||
34 | 30 | 3.6 | ||
35 | 31 | "BLD",7341,"KRN",3.8,0) | ||
36 | 32 | 3.8 | ||
37 | 33 | "BLD",7341,"KRN",9.2,0) | ||
38 | 34 | 9.2 | ||
39 | 35 | "BLD",7341,"KRN",9.8,0) | ||
40 | 36 | 9.8 | ||
41 | 37 | "BLD",7341,"KRN",9.8,"NM",0) | ||
42 | 38 | ^9.68A^1^1 | ||
43 | 39 | "BLD",7341,"KRN",9.8,"NM",1,0) | ||
44 | 40 | MSCZJOBS^^0^B46514052 | ||
45 | 41 | "BLD",7341,"KRN",9.8,"NM","B","MSCZJOBS",1) | ||
46 | 42 | |||
47 | 43 | "BLD",7341,"KRN",19,0) | ||
48 | 44 | 19 | ||
49 | 45 | "BLD",7341,"KRN",19.1,0) | ||
50 | 46 | 19.1 | ||
51 | 47 | "BLD",7341,"KRN",101,0) | ||
52 | 48 | 101 | ||
53 | 49 | "BLD",7341,"KRN",409.61,0) | ||
54 | 50 | 409.61 | ||
55 | 51 | "BLD",7341,"KRN",771,0) | ||
56 | 52 | 771 | ||
57 | 53 | "BLD",7341,"KRN",870,0) | ||
58 | 54 | 870 | ||
59 | 55 | "BLD",7341,"KRN",8989.51,0) | ||
60 | 56 | 8989.51 | ||
61 | 57 | "BLD",7341,"KRN",8989.52,0) | ||
62 | 58 | 8989.52 | ||
63 | 59 | "BLD",7341,"KRN",8994,0) | ||
64 | 60 | 8994 | ||
65 | 61 | "BLD",7341,"KRN","B",.4,.4) | ||
66 | 62 | |||
67 | 63 | "BLD",7341,"KRN","B",.401,.401) | ||
68 | 64 | |||
69 | 65 | "BLD",7341,"KRN","B",.402,.402) | ||
70 | 66 | |||
71 | 67 | "BLD",7341,"KRN","B",.403,.403) | ||
72 | 68 | |||
73 | 69 | "BLD",7341,"KRN","B",.5,.5) | ||
74 | 70 | |||
75 | 71 | "BLD",7341,"KRN","B",.84,.84) | ||
76 | 72 | |||
77 | 73 | "BLD",7341,"KRN","B",3.6,3.6) | ||
78 | 74 | |||
79 | 75 | "BLD",7341,"KRN","B",3.8,3.8) | ||
80 | 76 | |||
81 | 77 | "BLD",7341,"KRN","B",9.2,9.2) | ||
82 | 78 | |||
83 | 79 | "BLD",7341,"KRN","B",9.8,9.8) | ||
84 | 80 | |||
85 | 81 | "BLD",7341,"KRN","B",19,19) | ||
86 | 82 | |||
87 | 83 | "BLD",7341,"KRN","B",19.1,19.1) | ||
88 | 84 | |||
89 | 85 | "BLD",7341,"KRN","B",101,101) | ||
90 | 86 | |||
91 | 87 | "BLD",7341,"KRN","B",409.61,409.61) | ||
92 | 88 | |||
93 | 89 | "BLD",7341,"KRN","B",771,771) | ||
94 | 90 | |||
95 | 91 | "BLD",7341,"KRN","B",870,870) | ||
96 | 92 | |||
97 | 93 | "BLD",7341,"KRN","B",8989.51,8989.51) | ||
98 | 94 | |||
99 | 95 | "BLD",7341,"KRN","B",8989.52,8989.52) | ||
100 | 96 | |||
101 | 97 | "BLD",7341,"KRN","B",8994,8994) | ||
102 | 98 | |||
103 | 99 | "BLD",7341,"MSC") | ||
104 | 100 | /home/jon/XU_80_1510.KID | ||
105 | 101 | "BLD",7341,"MSCOM") | ||
106 | 102 | artf10950 - %SS port number fix | ||
107 | 103 | "BLD",7341,"QUES",0) | ||
108 | 104 | ^9.62^^ | ||
109 | 105 | "MBREQ") | ||
110 | 106 | 0 | ||
111 | 107 | "PKG",3,-1) | ||
112 | 108 | 1^1 | ||
113 | 109 | "PKG",3,0) | ||
114 | 110 | KERNEL^XU^SIGN-ON, SECURITY, MENU DRIVER, DEVICES, TASKMAN^ | ||
115 | 111 | "PKG",3,20,0) | ||
116 | 112 | ^9.402P^^ | ||
117 | 113 | "PKG",3,22,0) | ||
118 | 114 | ^9.49I^1^1 | ||
119 | 115 | "PKG",3,22,1,0) | ||
120 | 116 | 8.0^3040115^2960606^1 | ||
121 | 117 | "PKG",3,22,1,"PAH",1,0) | ||
122 | 118 | 1510^3110111 | ||
123 | 119 | "QUES","XPF1",0) | ||
124 | 120 | Y | ||
125 | 121 | "QUES","XPF1","??") | ||
126 | 122 | ^D REP^XPDH | ||
127 | 123 | "QUES","XPF1","A") | ||
128 | 124 | Shall I write over your |FLAG| File | ||
129 | 125 | "QUES","XPF1","B") | ||
130 | 126 | YES | ||
131 | 127 | "QUES","XPF1","M") | ||
132 | 128 | D XPF1^XPDIQ | ||
133 | 129 | "QUES","XPF2",0) | ||
134 | 130 | Y | ||
135 | 131 | "QUES","XPF2","??") | ||
136 | 132 | ^D DTA^XPDH | ||
137 | 133 | "QUES","XPF2","A") | ||
138 | 134 | Want my data |FLAG| yours | ||
139 | 135 | "QUES","XPF2","B") | ||
140 | 136 | YES | ||
141 | 137 | "QUES","XPF2","M") | ||
142 | 138 | D XPF2^XPDIQ | ||
143 | 139 | "QUES","XPI1",0) | ||
144 | 140 | YO | ||
145 | 141 | "QUES","XPI1","??") | ||
146 | 142 | ^D INHIBIT^XPDH | ||
147 | 143 | "QUES","XPI1","A") | ||
148 | 144 | Want KIDS to INHIBIT LOGONs during the install | ||
149 | 145 | "QUES","XPI1","B") | ||
150 | 146 | NO | ||
151 | 147 | "QUES","XPI1","M") | ||
152 | 148 | D XPI1^XPDIQ | ||
153 | 149 | "QUES","XPM1",0) | ||
154 | 150 | PO^VA(200,:EM | ||
155 | 151 | "QUES","XPM1","??") | ||
156 | 152 | ^D MG^XPDH | ||
157 | 153 | "QUES","XPM1","A") | ||
158 | 154 | Enter the Coordinator for Mail Group '|FLAG|' | ||
159 | 155 | "QUES","XPM1","B") | ||
160 | 156 | |||
161 | 157 | "QUES","XPM1","M") | ||
162 | 158 | D XPM1^XPDIQ | ||
163 | 159 | "QUES","XPO1",0) | ||
164 | 160 | Y | ||
165 | 161 | "QUES","XPO1","??") | ||
166 | 162 | ^D MENU^XPDH | ||
167 | 163 | "QUES","XPO1","A") | ||
168 | 164 | Want KIDS to Rebuild Menu Trees Upon Completion of Install | ||
169 | 165 | "QUES","XPO1","B") | ||
170 | 166 | NO | ||
171 | 167 | "QUES","XPO1","M") | ||
172 | 168 | D XPO1^XPDIQ | ||
173 | 169 | "QUES","XPZ1",0) | ||
174 | 170 | Y | ||
175 | 171 | "QUES","XPZ1","??") | ||
176 | 172 | ^D OPT^XPDH | ||
177 | 173 | "QUES","XPZ1","A") | ||
178 | 174 | Want to DISABLE Scheduled Options, Menu Options, and Protocols | ||
179 | 175 | "QUES","XPZ1","B") | ||
180 | 176 | NO | ||
181 | 177 | "QUES","XPZ1","M") | ||
182 | 178 | D XPZ1^XPDIQ | ||
183 | 179 | "QUES","XPZ2",0) | ||
184 | 180 | Y | ||
185 | 181 | "QUES","XPZ2","??") | ||
186 | 182 | ^D RTN^XPDH | ||
187 | 183 | "QUES","XPZ2","A") | ||
188 | 184 | Want to MOVE routines to other CPUs | ||
189 | 185 | "QUES","XPZ2","B") | ||
190 | 186 | NO | ||
191 | 187 | "QUES","XPZ2","M") | ||
192 | 188 | D XPZ2^XPDIQ | ||
193 | 189 | "RTN") | ||
194 | 190 | 1 | ||
195 | 191 | "RTN","MSCZJOBS") | ||
196 | 192 | 0^1^B46514052 | ||
197 | 193 | "RTN","MSCZJOBS",1,0) | ||
198 | 194 | MSCZJOBS ;JKT/MSC ;OpenVista System status; 11 JAN 2011 - 1122 | ||
199 | 195 | "RTN","MSCZJOBS",2,0) | ||
200 | 196 | ;;8.0;KERNEL;**1501,1510**;5/20/2009 | ||
201 | 197 | "RTN","MSCZJOBS",3,0) | ||
202 | 198 | ; | ||
203 | 199 | "RTN","MSCZJOBS",4,0) | ||
204 | 200 | ALL D SS() Q | ||
205 | 201 | "RTN","MSCZJOBS",5,0) | ||
206 | 202 | THIS N FILTERS S FILTERS(1)="I^"_$$CURRENT^ZCD() D SS(.FILTERS) Q | ||
207 | 203 | "RTN","MSCZJOBS",6,0) | ||
208 | 204 | ; | ||
209 | 205 | "RTN","MSCZJOBS",7,0) | ||
210 | 206 | INT ;Interactive -- ask for filters, then do SS in a loop | ||
211 | 207 | "RTN","MSCZJOBS",8,0) | ||
212 | 208 | N FILTERS,QUIT S FILTERS=0,QUIT=0 | ||
213 | 209 | "RTN","MSCZJOBS",9,0) | ||
214 | 210 | F D Q:QUIT | ||
215 | 211 | "RTN","MSCZJOBS",10,0) | ||
216 | 212 | . N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,U | ||
217 | 213 | "RTN","MSCZJOBS",11,0) | ||
218 | 214 | . S DIR(0)="SAO^J:PID/$J;P:PORT NUMBER;I:INSTANCE NAME;R:RUNNING ROUTINE;Z:ZLINKED ROUTINE;U:USER;D:IDENTITY" | ||
219 | 215 | "RTN","MSCZJOBS",12,0) | ||
220 | 216 | . S DIR("A")="Select FILTER: " | ||
221 | 217 | "RTN","MSCZJOBS",13,0) | ||
222 | 218 | . S DIR("?")="Optionally select criteria to filter processes by." | ||
223 | 219 | "RTN","MSCZJOBS",14,0) | ||
224 | 220 | . D ^DIR | ||
225 | 221 | "RTN","MSCZJOBS",15,0) | ||
226 | 222 | . I $G(DTOUT)!$G(DUOUT) S QUIT=2 Q ; exit program | ||
227 | 223 | "RTN","MSCZJOBS",16,0) | ||
228 | 224 | . I (Y="") S QUIT=1 Q ; exit loop | ||
229 | 225 | "RTN","MSCZJOBS",17,0) | ||
230 | 226 | . N FILTER S FILTER=Y | ||
231 | 227 | "RTN","MSCZJOBS",18,0) | ||
232 | 228 | . ; | ||
233 | 229 | "RTN","MSCZJOBS",19,0) | ||
234 | 230 | . N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,U | ||
235 | 231 | "RTN","MSCZJOBS",20,0) | ||
236 | 232 | . D:FILTER="J" | ||
237 | 233 | "RTN","MSCZJOBS",21,0) | ||
238 | 234 | . . S DIR(0)="NAO" | ||
239 | 235 | "RTN","MSCZJOBS",22,0) | ||
240 | 236 | . . S DIR("A")=" PID/$J: " | ||
241 | 237 | "RTN","MSCZJOBS",23,0) | ||
242 | 238 | . . S DIR("?")="If a numeric process ID ($J) is entered here, only processes with that process ID will be displayed." | ||
243 | 239 | "RTN","MSCZJOBS",24,0) | ||
244 | 240 | . D:FILTER="P" | ||
245 | 241 | "RTN","MSCZJOBS",25,0) | ||
246 | 242 | . . S DIR(0)="NAO" | ||
247 | 243 | "RTN","MSCZJOBS",26,0) | ||
248 | 244 | . . S DIR("A")=" PORT NUMBER: " | ||
249 | 245 | "RTN","MSCZJOBS",27,0) | ||
250 | 246 | . . S DIR("?")="If a numeric port number is entered here, only processes listening on that port or connected to that port will be displayed." | ||
251 | 247 | "RTN","MSCZJOBS",28,0) | ||
252 | 248 | . D:FILTER="I" | ||
253 | 249 | "RTN","MSCZJOBS",29,0) | ||
254 | 250 | . . S DIR(0)="FOU" | ||
255 | 251 | "RTN","MSCZJOBS",30,0) | ||
256 | 252 | . . S DIR("A")=" INSTANCE NAME" | ||
257 | 253 | "RTN","MSCZJOBS",31,0) | ||
258 | 254 | . . S DIR("?")="If an instance name is entered here, only processes running in that instance will be displayed." | ||
259 | 255 | "RTN","MSCZJOBS",32,0) | ||
260 | 256 | . D:FILTER="R" | ||
261 | 257 | "RTN","MSCZJOBS",33,0) | ||
262 | 258 | . . S DIR(0)="FOU" | ||
263 | 259 | "RTN","MSCZJOBS",34,0) | ||
264 | 260 | . . S DIR("A")=" RUNNING ROUTINE" | ||
265 | 261 | "RTN","MSCZJOBS",35,0) | ||
266 | 262 | . . S DIR("?")="If a routine name is entered here, only processes running that routine will be displayed." | ||
267 | 263 | "RTN","MSCZJOBS",36,0) | ||
268 | 264 | . D:FILTER="Z" | ||
269 | 265 | "RTN","MSCZJOBS",37,0) | ||
270 | 266 | . . S DIR(0)="FOU" | ||
271 | 267 | "RTN","MSCZJOBS",38,0) | ||
272 | 268 | . . S DIR("A")=" ZLINKED ROUTINE" | ||
273 | 269 | "RTN","MSCZJOBS",39,0) | ||
274 | 270 | . . S DIR("?")="If a routine name is entered here, only processes that have previously loaded (ZLINK'd) that routine will be displayed." | ||
275 | 271 | "RTN","MSCZJOBS",40,0) | ||
276 | 272 | . D:FILTER="U" | ||
277 | 273 | "RTN","MSCZJOBS",41,0) | ||
278 | 274 | . . S DIR(0)="FOU" | ||
279 | 275 | "RTN","MSCZJOBS",42,0) | ||
280 | 276 | . . S DIR("A")=" USER" | ||
281 | 277 | "RTN","MSCZJOBS",43,0) | ||
282 | 278 | . . S DIR("?")="If a Linux username is entered here, only processes that are running under that user will be displayed." | ||
283 | 279 | "RTN","MSCZJOBS",44,0) | ||
284 | 280 | . D:FILTER="D" | ||
285 | 281 | "RTN","MSCZJOBS",45,0) | ||
286 | 282 | . . S DIR(0)="FOU" | ||
287 | 283 | "RTN","MSCZJOBS",46,0) | ||
288 | 284 | . . S DIR("A")=" IDENTITY" | ||
289 | 285 | "RTN","MSCZJOBS",47,0) | ||
290 | 286 | . . S DIR("?")="If an OpenVista user's name is entered here, only processes that are running under that user will be displayed." | ||
291 | 287 | "RTN","MSCZJOBS",48,0) | ||
292 | 288 | . D ^DIR Q:$G(DTOUT)!$G(DUOUT)!(Y="") | ||
293 | 289 | "RTN","MSCZJOBS",49,0) | ||
294 | 290 | . S FILTERS($I(FILTERS))=FILTER_"^"_Y | ||
295 | 291 | "RTN","MSCZJOBS",50,0) | ||
296 | 292 | Q:QUIT=2 | ||
297 | 293 | "RTN","MSCZJOBS",51,0) | ||
298 | 294 | ; | ||
299 | 295 | "RTN","MSCZJOBS",52,0) | ||
300 | 296 | N QUIT S QUIT=0 | ||
301 | 297 | "RTN","MSCZJOBS",53,0) | ||
302 | 298 | F D Q:QUIT | ||
303 | 299 | "RTN","MSCZJOBS",54,0) | ||
304 | 300 | . D SS(.FILTERS) | ||
305 | 301 | "RTN","MSCZJOBS",55,0) | ||
306 | 302 | . N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,U | ||
307 | 303 | "RTN","MSCZJOBS",56,0) | ||
308 | 304 | . S DIR(0)="SA^U:UPDATE;Q:QUIT" | ||
309 | 305 | "RTN","MSCZJOBS",57,0) | ||
310 | 306 | . S DIR("A")="Action: " | ||
311 | 307 | "RTN","MSCZJOBS",58,0) | ||
312 | 308 | . S DIR("B")="UPDATE" | ||
313 | 309 | "RTN","MSCZJOBS",59,0) | ||
314 | 310 | . D ^DIR | ||
315 | 311 | "RTN","MSCZJOBS",60,0) | ||
316 | 312 | . I Y'="U" S QUIT=1 Q | ||
317 | 313 | "RTN","MSCZJOBS",61,0) | ||
318 | 314 | Q | ||
319 | 315 | "RTN","MSCZJOBS",62,0) | ||
320 | 316 | ; | ||
321 | 317 | "RTN","MSCZJOBS",63,0) | ||
322 | 318 | SS(FILTERS) ;Print GT.M mumps processes | ||
323 | 319 | "RTN","MSCZJOBS",64,0) | ||
324 | 320 | ; | ||
325 | 321 | "RTN","MSCZJOBS",65,0) | ||
326 | 322 | Q:$G(^%ZOSF("OS"))'["GT.M" | ||
327 | 323 | "RTN","MSCZJOBS",66,0) | ||
328 | 324 | ; | ||
329 | 325 | "RTN","MSCZJOBS",67,0) | ||
330 | 326 | D INTRPT^MSCZJOBU("*") H .5 | ||
331 | 327 | "RTN","MSCZJOBS",68,0) | ||
332 | 328 | ; | ||
333 | 329 | "RTN","MSCZJOBS",69,0) | ||
334 | 330 | N DATETIME S DATETIME=$$HTE^XLFDT($H) | ||
335 | 331 | "RTN","MSCZJOBS",70,0) | ||
336 | 332 | W #!,?28,"OpenVista System Status" | ||
337 | 333 | "RTN","MSCZJOBS",71,0) | ||
338 | 334 | W !,?(40-($L(DATETIME)/2)\1),DATETIME | ||
339 | 335 | "RTN","MSCZJOBS",72,0) | ||
340 | 336 | W !!,?1,"PID/$J",?9,"%CPU",?15,"Device",?32,"Instance",?42,"Routine",?52,"User",?66,"Identity" | ||
341 | 337 | "RTN","MSCZJOBS",73,0) | ||
342 | 338 | ; | ||
343 | 339 | "RTN","MSCZJOBS",74,0) | ||
344 | 340 | N MSC S MSC="^TMP(""MSCZJOB1"",$J)" K @MSC | ||
345 | 341 | "RTN","MSCZJOBS",75,0) | ||
346 | 342 | D JOBEXAM^MSCZJOBU(MSC) | ||
347 | 343 | "RTN","MSCZJOBS",76,0) | ||
348 | 344 | N NETSTAT S NETSTAT=0 | ||
349 | 345 | "RTN","MSCZJOBS",77,0) | ||
350 | 346 | N PID S PID="" | ||
351 | 347 | "RTN","MSCZJOBS",78,0) | ||
352 | 348 | F S PID=$O(@MSC@(PID)) Q:PID="" D | ||
353 | 349 | "RTN","MSCZJOBS",79,0) | ||
354 | 350 | . ; evaluate filters; AND different filter types, but if more than one criteria is given of the same type, use OR | ||
355 | 351 | "RTN","MSCZJOBS",80,0) | ||
356 | 352 | . N MATCH,TYPE,QUIT S QUIT=0 | ||
357 | 353 | "RTN","MSCZJOBS",81,0) | ||
358 | 354 | . N FILTER S FILTERS="" F S FILTERS=$O(FILTERS(FILTERS)) Q:FILTERS="" S FILTER=FILTERS(FILTERS) D | ||
359 | 355 | "RTN","MSCZJOBS",82,0) | ||
360 | 356 | . . S TYPE=$P(FILTER,"^") | ||
361 | 357 | "RTN","MSCZJOBS",83,0) | ||
362 | 358 | . . I '$D(MATCH(TYPE)) S MATCH(TYPE)=0 | ||
363 | 359 | "RTN","MSCZJOBS",84,0) | ||
364 | 360 | . . I TYPE="J" S:PID=$P(FILTER,"^",2) MATCH(TYPE)=1 Q | ||
365 | 361 | "RTN","MSCZJOBS",85,0) | ||
366 | 362 | . . I TYPE="P" S:$P($$DEVICE(PID),",")=$P(FILTER,"^",2) MATCH(TYPE)=1 Q | ||
367 | 363 | "RTN","MSCZJOBS",86,0) | ||
368 | 364 | . . I TYPE="I" S:$$INSTANCE(PID)=$P(FILTER,"^",2) MATCH(TYPE)=1 Q | ||
369 | 365 | "RTN","MSCZJOBS",87,0) | ||
370 | 366 | . . I TYPE="R" S:$$ROUTINE(PID)=$P(FILTER,"^",2) MATCH(TYPE)=1 Q | ||
371 | 367 | "RTN","MSCZJOBS",88,0) | ||
372 | 368 | . . I TYPE="Z" S:$D(@MSC@(PID,"RTN",$P(FILTER,"^",2))) MATCH(TYPE)=1 Q | ||
373 | 369 | "RTN","MSCZJOBS",89,0) | ||
374 | 370 | . . I TYPE="U" S:$$USER(PID)=$P(FILTER,"^",2) MATCH(TYPE)=1 Q | ||
375 | 371 | "RTN","MSCZJOBS",90,0) | ||
376 | 372 | . . I TYPE="D" S:$$IDENT(PID)=$P(FILTER,"^",2) MATCH(TYPE)=1 Q | ||
377 | 373 | "RTN","MSCZJOBS",91,0) | ||
378 | 374 | . S TYPE="" F S TYPE=$O(MATCH(TYPE)) Q:TYPE="" I 'MATCH(TYPE) S QUIT=1 Q | ||
379 | 375 | "RTN","MSCZJOBS",92,0) | ||
380 | 376 | . I QUIT Q | ||
381 | 377 | "RTN","MSCZJOBS",93,0) | ||
382 | 378 | . | ||
383 | 379 | "RTN","MSCZJOBS",94,0) | ||
384 | 380 | . ; print line of output for this process | ||
385 | 381 | "RTN","MSCZJOBS",95,0) | ||
386 | 382 | . W !,$$PID(PID) | ||
387 | 383 | "RTN","MSCZJOBS",96,0) | ||
388 | 384 | . W ?9,$$PCPU(PID) | ||
389 | 385 | "RTN","MSCZJOBS",97,0) | ||
390 | 386 | . W ?15,$$DEVICE(PID) | ||
391 | 387 | "RTN","MSCZJOBS",98,0) | ||
392 | 388 | . W ?32,$$INSTANCE(PID) | ||
393 | 389 | "RTN","MSCZJOBS",99,0) | ||
394 | 390 | . W ?42,$$ROUTINE(PID) | ||
395 | 391 | "RTN","MSCZJOBS",100,0) | ||
396 | 392 | . W ?52,$$USER(PID) | ||
397 | 393 | "RTN","MSCZJOBS",101,0) | ||
398 | 394 | . W ?66,$$IDENT(PID) | ||
399 | 395 | "RTN","MSCZJOBS",102,0) | ||
400 | 396 | K @MSC | ||
401 | 397 | "RTN","MSCZJOBS",103,0) | ||
402 | 398 | ; | ||
403 | 399 | "RTN","MSCZJOBS",104,0) | ||
404 | 400 | W !! ZSY "uptime" | ||
405 | 401 | "RTN","MSCZJOBS",105,0) | ||
406 | 402 | Q | ||
407 | 403 | "RTN","MSCZJOBS",106,0) | ||
408 | 404 | ; | ||
409 | 405 | "RTN","MSCZJOBS",107,0) | ||
410 | 406 | PID(PID) ;Return process ID formatted for display | ||
411 | 407 | "RTN","MSCZJOBS",108,0) | ||
412 | 408 | Q $J(PID,7)_$S($J=PID:"*",1:"") | ||
413 | 409 | "RTN","MSCZJOBS",109,0) | ||
414 | 410 | ; | ||
415 | 411 | "RTN","MSCZJOBS",110,0) | ||
416 | 412 | PCPU(PID) ;Return CPU usage | ||
417 | 413 | "RTN","MSCZJOBS",111,0) | ||
418 | 414 | Q $J($G(@MSC@(PID,"PCPU")),4) | ||
419 | 415 | "RTN","MSCZJOBS",112,0) | ||
420 | 416 | ; | ||
421 | 417 | "RTN","MSCZJOBS",113,0) | ||
422 | 418 | DEVICE(PID) ;Return device | ||
423 | 419 | "RTN","MSCZJOBS",114,0) | ||
424 | 420 | N PRI S PRI=$$FIND(PID,"I","$PRINCIPAL") | ||
425 | 421 | "RTN","MSCZJOBS",115,0) | ||
426 | 422 | Q:PRI'="0" PRI ; FIXME: this could probably be more general | ||
427 | 423 | "RTN","MSCZJOBS",116,0) | ||
428 | 424 | ; | ||
429 | 425 | "RTN","MSCZJOBS",117,0) | ||
430 | 426 | ; look at devices for listening or connected sockets | ||
431 | 427 | "RTN","MSCZJOBS",118,0) | ||
432 | 428 | N SOCK,DEV S SOCK=$$FIND(PID,"D"," SOCKET[0]"),DEV="" | ||
433 | 429 | "RTN","MSCZJOBS",119,0) | ||
434 | 430 | I $P(SOCK," ",3)="LISTENING" D | ||
435 | 431 | "RTN","MSCZJOBS",120,0) | ||
436 | 432 | . S DEV=$$FINDSOCK("PORT")_",LISTENING" | ||
437 | 433 | "RTN","MSCZJOBS",121,0) | ||
438 | 434 | I $P(SOCK," ",3)="CONNECTED" D | ||
439 | 435 | "RTN","MSCZJOBS",122,0) | ||
440 | 436 | . N LOCAL S LOCAL=$$FINDSOCK("LOCAL") | ||
441 | 437 | "RTN","MSCZJOBS",123,0) | ||
442 | 438 | . I LOCAL'="" S DEV=$P(LOCAL,"@",2)_",CONNECTED" Q | ||
443 | 439 | "RTN","MSCZJOBS",124,0) | ||
444 | 440 | . ; | ||
445 | 441 | "RTN","MSCZJOBS",125,0) | ||
446 | 442 | . ; If the local port info is not available, we have to look up the | ||
447 | 443 | "RTN","MSCZJOBS",126,0) | ||
448 | 444 | . ; remote port in netstat to figure out the local port. This happens | ||
449 | 445 | "RTN","MSCZJOBS",127,0) | ||
450 | 446 | . ; on single listeners (listeners that stop listening once they get a | ||
451 | 447 | "RTN","MSCZJOBS",128,0) | ||
452 | 448 | . ; connection). See LP #701554. | ||
453 | 449 | "RTN","MSCZJOBS",129,0) | ||
454 | 450 | . N REMOTE S REMOTE=$TR($$FINDSOCK("REMOTE"),"@",":") | ||
455 | 451 | "RTN","MSCZJOBS",130,0) | ||
456 | 452 | . D NETSTAT | ||
457 | 453 | "RTN","MSCZJOBS",131,0) | ||
458 | 454 | . S LOCAL=$G(NETSTAT(REMOTE)) | ||
459 | 455 | "RTN","MSCZJOBS",132,0) | ||
460 | 456 | . I LOCAL'="" S DEV=$P(LOCAL,":",$L(LOCAL,":"))_",CONNECTED" Q | ||
461 | 457 | "RTN","MSCZJOBS",133,0) | ||
462 | 458 | Q DEV | ||
463 | 459 | "RTN","MSCZJOBS",134,0) | ||
464 | 460 | ; | ||
465 | 461 | "RTN","MSCZJOBS",135,0) | ||
466 | 462 | FINDSOCK(KEY) ;Find a key in the SOCK line, private to DEVICE() | ||
467 | 463 | "RTN","MSCZJOBS",136,0) | ||
468 | 464 | Q $P($P(SOCK," "_KEY_"=",2)," ") | ||
469 | 465 | "RTN","MSCZJOBS",137,0) | ||
470 | 466 | ; | ||
471 | 467 | "RTN","MSCZJOBS",138,0) | ||
472 | 468 | NETSTAT ;Call netstat, private to DEVICE() | ||
473 | 469 | "RTN","MSCZJOBS",139,0) | ||
474 | 470 | Q:NETSTAT ; if netstat has been run already, don't run it again | ||
475 | 471 | "RTN","MSCZJOBS",140,0) | ||
476 | 472 | N PIPE,%I,LINE,I,PIECE,LOCAL,REMOTE | ||
477 | 473 | "RTN","MSCZJOBS",141,0) | ||
478 | 474 | S PIPE="pipe",%I=$I | ||
479 | 475 | "RTN","MSCZJOBS",142,0) | ||
480 | 476 | O PIPE:(COMMAND="netstat -n -A inet":READONLY)::"PIPE" | ||
481 | 477 | "RTN","MSCZJOBS",143,0) | ||
482 | 478 | U PIPE | ||
483 | 479 | "RTN","MSCZJOBS",144,0) | ||
484 | 480 | F R LINE Q:LINE="" D | ||
485 | 481 | "RTN","MSCZJOBS",145,0) | ||
486 | 482 | . ; | ||
487 | 483 | "RTN","MSCZJOBS",146,0) | ||
488 | 484 | . ; Iterate over the pieces (delimited by spaces) | ||
489 | 485 | "RTN","MSCZJOBS",147,0) | ||
490 | 486 | . ; Put the first piece that has a ":" in it into LOCAL | ||
491 | 487 | "RTN","MSCZJOBS",148,0) | ||
492 | 488 | . ; Put the second piece that has a ":" in it into REMOTE | ||
493 | 489 | "RTN","MSCZJOBS",149,0) | ||
494 | 490 | . S LOCAL="",REMOTE="" | ||
495 | 491 | "RTN","MSCZJOBS",150,0) | ||
496 | 492 | . F I=1:1:$L(LINE," ") S PIECE=$P(LINE," ",I) D Q:REMOTE'="" | ||
497 | 493 | "RTN","MSCZJOBS",151,0) | ||
498 | 494 | . . Q:$P(PIECE,":",2)="" ; no colon, not an address | ||
499 | 495 | "RTN","MSCZJOBS",152,0) | ||
500 | 496 | . . I LOCAL="" S LOCAL=PIECE Q | ||
501 | 497 | "RTN","MSCZJOBS",153,0) | ||
502 | 498 | . . I REMOTE="" S REMOTE=PIECE Q | ||
503 | 499 | "RTN","MSCZJOBS",154,0) | ||
504 | 500 | . ; | ||
505 | 501 | "RTN","MSCZJOBS",155,0) | ||
506 | 502 | . ; Build a dictionary of remote => local for easy lookup later | ||
507 | 503 | "RTN","MSCZJOBS",156,0) | ||
508 | 504 | . I REMOTE'="" S NETSTAT(REMOTE)=LOCAL | ||
509 | 505 | "RTN","MSCZJOBS",157,0) | ||
510 | 506 | U %I | ||
511 | 507 | "RTN","MSCZJOBS",158,0) | ||
512 | 508 | C PIPE | ||
513 | 509 | "RTN","MSCZJOBS",159,0) | ||
514 | 510 | S NETSTAT=1 ; set flag to indicate that netstat has been run | ||
515 | 511 | "RTN","MSCZJOBS",160,0) | ||
516 | 512 | Q | ||
517 | 513 | "RTN","MSCZJOBS",161,0) | ||
518 | 514 | ; | ||
519 | 515 | "RTN","MSCZJOBS",162,0) | ||
520 | 516 | INSTANCE(PID) ;Return name of OpenVista instance | ||
521 | 517 | "RTN","MSCZJOBS",163,0) | ||
522 | 518 | N ZG S ZG=$$FIND(PID,"I","$ZGBLDIR") | ||
523 | 519 | "RTN","MSCZJOBS",164,0) | ||
524 | 520 | Q $P(ZG,"/",$L(ZG,"/")-2) | ||
525 | 521 | "RTN","MSCZJOBS",165,0) | ||
526 | 522 | ; | ||
527 | 523 | "RTN","MSCZJOBS",166,0) | ||
528 | 524 | ROUTINE(PID) ;Return routine | ||
529 | 525 | "RTN","MSCZJOBS",167,0) | ||
530 | 526 | Q $P($$FIND(PID,"V","%ZPOS"),"^",2) | ||
531 | 527 | "RTN","MSCZJOBS",168,0) | ||
532 | 528 | ; | ||
533 | 529 | "RTN","MSCZJOBS",169,0) | ||
534 | 530 | USER(PID) ;Return Linux user | ||
535 | 531 | "RTN","MSCZJOBS",170,0) | ||
536 | 532 | Q $G(@MSC@(PID,"USER")) | ||
537 | 533 | "RTN","MSCZJOBS",171,0) | ||
538 | 534 | ; | ||
539 | 535 | "RTN","MSCZJOBS",172,0) | ||
540 | 536 | IDENT(PID) ;Return OpenVista user | ||
541 | 537 | "RTN","MSCZJOBS",173,0) | ||
542 | 538 | N DUZ S DUZ=+$$FIND(PID,"V","DUZ") | ||
543 | 539 | "RTN","MSCZJOBS",174,0) | ||
544 | 540 | N ZG S ZG=$$FIND(PID,"I","$ZGBLDIR") | ||
545 | 541 | "RTN","MSCZJOBS",175,0) | ||
546 | 542 | Q $P($G(^|ZG|VA(200,DUZ,0)),"^") | ||
547 | 543 | "RTN","MSCZJOBS",176,0) | ||
548 | 544 | ; | ||
549 | 545 | "RTN","MSCZJOBS",177,0) | ||
550 | 546 | FIND(PID,ARR,KEY) ;Return the value of a key in one of the ZSHOW arrays | ||
551 | 547 | "RTN","MSCZJOBS",178,0) | ||
552 | 548 | N I,X S I="",X="" | ||
553 | 549 | "RTN","MSCZJOBS",179,0) | ||
554 | 550 | F S I=$O(@MSC@(PID,ARR,I)) Q:'I I $P(@MSC@(PID,ARR,I),KEY_"=")="" S X=$TR($P(@MSC@(PID,ARR,I),"=",2,999),"""") Q | ||
555 | 551 | "RTN","MSCZJOBS",180,0) | ||
556 | 552 | Q X | ||
557 | 553 | "VER") | ||
558 | 554 | 8.0^22.0 | ||
559 | 555 | **END** | ||
560 | 556 | **END** | ||
561 | 0 | 557 | ||
562 | === modified file 'mumps/MSCZJOBS.m' | |||
563 | --- mumps/MSCZJOBS.m 2010-07-30 19:25:44 +0000 | |||
564 | +++ mumps/MSCZJOBS.m 2011-03-24 16:18:29 +0000 | |||
565 | @@ -1,5 +1,5 @@ | |||
568 | 1 | MSCZJOBS ;JKT/MSC ;OpenVista System status; 30 JUL 2010 - 1225 | 1 | MSCZJOBS ;JKT/MSC ;OpenVista System status; 11 JAN 2011 - 1122 |
569 | 2 | ;;8.0;KERNEL;**1501**;5/20/2009 | 2 | ;;8.0;KERNEL;**1501,1510**;5/20/2009 |
570 | 3 | ; | 3 | ; |
571 | 4 | ALL D SS() Q | 4 | ALL D SS() Q |
572 | 5 | THIS N FILTERS S FILTERS(1)="I^"_$$CURRENT^ZCD() D SS(.FILTERS) Q | 5 | THIS N FILTERS S FILTERS(1)="I^"_$$CURRENT^ZCD() D SS(.FILTERS) Q |
573 | @@ -73,6 +73,7 @@ | |||
574 | 73 | ; | 73 | ; |
575 | 74 | N MSC S MSC="^TMP(""MSCZJOB1"",$J)" K @MSC | 74 | N MSC S MSC="^TMP(""MSCZJOB1"",$J)" K @MSC |
576 | 75 | D JOBEXAM^MSCZJOBU(MSC) | 75 | D JOBEXAM^MSCZJOBU(MSC) |
577 | 76 | N NETSTAT S NETSTAT=0 | ||
578 | 76 | N PID S PID="" | 77 | N PID S PID="" |
579 | 77 | F S PID=$O(@MSC@(PID)) Q:PID="" D | 78 | F S PID=$O(@MSC@(PID)) Q:PID="" D |
580 | 78 | . ; evaluate filters; AND different filter types, but if more than one criteria is given of the same type, use OR | 79 | . ; evaluate filters; AND different filter types, but if more than one criteria is given of the same type, use OR |
581 | @@ -113,11 +114,50 @@ | |||
582 | 113 | N PRI S PRI=$$FIND(PID,"I","$PRINCIPAL") | 114 | N PRI S PRI=$$FIND(PID,"I","$PRINCIPAL") |
583 | 114 | Q:PRI'="0" PRI ; FIXME: this could probably be more general | 115 | Q:PRI'="0" PRI ; FIXME: this could probably be more general |
584 | 115 | ; | 116 | ; |
590 | 116 | ; look at devices for sockets | 117 | ; look at devices for listening or connected sockets |
591 | 117 | N SOCK S SOCK=$$FIND(PID,"D"," SOCKET[0]") | 118 | N SOCK,DEV S SOCK=$$FIND(PID,"D"," SOCKET[0]"),DEV="" |
592 | 118 | I $P(SOCK," ",3)="LISTENING" Q $P($P(SOCK," PORT=",2)," ")_",LISTENING" | 119 | I $P(SOCK," ",3)="LISTENING" D |
593 | 119 | I $P(SOCK," ",3)="CONNECTED" Q $P($P($P(SOCK," LOCAL=",2)," "),"@",2)_",CONNECTED" | 120 | . S DEV=$$FINDSOCK("PORT")_",LISTENING" |
594 | 120 | Q "" | 121 | I $P(SOCK," ",3)="CONNECTED" D |
595 | 122 | . N LOCAL S LOCAL=$$FINDSOCK("LOCAL") | ||
596 | 123 | . I LOCAL'="" S DEV=$P(LOCAL,"@",2)_",CONNECTED" Q | ||
597 | 124 | . ; | ||
598 | 125 | . ; If the local port info is not available, we have to look up the | ||
599 | 126 | . ; remote port in netstat to figure out the local port. This happens | ||
600 | 127 | . ; on single listeners (listeners that stop listening once they get a | ||
601 | 128 | . ; connection). See LP #701554. | ||
602 | 129 | . N REMOTE S REMOTE=$TR($$FINDSOCK("REMOTE"),"@",":") | ||
603 | 130 | . D NETSTAT | ||
604 | 131 | . S LOCAL=$G(NETSTAT(REMOTE)) | ||
605 | 132 | . I LOCAL'="" S DEV=$P(LOCAL,":",$L(LOCAL,":"))_",CONNECTED" Q | ||
606 | 133 | Q DEV | ||
607 | 134 | ; | ||
608 | 135 | FINDSOCK(KEY) ;Find a key in the SOCK line, private to DEVICE() | ||
609 | 136 | Q $P($P(SOCK," "_KEY_"=",2)," ") | ||
610 | 137 | ; | ||
611 | 138 | NETSTAT ;Call netstat, private to DEVICE() | ||
612 | 139 | Q:NETSTAT ; if netstat has been run already, don't run it again | ||
613 | 140 | N PIPE,%I,LINE,I,PIECE,LOCAL,REMOTE | ||
614 | 141 | S PIPE="pipe",%I=$I | ||
615 | 142 | O PIPE:(COMMAND="netstat -n -A inet":READONLY)::"PIPE" | ||
616 | 143 | U PIPE | ||
617 | 144 | F R LINE Q:LINE="" D | ||
618 | 145 | . ; | ||
619 | 146 | . ; Iterate over the pieces (delimited by spaces) | ||
620 | 147 | . ; Put the first piece that has a ":" in it into LOCAL | ||
621 | 148 | . ; Put the second piece that has a ":" in it into REMOTE | ||
622 | 149 | . S LOCAL="",REMOTE="" | ||
623 | 150 | . F I=1:1:$L(LINE," ") S PIECE=$P(LINE," ",I) D Q:REMOTE'="" | ||
624 | 151 | . . Q:$P(PIECE,":",2)="" ; no colon, not an address | ||
625 | 152 | . . I LOCAL="" S LOCAL=PIECE Q | ||
626 | 153 | . . I REMOTE="" S REMOTE=PIECE Q | ||
627 | 154 | . ; | ||
628 | 155 | . ; Build a dictionary of remote => local for easy lookup later | ||
629 | 156 | . I REMOTE'="" S NETSTAT(REMOTE)=LOCAL | ||
630 | 157 | U %I | ||
631 | 158 | C PIPE | ||
632 | 159 | S NETSTAT=1 ; set flag to indicate that netstat has been run | ||
633 | 160 | Q | ||
634 | 121 | ; | 161 | ; |
635 | 122 | INSTANCE(PID) ;Return name of OpenVista instance | 162 | INSTANCE(PID) ;Return name of OpenVista instance |
636 | 123 | N ZG S ZG=$$FIND(PID,"I","$ZGBLDIR") | 163 | N ZG S ZG=$$FIND(PID,"I","$ZGBLDIR") |
I haven't tested this, but it seems just fine.