XUCSXDR ;SFISC/HVB - Tabular Summary for 486 SITES ;3/21/96 07:58 [ 04/02/2003 8:47 AM ]
;;7.3;TOOLKIT;**1001**;APR 1, 2003
;;7.3;TOOLKIT;**14**;Dec 15, 1995
A Q:'$$CHKF^XUCSUTL
S U="^" S:'$D(DT) DT=$$HTFM^XLFDT($H,1) S:'$D(DTIME) DTIME=300
S XUCSEND=0 D A3^XUCSUTL3 I XUCSEND K MAIL G XIT
S DIR("A")="Mail report",DIR("B")="NO",DIR(0)="Y" D ^DIR Q:$D(DIRUT)
I Y K XMY S MAIL=2,IOM=80 G DQ
S %ZIS="Q" D ^%ZIS I POP G XIT
I $D(IO("Q")) D G XIT
. S ZTSAVE("XUCS*")="",ZTRTN="DQ^XUCSXDR",ZTDESC="MPM TABULAR SUMMARY",ZTIO=ION
. S %DT="AEFRX",%DT("A")="Queue for what DATE/TIME? ",%DT("B")="NOW",%DT(0)="NOW" D ^%DT K %DT
. I +Y'<0 S ZTDTH=Y D ^%ZTLOAD,HOME^%ZIS
. K IO("Q")
U IO W:$E(IOST)="C" ! G DQ
DR ; Daily Report in mail message - noninteractive
K XMY S MAIL=1,X=0 F S X=$O(^XUCS(8987.1,1,2,X)) Q:X]"@"!(X="") S XMY(^(X,0))=""
G NOT:'$D(XMY) S U="^",DT=$$HTFM^XLFDT($H,1),X1=DT,X2=-1 D C^%DTC S (XUCSBD,XUCSED)=X,XUCSRT="B"
DQ ; Dequeue entry point
K CD,RT,ST,^TMP($J,"XUCS") S L=1,HDR(1)=" " F I=1:1:75 S HDR(1)=HDR(1)_"="
S XUCSUN=$S($D(XUCSUN):XUCSUN,1:"000"),NODE=XUCSUN_"@@@"
F S NODE=$O(^XUCS(8987.2,"B",NODE)) Q:NODE=""!(XUCSUN&($E(NODE,1,3)'=XUCSUN)) S X=$O(^(NODE,"")) D
. S FMDT=XUCSBD F S FMDT=$O(^XUCS(8987.2,"C",FMDT)) Q:FMDT="" Q:$D(^(FMDT,X))
. Q:FMDT="" S Y=$O(^XUCS(8987.2,"C",FMDT,X,0))-1
. F S Y=$O(^XUCS(8987.2,X,1,Y)) Q:Y]"@"!(Y="") S FMDT=^(Y,0) Q:FMDT>(XUCSED+.24) D:FMDT>XUCSBD&($D(^(5))>1)
. . I $E($P(FMDT,".",2),1,2)<12,XUCSRT="P" Q
. . I $E($P(FMDT,".",2),1,2)>11,XUCSRT="A" Q
. . F I=1:1:17 S $P(RT(NODE),U,I)=$P($G(RT(NODE)),U,I)+$P(^XUCS(8987.2,X,1,Y,5,I,0),U,3)
. . S X1=0 F S X1=$O(^XUCS(8987.2,X,1,Y,6,X1)) Q:+X1<1 S X0=^(+X1,0) D
. . . S $P(CD(NODE),U,5)=$P($G(CD(NODE)),U,5)+1
. . . F I=1:1:4 S $P(CD(NODE),U,I)=$P(CD(NODE),U,I)+$P(X0,U,I+1)
. . S $P(ST(NODE),U,21)=$P($G(ST(NODE)),U,21)+$P(FMDT,U,3)
. . S $P(ST(NODE),U,22)=$P(ST(NODE),U,22)+$P(FMDT,U,5)
. . F I=1:1:17 S $P(ST(NODE),U,I)=$P(ST(NODE),U,I)+$P(^XUCS(8987.2,X,1,Y,3,1,0),U,I)
P I '$D(RT) W:'$D(ZTQUEUED) " NO DATA between ",$$FMTE^XLFDT(XUCSBD)," and ",$$FMTE^XLFDT(XUCSED)," for ",$P($G(^DIC(4,XUCSUN,0)),U),"!",! K MAIL G XIT
S Y=XUCSBD D DD^%DT S BD=Y,Y=XUCSED D DD^%DT S ED=Y D ISTR
S (NODE,OSITE)="" F S NODE=$O(ST(NODE)) Q:NODE="" D
. S SITE=$E(NODE,1,3) I SITE'=OSITE,OSITE]"" D PRINT
. S (J,SEET,SUM)=0 F M=0.3,1.4,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,15,25 S J=J+1,CNT=$P(RT(NODE),U,J),SEET=SEET+(CNT*M),SUM=SUM+CNT S:J=2 CUM=SUM
. S OSITE=SITE,TY=$E(NODE,4,5),X=ST(NODE),CNT=$P(X,U),SET=$P(X,U,21)
. S STR(1)=STR(1)_$J(NODE,7),Y=$G(CD(NODE)),S=+Y
. S STR(2)=STR(2)_$S(S:$J($P(Y,U,2)/S*100,7,0),1:" ")
. S STR(3)=STR(3)_$S(S:$J($P(Y,U,3)/S*100,7,0),1:" ")
. S STR(4)=STR(4)_$S(TY="CS"&SUM:$J(SEET/SUM,7,2),1:" ")
. S STR(5)=STR(5)_$S(TY="CS"&SUM:$J(CUM/SUM*100,7,0),1:" ")
. S STR(6)=STR(6)_$S(TY="CS"&SUM:$J(SUM/SET,7,1),1:" ")
. S STR(7)=STR(7)_$J($P(X,U,22)/CNT,7,0)
. S STR(8)=STR(8)_$S($P(X,U,13):$J($P(X,U,13)/SET,7,0),1:" ")
. S STR(9)=STR(9)_$S($P(X,U,14):$J($P(X,U,14)/SET,7,0),1:" ")
. S STR(10)=STR(10)_$J($P(X,U,16)/SET,7,0)
. S STR(11)=STR(11)_$J($P(X,U,7)/SET,7,0)
. S STR(12)=STR(12)_$J($P(X,U,5)+$P(X,U,6)/SET,7,0)
. S STR(13)=STR(13)_$J($P(X,U,2)/SET,7,0)
. S STR(14)=STR(14)_$J($P(X,U,3)/SET,7,0)
. S STR(15)=STR(15)_$S($P(X,U,9):$J($P(X,U,9)-$P(X,U,2)/$P(X,U,9)*100,7,0),1:" ")
. S STR(16)=STR(16)_$S($P(X,U,10):$J($P(X,U,10)-$P(X,U,3)/$P(X,U,10)*100,7,0),1:" ")
. S STR(17)=STR(17)_$S($P(X,U,11):$J($P(X,U,11)/SET,7,0),1:" ")
. S STR(18)=STR(18)_$S($P(X,U,12):$J($P(X,U,12)/SET,7,0),1:" ")
. S STR(19)=STR(19)_$S($P(X,U,12):$J($P(X,U,17)/$P(X,U,12)*100,7,0),1:" ")
. S STR(20)=STR(20)_$J(CNT,7,0)
PRINT S HDR(2)=" "_$E($P($G(^DIC(4,OSITE,0)),U),1,20) F I=1:1:22-$L(HDR(2)) S HDR(2)=HDR(2)_" "
S HDR(2)=HDR(2)_" MPM Summary for "_BD_" to "_ED_" ("_$S(XUCSRT="A":"AM)",XUCSRT="P":"PM)",1:"AM&PM)")
I $D(MAIL) D
. F I=1,2,1 S ^TMP($J,"XUCS",L)=HDR(I),L=L+1
. F I=1:1:20 S ^TMP($J,"XUCS",L)=STR(I),L=L+1
E D
. F I=1,2,1 W HDR(I),!
. F I=1:1:20 W STR(I),!
. I NODE]"" W @IOF
G XIT:NODE=""
ISTR S STR(1)=" Node "
S STR(2)=" CPU Usage % "
S STR(3)=" Disk Usage % "
S STR(4)=" Response Time Sec "
S STR(5)=" RTs<2 Seconds % "
S STR(6)=" Responses/S "
S STR(7)=" Ave. # Jobs "
S STR(8)=" Term InChar/S "
S STR(9)=" Term OutChar/S "
S STR(10)=" M Commands/S "
S STR(11)=" Global Gets/S "
S STR(12)=" Global S&Ks/S "
S STR(13)=" Disk Reads/S "
S STR(14)=" Disk Writes/S "
S STR(15)=" Read Cache % "
S STR(16)=" Write Cache % "
S STR(17)=" DDP Requests/S "
S STR(18)=" RVG Requests/S "
S STR(19)=" RVG Cache % "
S STR(20)=" RTH Sessions "
Q
NOT I $G(DUZ)\1 S XQA(DUZ)="",XQAMSG="No local CMP recipients in MSM RTHIST SITE file, no MPM Daily Summary" D SETUP^XQALERT K XQA,XQAMSG,MAIL
XIT I $D(MAIL) S XMDUZ="MPM",XMTEXT="^TMP($J,""XUCS"",",XMSUB=$S(MAIL=1:"MPM Morning Report for "_+$E(XUCSBD,4,5)_"/"_+$E(XUCSBD,6,7)_"/"_$E(XUCSBD,2,3),1:"MPM Summary Report"),XMCHAN=1 D ^XMD
I $E($G(IOST))'="C",'$D(ZTQUEUED) D ^%ZISC
K BD,CD,CNT,CUM,DIR,ED,FMDT,HDR,I,J,L,M,MAIL,NODE,OSITE,RT,S,SEET
K SET,SITE,ST,STR,SUM,TY,X,X0,X1,X2,XMY,XMCHAN,XMDUZ,XMSUB,XMTEXT
K XUCSBD,XUCSED,XUCSEND,XUCSRT,XUCSUN,Y
Q
ONE ; One site only
S U="^",DT=$$HTFM^XLFDT($H,1),DIR("A")="Select MPM Site",DIR(0)="P^4:EMZ" D ^DIR Q:$D(DIRUT) S XUCSUN=$P(Y,U) G A
XUCSXDR ;SFISC/HVB - Tabular Summary for 486 SITES ;3/21/96 07:58 [ 04/02/2003 8:47 AM ]
+1 ;;7.3;TOOLKIT;**1001**;APR 1, 2003
+2 ;;7.3;TOOLKIT;**14**;Dec 15, 1995
A IF '$$CHKF^XUCSUTL
QUIT
+1 SET U="^"
IF '$DATA(DT)
SET DT=$$HTFM^XLFDT($HOROLOG,1)
IF '$DATA(DTIME)
SET DTIME=300
+2 SET XUCSEND=0
DO A3^XUCSUTL3
IF XUCSEND
KILL MAIL
GOTO XIT
+3 SET DIR("A")="Mail report"
SET DIR("B")="NO"
SET DIR(0)="Y"
DO ^DIR
IF $DATA(DIRUT)
QUIT
+4 IF Y
KILL XMY
SET MAIL=2
SET IOM=80
GOTO DQ
+5 SET %ZIS="Q"
DO ^%ZIS
IF POP
GOTO XIT
+6 IF $DATA(IO("Q"))
Begin DoDot:1
+7 SET ZTSAVE("XUCS*")=""
SET ZTRTN="DQ^XUCSXDR"
SET ZTDESC="MPM TABULAR SUMMARY"
SET ZTIO=ION
+8 SET %DT="AEFRX"
SET %DT("A")="Queue for what DATE/TIME? "
SET %DT("B")="NOW"
SET %DT(0)="NOW"
DO ^%DT
KILL %DT
+9 IF +Y'<0
SET ZTDTH=Y
DO ^%ZTLOAD
DO HOME^%ZIS
+10 KILL IO("Q")
End DoDot:1
GOTO XIT
+11 USE IO
IF $EXTRACT(IOST)="C"
WRITE !
GOTO DQ
DR ; Daily Report in mail message - noninteractive
+1 KILL XMY
SET MAIL=1
SET X=0
FOR
SET X=$ORDER(^XUCS(8987.1,1,2,X))
IF X]"@"!(X="")
QUIT
SET XMY(^(X,0))=""
+2 IF '$DATA(XMY)
GOTO NOT
SET U="^"
SET DT=$$HTFM^XLFDT($HOROLOG,1)
SET X1=DT
SET X2=-1
DO C^%DTC
SET (XUCSBD,XUCSED)=X
SET XUCSRT="B"
DQ ; Dequeue entry point
+1 KILL CD,RT,ST,^TMP($JOB,"XUCS")
SET L=1
SET HDR(1)=" "
FOR I=1:1:75
SET HDR(1)=HDR(1)_"="
+2 SET XUCSUN=$SELECT($DATA(XUCSUN):XUCSUN,1:"000")
SET NODE=XUCSUN_"@@@"
+3 FOR
SET NODE=$ORDER(^XUCS(8987.2,"B",NODE))
IF NODE=""!(XUCSUN&($EXTRACT(NODE,1,3)'=XUCSUN))
QUIT
SET X=$ORDER(^(NODE,""))
Begin DoDot:1
+4 SET FMDT=XUCSBD
FOR
SET FMDT=$ORDER(^XUCS(8987.2,"C",FMDT))
IF FMDT=""
QUIT
IF $DATA(^(FMDT,X))
QUIT
+5 IF FMDT=""
QUIT
SET Y=$ORDER(^XUCS(8987.2,"C",FMDT,X,0))-1
+6 FOR
SET Y=$ORDER(^XUCS(8987.2,X,1,Y))
IF Y]"@"!(Y="")
QUIT
SET FMDT=^(Y,0)
IF FMDT>(XUCSED+.24)
QUIT
IF FMDT>XUCSBD&($DATA(^(5))>1)
Begin DoDot:2
+7 IF $EXTRACT($PIECE(FMDT,".",2),1,2)<12
IF XUCSRT="P"
QUIT
+8 IF $EXTRACT($PIECE(FMDT,".",2),1,2)>11
IF XUCSRT="A"
QUIT
+9 FOR I=1:1:17
SET $PIECE(RT(NODE),U,I)=$PIECE($GET(RT(NODE)),U,I)+$PIECE(^XUCS(8987.2,X,1,Y,5,I,0),U,3)
+10 SET X1=0
FOR
SET X1=$ORDER(^XUCS(8987.2,X,1,Y,6,X1))
IF +X1<1
QUIT
SET X0=^(+X1,0)
Begin DoDot:3
+11 SET $PIECE(CD(NODE),U,5)=$PIECE($GET(CD(NODE)),U,5)+1
+12 FOR I=1:1:4
SET $PIECE(CD(NODE),U,I)=$PIECE(CD(NODE),U,I)+$PIECE(X0,U,I+1)
End DoDot:3
+13 SET $PIECE(ST(NODE),U,21)=$PIECE($GET(ST(NODE)),U,21)+$PIECE(FMDT,U,3)
+14 SET $PIECE(ST(NODE),U,22)=$PIECE(ST(NODE),U,22)+$PIECE(FMDT,U,5)
+15 FOR I=1:1:17
SET $PIECE(ST(NODE),U,I)=$PIECE(ST(NODE),U,I)+$PIECE(^XUCS(8987.2,X,1,Y,3,1,0),U,I)
End DoDot:2
End DoDot:1
P IF '$DATA(RT)
IF '$DATA(ZTQUEUED)
WRITE " NO DATA between ",$$FMTE^XLFDT(XUCSBD)," and ",$$FMTE^XLFDT(XUCSED)," for ",$PIECE($GET(^DIC(4,XUCSUN,0)),U),"!",!
KILL MAIL
GOTO XIT
+1 SET Y=XUCSBD
DO DD^%DT
SET BD=Y
SET Y=XUCSED
DO DD^%DT
SET ED=Y
DO ISTR
+2 SET (NODE,OSITE)=""
FOR
SET NODE=$ORDER(ST(NODE))
IF NODE=""
QUIT
Begin DoDot:1
+3 SET SITE=$EXTRACT(NODE,1,3)
IF SITE'=OSITE
IF OSITE]""
DO PRINT
+4 SET (J,SEET,SUM)=0
FOR M=0.3,1.4,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,15,25
SET J=J+1
SET CNT=$PIECE(RT(NODE),U,J)
SET SEET=SEET+(CNT*M)
SET SUM=SUM+CNT
IF J=2
SET CUM=SUM
+5 SET OSITE=SITE
SET TY=$EXTRACT(NODE,4,5)
SET X=ST(NODE)
SET CNT=$PIECE(X,U)
SET SET=$PIECE(X,U,21)
+6 SET STR(1)=STR(1)_$JUSTIFY(NODE,7)
SET Y=$GET(CD(NODE))
SET S=+Y
+7 SET STR(2)=STR(2)_$SELECT(S:$JUSTIFY($PIECE(Y,U,2)/S*100,7,0),1:" ")
+8 SET STR(3)=STR(3)_$SELECT(S:$JUSTIFY($PIECE(Y,U,3)/S*100,7,0),1:" ")
+9 SET STR(4)=STR(4)_$SELECT(TY="CS"&SUM:$JUSTIFY(SEET/SUM,7,2),1:" ")
+10 SET STR(5)=STR(5)_$SELECT(TY="CS"&SUM:$JUSTIFY(CUM/SUM*100,7,0),1:" ")
+11 SET STR(6)=STR(6)_$SELECT(TY="CS"&SUM:$JUSTIFY(SUM/SET,7,1),1:" ")
+12 SET STR(7)=STR(7)_$JUSTIFY($PIECE(X,U,22)/CNT,7,0)
+13 SET STR(8)=STR(8)_$SELECT($PIECE(X,U,13):$JUSTIFY($PIECE(X,U,13)/SET,7,0),1:" ")
+14 SET STR(9)=STR(9)_$SELECT($PIECE(X,U,14):$JUSTIFY($PIECE(X,U,14)/SET,7,0),1:" ")
+15 SET STR(10)=STR(10)_$JUSTIFY($PIECE(X,U,16)/SET,7,0)
+16 SET STR(11)=STR(11)_$JUSTIFY($PIECE(X,U,7)/SET,7,0)
+17 SET STR(12)=STR(12)_$JUSTIFY($PIECE(X,U,5)+$PIECE(X,U,6)/SET,7,0)
+18 SET STR(13)=STR(13)_$JUSTIFY($PIECE(X,U,2)/SET,7,0)
+19 SET STR(14)=STR(14)_$JUSTIFY($PIECE(X,U,3)/SET,7,0)
+20 SET STR(15)=STR(15)_$SELECT($PIECE(X,U,9):$JUSTIFY($PIECE(X,U,9)-$PIECE(X,U,2)/$PIECE(X,U,9)*100,7,0),1:" ")
+21 SET STR(16)=STR(16)_$SELECT($PIECE(X,U,10):$JUSTIFY($PIECE(X,U,10)-$PIECE(X,U,3)/$PIECE(X,U,10)*100,7,0),1:" ")
+22 SET STR(17)=STR(17)_$SELECT($PIECE(X,U,11):$JUSTIFY($PIECE(X,U,11)/SET,7,0),1:" ")
+23 SET STR(18)=STR(18)_$SELECT($PIECE(X,U,12):$JUSTIFY($PIECE(X,U,12)/SET,7,0),1:" ")
+24 SET STR(19)=STR(19)_$SELECT($PIECE(X,U,12):$JUSTIFY($PIECE(X,U,17)/$PIECE(X,U,12)*100,7,0),1:" ")
+25 SET STR(20)=STR(20)_$JUSTIFY(CNT,7,0)
End DoDot:1
PRINT SET HDR(2)=" "_$EXTRACT($PIECE($GET(^DIC(4,OSITE,0)),U),1,20)
FOR I=1:1:22-$LENGTH(HDR(2))
SET HDR(2)=HDR(2)_" "
+1 SET HDR(2)=HDR(2)_" MPM Summary for "_BD_" to "_ED_" ("_$SELECT(XUCSRT="A":"AM)",XUCSRT="P":"PM)",1:"AM&PM)")
+2 IF $DATA(MAIL)
Begin DoDot:1
+3 FOR I=1,2,1
SET ^TMP($JOB,"XUCS",L)=HDR(I)
SET L=L+1
+4 FOR I=1:1:20
SET ^TMP($JOB,"XUCS",L)=STR(I)
SET L=L+1
End DoDot:1
+5 IF '$TEST
Begin DoDot:1
+6 FOR I=1,2,1
WRITE HDR(I),!
+7 FOR I=1:1:20
WRITE STR(I),!
+8 IF NODE]""
WRITE @IOF
End DoDot:1
+9 IF NODE=""
GOTO XIT
ISTR SET STR(1)=" Node "
+1 SET STR(2)=" CPU Usage % "
+2 SET STR(3)=" Disk Usage % "
+3 SET STR(4)=" Response Time Sec "
+4 SET STR(5)=" RTs<2 Seconds % "
+5 SET STR(6)=" Responses/S "
+6 SET STR(7)=" Ave. # Jobs "
+7 SET STR(8)=" Term InChar/S "
+8 SET STR(9)=" Term OutChar/S "
+9 SET STR(10)=" M Commands/S "
+10 SET STR(11)=" Global Gets/S "
+11 SET STR(12)=" Global S&Ks/S "
+12 SET STR(13)=" Disk Reads/S "
+13 SET STR(14)=" Disk Writes/S "
+14 SET STR(15)=" Read Cache % "
+15 SET STR(16)=" Write Cache % "
+16 SET STR(17)=" DDP Requests/S "
+17 SET STR(18)=" RVG Requests/S "
+18 SET STR(19)=" RVG Cache % "
+19 SET STR(20)=" RTH Sessions "
+20 QUIT
NOT IF $GET(DUZ)\1
SET XQA(DUZ)=""
SET XQAMSG="No local CMP recipients in MSM RTHIST SITE file, no MPM Daily Summary"
DO SETUP^XQALERT
KILL XQA,XQAMSG,MAIL
XIT IF $DATA(MAIL)
SET XMDUZ="MPM"
SET XMTEXT="^TMP($J,""XUCS"","
SET XMSUB=$SELECT(MAIL=1:"MPM Morning Report for "_+$EXTRACT(XUCSBD,4,5)_"/"_+$EXTRACT(XUCSBD,6,7)_"/"_$EXTRACT(XUCSBD,2,3),1:"MPM Summary Report")
SET XMCHAN=1
DO ^XMD
+1 IF $EXTRACT($GET(IOST))'="C"
IF '$DATA(ZTQUEUED)
DO ^%ZISC
+2 KILL BD,CD,CNT,CUM,DIR,ED,FMDT,HDR,I,J,L,M,MAIL,NODE,OSITE,RT,S,SEET
+3 KILL SET,SITE,ST,STR,SUM,TY,X,X0,X1,X2,XMY,XMCHAN,XMDUZ,XMSUB,XMTEXT
+4 KILL XUCSBD,XUCSED,XUCSEND,XUCSRT,XUCSUN,Y
+5 QUIT
ONE ; One site only
+1 SET U="^"
SET DT=$$HTFM^XLFDT($HOROLOG,1)
SET DIR("A")="Select MPM Site"
SET DIR(0)="P^4:EMZ"
DO ^DIR
IF $DATA(DIRUT)
QUIT
SET XUCSUN=$PIECE(Y,U)
GOTO A