XUTMTZ3 ;SEA/RDS - TaskMan: Toolkit, troubleshooting, part 4 ;6/25/91 15:20 ; [ 04/02/2003 8:29 AM ]
;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
;;8.0;KERNEL;;Jul 10, 1995
;
HERE ;REPORT--log errors by count for this cpu
S ZTV=^%ZOSF("VOL"),ZT1=0 W !,ZTV
F ZT=0:0 S ZT1=$O(^%ZTER(1,ZT1)),ZT2=0 Q:'ZT1 F ZT=0:0 S ZT2=$O(^%ZTER(1,ZT1,1,ZT2)) Q:'ZT2 I $D(^(ZT2,"ZE"))#2 S ZTE=$E($TR(^("ZE"),ZTRANSLT,""),1,40) I ZTE]"" D LOG
Q
;
OTHERS ;REPORT--find other cpus, lookup mgr accounts, compute for each
S ZTV="" F ZT=0:0 S ZTV=$O(^%ZIS(14.5,"B",ZTV)) Q:ZTV="" I ZTV'=^%ZOSF("VOL") S ZTN=$O(^%ZIS(14.5,"B",ZTV,"")) I ZTN]"",$D(^%ZIS(14.5,ZTN,0))#2 S ZTS=^(0) S ZTM=$P(ZTS,"^",6) I ZTM]"" D THERE
Q
;
THERE ;OTHERS--log errors by count for other cpus
I $P(ZTS,"^",3)="N" Q
I $P(ZTS,"^",4)="Y" Q
W !,ZTV S ZT1=0
F ZT=0:0 S ZT1=$O(^[ZTM,ZTV]%ZTER(1,ZT1)),ZT2=0 Q:'ZT1 F ZT=0:0 S ZT2=$O(^[ZTM,ZTV]%ZTER(1,ZT1,1,ZT2)) Q:'ZT2 I $D(^(ZT2,"ZE"))#2 S ZTE=$E($TR(^("ZE"),ZTRANSLT,""),1,40) I ZTE]"" D LOG
Q
;
LOG ;HERE & THERE--log totals entry and dailies entry
I ZTDAY,$H-ZT1<ZTNUMBER S X=$S($D(^TMP($J,"D",1,ZT1,ZTE))#2:^(ZTE),1:"0^,"),Y=$P(X,"^",2),X=X+1,^(ZTE)=X_"^"_Y_$S(Y[(","_ZTV_","):"",1:ZTV_",")
I ZTCOUNT S X=$S($D(^TMP($J,"T",1,ZTE))#2:^(ZTE),1:"0^,"),Y=$P(X,"^",2),X=X+1,^(ZTE)=X_"^"_Y_$S(Y[(","_ZTV_","):"",1:ZTV_",")
W "." Q
;
DAILIES ;REPORT--compute dailies
W !,"DAILIES"
S ZT1=0 F ZT=0:0 S ZT1=$O(^TMP($J,"D",1,ZT1)),ZT2="" Q:'ZT1 F ZT=0:0 S ZT2=$O(^TMP($J,"D",1,ZT1,ZT2)) Q:ZT2="" S ZTX=^(ZT2),^TMP($J,"D",2,99999-ZT1,99999-ZTX,ZT2)=$P(ZTX,"^",2) W "."
Q
;
TOTALS ;REPORT--compute totals
W !,"TOTALS"
S ZT1="" F ZT=0:0 S ZT1=$O(^TMP($J,"T",1,ZT1)) Q:ZT1="" S ZTX=^(ZT1),^TMP($J,"T",2,99999-ZTX,ZT1)=$P(ZTX,"^",2) W "."
Q
;
OUT ;REPORT--report the data computed
I ZTCOUNT W !!,"Errors by total count since install:"
I ZTCOUNT S ZT1=0 F ZT=0:0 S ZT1=$O(^TMP($J,"T",2,ZT1)),ZT2="" Q:'ZT1 F ZT=0:0 S ZT2=$O(^TMP($J,"T",2,ZT1,ZT2)) Q:ZT2="" S X=^(ZT2) W !,99999-ZT1,?4,ZT2,?46,$E(X,2,$L(X)-1)
I ZTDAY W !!,"Errors by day:"
I ZTDAY S ZT1=0 F ZT=0:0 S ZT1=$O(^TMP($J,"D",2,ZT1)),ZT2=0 Q:'ZT1 W !,$$HTE^XLFDT(99999-ZT1) D OUT2
Q
;
OUT2 ;OUT--report the data by day
F ZT=0:0 S ZT2=$O(^TMP($J,"D",2,ZT1,ZT2)),ZT3="" Q:'ZT2 F ZT=0:0 S ZT3=$O(^TMP($J,"D",2,ZT1,ZT2,ZT3)) Q:ZT3="" S X=^(ZT3) W !,99999-ZT2,?4,ZT3,?46,$E(X,2,$L(X)-1)
Q
;
SEND ;REPORT--mail the report to the San Francisco ISC
W !,"Assembling mail report" S ZTLINE=1
I ZTCOUNT S ^TMP($J,"M",ZTLINE,0)="Report by raw count since install:",ZTLINE=ZTLINE+1
I ZTCOUNT S ZT1=0 F ZT=0:0 S ZT1=$O(^TMP($J,"T",2,ZT1)),ZT2="" Q:'ZT1 F ZT=0:0 S ZT2=$O(^TMP($J,"T",2,ZT1,ZT2)) Q:ZT2="" S X=^(ZT2),^TMP($J,"M",ZTLINE,0)=$J(99999-ZT1,5)_$J(ZT2,45)_" "_$E(X,2,$L(X)-1),ZTLINE=ZTLINE+1 W "."
I ZTCOUNT,ZTDAY S ^TMP($J,"M",ZTLINE,0)=" ",ZTLINE=ZTLINE+1
I ZTDAY S ^TMP($J,"M",ZTLINE,0)="Report by day:",ZTLINE=ZTLINE+1
I ZTDAY S ZT1=0 F ZT=0:0 S ZT1=$O(^TMP($J,"D",2,ZT1)),ZT2=0 Q:'ZT1 S ^TMP($J,"M",ZTLINE,0)=$$HTE^XLFDT(99999-ZT1)_":",ZTLINE=ZTLINE+1 D SEND2
S ZTN="" I $D(^XMB(1,1,0))#2 S ZTN=$P(^(0),"^")
I ZTN]"",$D(^DIC(4.2,ZTN,0))#2 S ZTN=$P(^(0),"^")
D EN^XM S XMSUB="Error report from "_ZTN_" on "_$$HTE^XLFDT($H)
S XMTEXT="^TMP($J,""M"","
W !,"Sending the report..." D ^XMD,KILL^XM W !!,"Report sent."
Q
;
SEND2 ;MAIL--prepare to mail report by day
F ZT=0:0 S ZT2=$O(^TMP($J,"D",2,ZT1,ZT2)),ZT3="" Q:'ZT2 F ZT=0:0 S ZT3=$O(^TMP($J,"D",2,ZT1,ZT2,ZT3)) Q:ZT3="" S X=^(ZT3),^TMP($J,"M",ZTLINE,0)=$J(99999-ZT2,5)_$J(ZT3,45)_" "_$E(X,2,$L(X)-1),ZTLINE=ZTLINE+1 W "."
Q
;
XUTMTZ3 ;SEA/RDS - TaskMan: Toolkit, troubleshooting, part 4 ;6/25/91 15:20 ; [ 04/02/2003 8:29 AM ]
+1 ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
+2 ;;8.0;KERNEL;;Jul 10, 1995
+3 ;
HERE ;REPORT--log errors by count for this cpu
+1 SET ZTV=^%ZOSF("VOL")
SET ZT1=0
WRITE !,ZTV
+2 FOR ZT=0:0
SET ZT1=$ORDER(^%ZTER(1,ZT1))
SET ZT2=0
IF 'ZT1
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^%ZTER(1,ZT1,1,ZT2))
IF 'ZT2
QUIT
IF $DATA(^(ZT2,"ZE"))#2
SET ZTE=$EXTRACT($TRANSLATE(^("ZE"),ZTRANSLT,""),1,40)
IF ZTE]""
DO LOG
+3 QUIT
+4 ;
OTHERS ;REPORT--find other cpus, lookup mgr accounts, compute for each
+1 SET ZTV=""
FOR ZT=0:0
SET ZTV=$ORDER(^%ZIS(14.5,"B",ZTV))
IF ZTV=""
QUIT
IF ZTV'=^%ZOSF("VOL")
SET ZTN=$ORDER(^%ZIS(14.5,"B",ZTV,""))
IF ZTN]""
IF $DATA(^%ZIS(14.5,ZTN,0))#2
SET ZTS=^(0)
SET ZTM=$PIECE(ZTS,"^",6)
IF ZTM]""
DO THERE
+2 QUIT
+3 ;
THERE ;OTHERS--log errors by count for other cpus
+1 IF $PIECE(ZTS,"^",3)="N"
QUIT
+2 IF $PIECE(ZTS,"^",4)="Y"
QUIT
+3 WRITE !,ZTV
SET ZT1=0
+4 FOR ZT=0:0
SET ZT1=$ORDER(^[ZTM,ZTV]%ZTER(1,ZT1))
SET ZT2=0
IF 'ZT1
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^[ZTM,ZTV]%ZTER(1,ZT1,1,ZT2))
IF 'ZT2
QUIT
IF $DATA(^(ZT2,"ZE"))#2
SET ZTE=$EXTRACT($TRANSLATE(^("ZE"),ZTRANSLT,""),1,40)
IF ZTE]""
DO LOG
+5 QUIT
+6 ;
LOG ;HERE & THERE--log totals entry and dailies entry
+1 IF ZTDAY
IF $HOROLOG-ZT1<ZTNUMBER
SET X=$SELECT($DATA(^TMP($JOB,"D",1,ZT1,ZTE))#2:^(ZTE),1:"0^,")
SET Y=$PIECE(X,"^",2)
SET X=X+1
SET ^(ZTE)=X_"^"_Y_$SELECT(Y[(","_ZTV_","):"",1:ZTV_",")
+2 IF ZTCOUNT
SET X=$SELECT($DATA(^TMP($JOB,"T",1,ZTE))#2:^(ZTE),1:"0^,")
SET Y=$PIECE(X,"^",2)
SET X=X+1
SET ^(ZTE)=X_"^"_Y_$SELECT(Y[(","_ZTV_","):"",1:ZTV_",")
+3 WRITE "."
QUIT
+4 ;
DAILIES ;REPORT--compute dailies
+1 WRITE !,"DAILIES"
+2 SET ZT1=0
FOR ZT=0:0
SET ZT1=$ORDER(^TMP($JOB,"D",1,ZT1))
SET ZT2=""
IF 'ZT1
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^TMP($JOB,"D",1,ZT1,ZT2))
IF ZT2=""
QUIT
SET ZTX=^(ZT2)
SET ^TMP($JOB,"D",2,99999-ZT1,99999-ZTX,ZT2)=$PIECE(ZTX,"^",2)
WRITE "."
+3 QUIT
+4 ;
TOTALS ;REPORT--compute totals
+1 WRITE !,"TOTALS"
+2 SET ZT1=""
FOR ZT=0:0
SET ZT1=$ORDER(^TMP($JOB,"T",1,ZT1))
IF ZT1=""
QUIT
SET ZTX=^(ZT1)
SET ^TMP($JOB,"T",2,99999-ZTX,ZT1)=$PIECE(ZTX,"^",2)
WRITE "."
+3 QUIT
+4 ;
OUT ;REPORT--report the data computed
+1 IF ZTCOUNT
WRITE !!,"Errors by total count since install:"
+2 IF ZTCOUNT
SET ZT1=0
FOR ZT=0:0
SET ZT1=$ORDER(^TMP($JOB,"T",2,ZT1))
SET ZT2=""
IF 'ZT1
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^TMP($JOB,"T",2,ZT1,ZT2))
IF ZT2=""
QUIT
SET X=^(ZT2)
WRITE !,99999-ZT1,?4,ZT2,?46,$EXTRACT(X,2,$LENGTH(X)-1)
+3 IF ZTDAY
WRITE !!,"Errors by day:"
+4 IF ZTDAY
SET ZT1=0
FOR ZT=0:0
SET ZT1=$ORDER(^TMP($JOB,"D",2,ZT1))
SET ZT2=0
IF 'ZT1
QUIT
WRITE !,$$HTE^XLFDT(99999-ZT1)
DO OUT2
+5 QUIT
+6 ;
OUT2 ;OUT--report the data by day
+1 FOR ZT=0:0
SET ZT2=$ORDER(^TMP($JOB,"D",2,ZT1,ZT2))
SET ZT3=""
IF 'ZT2
QUIT
FOR ZT=0:0
SET ZT3=$ORDER(^TMP($JOB,"D",2,ZT1,ZT2,ZT3))
IF ZT3=""
QUIT
SET X=^(ZT3)
WRITE !,99999-ZT2,?4,ZT3,?46,$EXTRACT(X,2,$LENGTH(X)-1)
+2 QUIT
+3 ;
SEND ;REPORT--mail the report to the San Francisco ISC
+1 WRITE !,"Assembling mail report"
SET ZTLINE=1
+2 IF ZTCOUNT
SET ^TMP($JOB,"M",ZTLINE,0)="Report by raw count since install:"
SET ZTLINE=ZTLINE+1
+3 IF ZTCOUNT
SET ZT1=0
FOR ZT=0:0
SET ZT1=$ORDER(^TMP($JOB,"T",2,ZT1))
SET ZT2=""
IF 'ZT1
QUIT
FOR ZT=0:0
SET ZT2=$ORDER(^TMP($JOB,"T",2,ZT1,ZT2))
IF ZT2=""
QUIT
SET X=^(ZT2)
SET ^TMP($JOB,"M",ZTLINE,0)=$JUSTIFY(99999-ZT1,5)_$JUSTIFY(ZT2,45)_" "_$EXTRACT(X,2,$LENGTH(X)-1)
SET ZTLINE=ZTLINE+1
WRITE "."
+4 IF ZTCOUNT
IF ZTDAY
SET ^TMP($JOB,"M",ZTLINE,0)=" "
SET ZTLINE=ZTLINE+1
+5 IF ZTDAY
SET ^TMP($JOB,"M",ZTLINE,0)="Report by day:"
SET ZTLINE=ZTLINE+1
+6 IF ZTDAY
SET ZT1=0
FOR ZT=0:0
SET ZT1=$ORDER(^TMP($JOB,"D",2,ZT1))
SET ZT2=0
IF 'ZT1
QUIT
SET ^TMP($JOB,"M",ZTLINE,0)=$$HTE^XLFDT(99999-ZT1)_":"
SET ZTLINE=ZTLINE+1
DO SEND2
+7 SET ZTN=""
IF $DATA(^XMB(1,1,0))#2
SET ZTN=$PIECE(^(0),"^")
+8 IF ZTN]""
IF $DATA(^DIC(4.2,ZTN,0))#2
SET ZTN=$PIECE(^(0),"^")
+9 DO EN^XM
SET XMSUB="Error report from "_ZTN_" on "_$$HTE^XLFDT($HOROLOG)
+10 SET XMTEXT="^TMP($J,""M"","
+11 WRITE !,"Sending the report..."
DO ^XMD
DO KILL^XM
WRITE !!,"Report sent."
+12 QUIT
+13 ;
SEND2 ;MAIL--prepare to mail report by day
+1 FOR ZT=0:0
SET ZT2=$ORDER(^TMP($JOB,"D",2,ZT1,ZT2))
SET ZT3=""
IF 'ZT2
QUIT
FOR ZT=0:0
SET ZT3=$ORDER(^TMP($JOB,"D",2,ZT1,ZT2,ZT3))
IF ZT3=""
QUIT
SET X=^(ZT3)
SET ^TMP($JOB,"M",ZTLINE,0)=$JUSTIFY(99999-ZT2,5)_$JUSTIFY(ZT3,45)_" "_$EXTRACT(X,2,$LENGTH(X)-1)
SET ZTLINE=ZTLINE+1
WRITE "."
+2 QUIT
+3 ;