KMPRSS ;SFISC/KAK/RAK - Resource Usage Monitor Status ;3/28/00 08:55
;;1.0;CAPACITY MANAGEMENT - RUM;**1,2**;Dec 09, 1998
;
STAT ; Status of Resource Usage Monitor collection
N CHECK,KMPRX,X,Y
; check environment
D ENVCHECK^KMPRUTL1(.CHECK,1)
; if RUM turned on but background job not queued ask user if they want
; to queue it at this time.
D:(+CHECK)=200 ENVCHECK^KMPRUTL1(.CHECK)
W @IOF,!!,?25,"Resource Usage Monitor Status"
S X="Version "_$P($$VERSION^KMPRUTL,U)
W !,?(80-$L(X)\2),X,!
; patches
S X=$P($$VERSION^KMPRUTL,U,2)
W:X]"" ?(80-$L(X)\2),X,!
W !,?5,"The Resource Usage Monitor is currently "
I +$G(^%ZTSCH("LOGRSRC")) W "running."
E W "stopped."
W !
I '$D(^DIC(19,"B","KMPR BACKGROUND DRIVER")) D
.W !," The 'RUM Background Driver' option [KMPR BACKGROUND DRIVER] is missing !",*7,!
E D
.S KMPRX=$O(^DIC(19,"B","KMPR BACKGROUND DRIVER",0))
.S KMPRX=+$O(^DIC(19.2,"B",KMPRX,0))
.I 'KMPRX W !?5,"The 'RUM Background Driver' [KMPR BACKGROUND DRIVER] is not scheduled",!?5,"to run!",! Q
.S KMPRX=$G(^DIC(19.2,KMPRX,0))
.S $P(KMPRX,U,2)=$$FMTE^XLFDT($P(KMPRX,U,2))
.W !,?5,"The 'RUM Background Driver' [KMPR BACKGROUND DRIVER]"
.W !?5,"is QUEUED TO RUN AT ",$P(KMPRX,U,2)
.W !,?5,"with a RESCHEDULING FREQUENCY of '",$P(KMPRX,U,6),"'."
W !!,?5,"The temporary collection global (i.e., 'XTMP(""KMPR"")') is",$S('$D(^XTMP("KMPR")):" not",1:"")," present",!,?5,"on your system.",!
W !!,"Press <RETURN> to continue: " R X:DTIME
;
Q
;
START ; Start Resource Usage Monitor collection
N CHECK
; check environment
D ENVCHECK^KMPRUTL1(.CHECK,1)
; if RUM does not support this operating system then quit.
I (+CHECK)=100 W !! D ENVOUTPT^KMPRUTL1(CHECK,1,1) H 1 Q
I +$G(^%ZTSCH("LOGRSRC")) W !!,?10,"The Resource Usage Monitor is already running.",! H 1 Q
W ! K DIR S DIR(0)="Y",DIR("B")="YES"
S DIR("?")="Answer YES to start collecting Resource Usage Monitor data"
S DIR("A")="Do you want to start Resource Usage Monitor collection"
D ^DIR G:$D(DTOUT)!$D(DUOUT) END
I Y D
.S DIE=8989.3,DA=1,DR="300///YES" D ^DIE
.W !!,?10,"Resource Usage Monitor collection is started.",!
.D ENVCHECK^KMPRUTL1(.CHECK,1)
.; if background driver not scheduled to run then start it up
.D:(+CHECK=200) QUEBKG^KMPRUTL1
E W !!,?10,"Resource Usage Monitor collection is NOT started.",!
H 1 G END
;
STOP ; Stop Resource Usage Monitor collection
I '+$G(^%ZTSCH("LOGRSRC")) W !!,?10,"The Resource Usage Monitor is already stopped.",! H 1 Q
W ! K DIR S DIR(0)="Y",DIR("B")="YES"
S DIR("?")="Answer YES to stop collecting Resource Usage Monitor data"
S DIR("A")="Do you want to stop Resource Usage Monitor collection"
D ^DIR G:$D(DTOUT)!$D(DUOUT) END
I Y D
.S DIE=8989.3,DA=1,DR="300///NO" D ^DIE
.W !!,?10,"Resource Usage Monitor collection is stopped.",!
E W !!,?10,"Resource Usage Monitor collection is NOT stopped.",!
H 1
;
END ;
K DA,DIE,DIR,DR,DTOUT,DUOUT,X,Y
Q
KMPRSS ;SFISC/KAK/RAK - Resource Usage Monitor Status ;3/28/00 08:55
+1 ;;1.0;CAPACITY MANAGEMENT - RUM;**1,2**;Dec 09, 1998
+2 ;
STAT ; Status of Resource Usage Monitor collection
+1 NEW CHECK,KMPRX,X,Y
+2 ; check environment
+3 DO ENVCHECK^KMPRUTL1(.CHECK,1)
+4 ; if RUM turned on but background job not queued ask user if they want
+5 ; to queue it at this time.
+6 IF (+CHECK)=200
DO ENVCHECK^KMPRUTL1(.CHECK)
+7 WRITE @IOF,!!,?25,"Resource Usage Monitor Status"
+8 SET X="Version "_$PIECE($$VERSION^KMPRUTL,U)
+9 WRITE !,?(80-$LENGTH(X)\2),X,!
+10 ; patches
+11 SET X=$PIECE($$VERSION^KMPRUTL,U,2)
+12 IF X]""
WRITE ?(80-$LENGTH(X)\2),X,!
+13 WRITE !,?5,"The Resource Usage Monitor is currently "
+14 IF +$GET(^%ZTSCH("LOGRSRC"))
WRITE "running."
+15 IF '$TEST
WRITE "stopped."
+16 WRITE !
+17 IF '$DATA(^DIC(19,"B","KMPR BACKGROUND DRIVER"))
Begin DoDot:1
+18 WRITE !," The 'RUM Background Driver' option [KMPR BACKGROUND DRIVER] is missing !",*7,!
End DoDot:1
+19 IF '$TEST
Begin DoDot:1
+20 SET KMPRX=$ORDER(^DIC(19,"B","KMPR BACKGROUND DRIVER",0))
+21 SET KMPRX=+$ORDER(^DIC(19.2,"B",KMPRX,0))
+22 IF 'KMPRX
WRITE !?5,"The 'RUM Background Driver' [KMPR BACKGROUND DRIVER] is not scheduled",!?5,"to run!",!
QUIT
+23 SET KMPRX=$GET(^DIC(19.2,KMPRX,0))
+24 SET $PIECE(KMPRX,U,2)=$$FMTE^XLFDT($PIECE(KMPRX,U,2))
+25 WRITE !,?5,"The 'RUM Background Driver' [KMPR BACKGROUND DRIVER]"
+26 WRITE !?5,"is QUEUED TO RUN AT ",$PIECE(KMPRX,U,2)
+27 WRITE !,?5,"with a RESCHEDULING FREQUENCY of '",$PIECE(KMPRX,U,6),"'."
End DoDot:1
+28 WRITE !!,?5,"The temporary collection global (i.e., 'XTMP(""KMPR"")') is",$SELECT('$DATA(^XTMP("KMPR")):" not",1:"")," present",!,?5,"on your system.",!
+29 WRITE !!,"Press <RETURN> to continue: "
READ X:DTIME
+30 ;
+31 QUIT
+32 ;
START ; Start Resource Usage Monitor collection
+1 NEW CHECK
+2 ; check environment
+3 DO ENVCHECK^KMPRUTL1(.CHECK,1)
+4 ; if RUM does not support this operating system then quit.
+5 IF (+CHECK)=100
WRITE !!
DO ENVOUTPT^KMPRUTL1(CHECK,1,1)
HANG 1
QUIT
+6 IF +$GET(^%ZTSCH("LOGRSRC"))
WRITE !!,?10,"The Resource Usage Monitor is already running.",!
HANG 1
QUIT
+7 WRITE !
KILL DIR
SET DIR(0)="Y"
SET DIR("B")="YES"
+8 SET DIR("?")="Answer YES to start collecting Resource Usage Monitor data"
+9 SET DIR("A")="Do you want to start Resource Usage Monitor collection"
+10 DO ^DIR
IF $DATA(DTOUT)!$DATA(DUOUT)
GOTO END
+11 IF Y
Begin DoDot:1
+12 SET DIE=8989.3
SET DA=1
SET DR="300///YES"
DO ^DIE
+13 WRITE !!,?10,"Resource Usage Monitor collection is started.",!
+14 DO ENVCHECK^KMPRUTL1(.CHECK,1)
+15 ; if background driver not scheduled to run then start it up
+16 IF (+CHECK=200)
DO QUEBKG^KMPRUTL1
End DoDot:1
+17 IF '$TEST
WRITE !!,?10,"Resource Usage Monitor collection is NOT started.",!
+18 HANG 1
GOTO END
+19 ;
STOP ; Stop Resource Usage Monitor collection
+1 IF '+$GET(^%ZTSCH("LOGRSRC"))
WRITE !!,?10,"The Resource Usage Monitor is already stopped.",!
HANG 1
QUIT
+2 WRITE !
KILL DIR
SET DIR(0)="Y"
SET DIR("B")="YES"
+3 SET DIR("?")="Answer YES to stop collecting Resource Usage Monitor data"
+4 SET DIR("A")="Do you want to stop Resource Usage Monitor collection"
+5 DO ^DIR
IF $DATA(DTOUT)!$DATA(DUOUT)
GOTO END
+6 IF Y
Begin DoDot:1
+7 SET DIE=8989.3
SET DA=1
SET DR="300///NO"
DO ^DIE
+8 WRITE !!,?10,"Resource Usage Monitor collection is stopped.",!
End DoDot:1
+9 IF '$TEST
WRITE !!,?10,"Resource Usage Monitor collection is NOT stopped.",!
+10 HANG 1
+11 ;
END ;
+1 KILL DA,DIE,DIR,DR,DTOUT,DUOUT,X,Y
+2 QUIT