KMPDSSS ;OAK/RAK/JML - CP Status - SAGG ;5/1/07 15:07
;;3.0;Capacity Management Tools;**3**;Jan 22, 2009;Build 42
;
;
FORMAT(KMPDLN) ;-format text for dislay
;-----------------------------------------------------------------------------
; KMPDLN.... return number of lines - called by reference
;-----------------------------------------------------------------------------
;
Q:$G(KMPDNMSP)=""
;
N LN,X S LN=0 K TMP
;
; if no kmpsutl routine
S X="KMPSUTL" X ^%ZOSF("TEST") I '$T D Q
.S LN=LN+1
.D SET^VALM10(LN,"The SAGG Package is not installed!")
;
; status
D STATUS
;
; option data
D OPT^KMPDSSD("KMPS SAGG REPORT")
;
; bacground data
D BKGRND
;
; file data
D FILES
;
; routine version check
D ROUCHK^KMPDSSD1("S")
;
; node/cpu data
D CPU^KMPDSSD1
;
; mail group member
D MGRP^KMPDSSD1
;
; legend
D LEGEND
;
S KMPDLN=LN
;
Q
;
BKGRND ;- background
;
N CURSTAT,LOC,OPT,PLTFRM,PROD,SITENUM,STAT,TEXT,VOL,VOLDA
;
S SITENUM=$P($$SITE^VASITE(),U,3) Q:'SITENUM
S OPT="KMPS SAGG REPORT",STAT=$$TSKSTAT^KMPSUTL1(OPT),CURSTAT=$$CURSTAT^KMPDUTL1(STAT)
;
S LN=LN+1
D SET^VALM10(LN,"")
S LN=LN+1
D SET^VALM10(LN," Temporary collection global.")
S LN=LN+1
D SET^VALM10(LN," ^XTMP(""KMPS"")............... "_$S('$D(^XTMP("KMPS",SITENUM,0)):"NOT ",1:"")_"Present")
;
S PLTFRM=$$MPLTF^KMPDUTL1,PROD=$P(^%ZOSF("PROD"),",")
I PLTFRM="DSM" D
.S LOC=$G(^KMPS(8970.1,1,0))
.S TEXT=" Global Location............ "
.S TEXT=TEXT_$S($P(LOC,U,3)="":PROD,1:$P(LOC,U,3))_","_$S($P(LOC,U,2)="":"UNKNOWN",1:$P(LOC,U,2))
.S LN=LN+1
.D SET^VALM10(LN,TEXT)
;
S LN=LN+1
D SET^VALM10(LN,"")
S LN=LN+1
; SAGG now collects on all volumes. Legacy code in case needed in future
D SET^VALM10(LN," SAGG Project will collect metrics on ALL volumes")
S LN=LN+1
D SET^VALM10(LN,"")
S LN=LN+1
;D SET^VALM10(LN," SAGG Project collection routines will monitor the following:")
;S LN=LN+1
;D SET^VALM10(LN,"")
;S (TEXT,VOL)=""
;F S VOL=$O(^KMPS(8970.1,1,1,"B",VOL)) Q:VOL="" D
;.S VOLDA=$O(^KMPS(8970.1,1,1,"B",VOL,0))
;.S LOC=$P(^KMPS(8970.1,1,1,VOLDA,0),U,2)
;.S:LOC="" LOC=PROD
;.S TEXT=$J(" ",10)_VOL,LN=LN+1
;.D SET^VALM10(LN,TEXT)
;
I '+CURSTAT&$D(^XTMP("KMPS","START")) D
.S LN=LN+1 D SET^VALM10(LN,"") S LN=LN+1 D SET^VALM10(LN,"")
.S LN=LN+1
.D SET^VALM10(LN," SAGG Project collection routines are still running on:")
.S (TEXT,VOL)=""
.F S VOL=$O(^XTMP("KMPS","START",VOL)) Q:VOL="" D
..S TEXT=$J(" ",10)_VOL,LN=LN+1
..D SET^VALM10(LN,TEXT)
;
; check for any reported errors
I $D(^XTMP("KMPS","ERROR")) D
.S LN=LN+1 D SET^VALM10(LN,"") S LN=LN+1 D SET^VALM10(LN,"")
.S LN=LN+1
.D SET^VALM10(LN," SAGG Project collection routines have recorded an error on")
.S LN=LN+1
.D SET^VALM10(LN," the following Volume Set(s):")
.S LN=LN+1 D SET^VALM10(LN,"")
.S (TEXT,VOL)=""
.F S VOL=$O(^XTMP("KMPS","ERROR",VOL)) Q:VOL="" D
..S TEXT=$J(" ",10)_VOL,LN=LN+1
..D SET^VALM10(LN,TEXT) S TEXT=""
;
; check to see if SAGG was told to stop or has reported errors
I (+CURSTAT)>3 D
.I +CURSTAT=4 D
..S LN=LN+1
..D SET^VALM10(LN," SAGG has been running over a day. Use ^%S"_$S(PLTFRM="DSM":"Y",1:"S")_" and check to see if")
..S LN=LN+1
..D SET^VALM10(LN," the KMPSGE routine is still running.")
.S LN=LN+1
.D SET^VALM10(LN," NOTE: Any incomplete data that has been collected will be")
.S LN=LN+1
.D SET^VALM10(LN," deleted automatically the next time that SAGG runs.")
.I $D(^XTMP("KMPS","ERROR")) S LN=LN+1 D SET^VALM10(LN," First determine the cause of any volume set errors.")
.S LN=LN+1
.D SET^VALM10(LN," Reschedule SAGG to collect global data if necessary.")
;
Q
;
FILES ;-- file data
;
N TEXT,X
;
S LN=LN+1
D SET^VALM10(LN,"")
S LN=LN+1
D SET^VALM10(LN,$J(" ",35)_" # of") ; Oldest Recent")
S LN=LN+1
D SET^VALM10(LN," File"_$J(" ",28)_"Entries") ; Date Date")
S LN=LN+1
D SET^VALM10(LN," ------------------------- -------") ; ------- -------")
; file name
S TEXT=" 8970.1-SAGG PROJECT"
; number of entries
S TEXT=TEXT_$J(" ",35-$L(TEXT))_$J($FN($P($G(^KMPS(8970.1,0)),U,4),",",0),7)
S LN=LN+1
D SET^VALM10(LN,TEXT)
;
Q
;
LEGEND ;-- display full package name
;
S LN=LN+1 D SET^VALM10(LN,"")
S LN=LN+1 D SET^VALM10(LN,"")
S LN=LN+1
D SET^VALM10(LN," SAGG = Statistical Analysis of Global Growth")
;
Q
;
STATUS ;-- current status
;
N CURSTAT,DOW,OPT,SESSNUM,SITNUM,STAT,STRTDT
;
S SITNUM=$P($$SITE^VASITE(),U,3) Q:'SITNUM
S OPT="KMPS SAGG REPORT",STAT=$$TSKSTAT^KMPSUTL1(OPT),CURSTAT=$$CURSTAT^KMPDUTL1(STAT)
S LN=LN+1
D SET^VALM10(LN," Current Status.............. "_$P(CURSTAT,U,2))
I $D(^XTMP("KMPS",SITNUM,0)) D
.S SESSNUM=^XTMP("KMPS",SITNUM,0),STRTDT=$P(SESSNUM,U,4),SESSNUM=+SESSNUM
.S LN=LN+1
.D SET^VALM10(LN," Session Number.............. "_SESSNUM)
.S DOW=$$DOW^XLFDT(STRTDT)
.S LN=LN+1
.D SET^VALM10(LN," Start Date.................. "_$$FMTE^XLFDT(STRTDT,"P")_" ("_DOW_")")
;
S LN=LN+1
D SET^VALM10(LN,"")
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HKMPDSSS 5220 printed Dec 13, 2024@01:40:43 Page 2
KMPDSSS ;OAK/RAK/JML - CP Status - SAGG ;5/1/07 15:07
+1 ;;3.0;Capacity Management Tools;**3**;Jan 22, 2009;Build 42
+2 ;
+3 ;
FORMAT(KMPDLN) ;-format text for dislay
+1 ;-----------------------------------------------------------------------------
+2 ; KMPDLN.... return number of lines - called by reference
+3 ;-----------------------------------------------------------------------------
+4 ;
+5 if $GET(KMPDNMSP)=""
QUIT
+6 ;
+7 NEW LN,X
SET LN=0
KILL TMP
+8 ;
+9 ; if no kmpsutl routine
+10 SET X="KMPSUTL"
XECUTE ^%ZOSF("TEST")
IF '$TEST
Begin DoDot:1
+11 SET LN=LN+1
+12 DO SET^VALM10(LN,"The SAGG Package is not installed!")
End DoDot:1
QUIT
+13 ;
+14 ; status
+15 DO STATUS
+16 ;
+17 ; option data
+18 DO OPT^KMPDSSD("KMPS SAGG REPORT")
+19 ;
+20 ; bacground data
+21 DO BKGRND
+22 ;
+23 ; file data
+24 DO FILES
+25 ;
+26 ; routine version check
+27 DO ROUCHK^KMPDSSD1("S")
+28 ;
+29 ; node/cpu data
+30 DO CPU^KMPDSSD1
+31 ;
+32 ; mail group member
+33 DO MGRP^KMPDSSD1
+34 ;
+35 ; legend
+36 DO LEGEND
+37 ;
+38 SET KMPDLN=LN
+39 ;
+40 QUIT
+41 ;
BKGRND ;- background
+1 ;
+2 NEW CURSTAT,LOC,OPT,PLTFRM,PROD,SITENUM,STAT,TEXT,VOL,VOLDA
+3 ;
+4 SET SITENUM=$PIECE($$SITE^VASITE(),U,3)
if 'SITENUM
QUIT
+5 SET OPT="KMPS SAGG REPORT"
SET STAT=$$TSKSTAT^KMPSUTL1(OPT)
SET CURSTAT=$$CURSTAT^KMPDUTL1(STAT)
+6 ;
+7 SET LN=LN+1
+8 DO SET^VALM10(LN,"")
+9 SET LN=LN+1
+10 DO SET^VALM10(LN," Temporary collection global.")
+11 SET LN=LN+1
+12 DO SET^VALM10(LN," ^XTMP(""KMPS"")............... "_$SELECT('$DATA(^XTMP("KMPS",SITENUM,0)):"NOT ",1:"")_"Present")
+13 ;
+14 SET PLTFRM=$$MPLTF^KMPDUTL1
SET PROD=$PIECE(^%ZOSF("PROD"),",")
+15 IF PLTFRM="DSM"
Begin DoDot:1
+16 SET LOC=$GET(^KMPS(8970.1,1,0))
+17 SET TEXT=" Global Location............ "
+18 SET TEXT=TEXT_$SELECT($PIECE(LOC,U,3)="":PROD,1:$PIECE(LOC,U,3))_","_$SELECT($PIECE(LOC,U,2)="":"UNKNOWN",1:$PIECE(LOC,U,2))
+19 SET LN=LN+1
+20 DO SET^VALM10(LN,TEXT)
End DoDot:1
+21 ;
+22 SET LN=LN+1
+23 DO SET^VALM10(LN,"")
+24 SET LN=LN+1
+25 ; SAGG now collects on all volumes. Legacy code in case needed in future
+26 DO SET^VALM10(LN," SAGG Project will collect metrics on ALL volumes")
+27 SET LN=LN+1
+28 DO SET^VALM10(LN,"")
+29 SET LN=LN+1
+30 ;D SET^VALM10(LN," SAGG Project collection routines will monitor the following:")
+31 ;S LN=LN+1
+32 ;D SET^VALM10(LN,"")
+33 ;S (TEXT,VOL)=""
+34 ;F S VOL=$O(^KMPS(8970.1,1,1,"B",VOL)) Q:VOL="" D
+35 ;.S VOLDA=$O(^KMPS(8970.1,1,1,"B",VOL,0))
+36 ;.S LOC=$P(^KMPS(8970.1,1,1,VOLDA,0),U,2)
+37 ;.S:LOC="" LOC=PROD
+38 ;.S TEXT=$J(" ",10)_VOL,LN=LN+1
+39 ;.D SET^VALM10(LN,TEXT)
+40 ;
+41 IF '+CURSTAT&$DATA(^XTMP("KMPS","START"))
Begin DoDot:1
+42 SET LN=LN+1
DO SET^VALM10(LN,"")
SET LN=LN+1
DO SET^VALM10(LN,"")
+43 SET LN=LN+1
+44 DO SET^VALM10(LN," SAGG Project collection routines are still running on:")
+45 SET (TEXT,VOL)=""
+46 FOR
SET VOL=$ORDER(^XTMP("KMPS","START",VOL))
if VOL=""
QUIT
Begin DoDot:2
+47 SET TEXT=$JUSTIFY(" ",10)_VOL
SET LN=LN+1
+48 DO SET^VALM10(LN,TEXT)
End DoDot:2
End DoDot:1
+49 ;
+50 ; check for any reported errors
+51 IF $DATA(^XTMP("KMPS","ERROR"))
Begin DoDot:1
+52 SET LN=LN+1
DO SET^VALM10(LN,"")
SET LN=LN+1
DO SET^VALM10(LN,"")
+53 SET LN=LN+1
+54 DO SET^VALM10(LN," SAGG Project collection routines have recorded an error on")
+55 SET LN=LN+1
+56 DO SET^VALM10(LN," the following Volume Set(s):")
+57 SET LN=LN+1
DO SET^VALM10(LN,"")
+58 SET (TEXT,VOL)=""
+59 FOR
SET VOL=$ORDER(^XTMP("KMPS","ERROR",VOL))
if VOL=""
QUIT
Begin DoDot:2
+60 SET TEXT=$JUSTIFY(" ",10)_VOL
SET LN=LN+1
+61 DO SET^VALM10(LN,TEXT)
SET TEXT=""
End DoDot:2
End DoDot:1
+62 ;
+63 ; check to see if SAGG was told to stop or has reported errors
+64 IF (+CURSTAT)>3
Begin DoDot:1
+65 IF +CURSTAT=4
Begin DoDot:2
+66 SET LN=LN+1
+67 DO SET^VALM10(LN," SAGG has been running over a day. Use ^%S"_$SELECT(PLTFRM="DSM":"Y",1:"S")_" and check to see if")
+68 SET LN=LN+1
+69 DO SET^VALM10(LN," the KMPSGE routine is still running.")
End DoDot:2
+70 SET LN=LN+1
+71 DO SET^VALM10(LN," NOTE: Any incomplete data that has been collected will be")
+72 SET LN=LN+1
+73 DO SET^VALM10(LN," deleted automatically the next time that SAGG runs.")
+74 IF $DATA(^XTMP("KMPS","ERROR"))
SET LN=LN+1
DO SET^VALM10(LN," First determine the cause of any volume set errors.")
+75 SET LN=LN+1
+76 DO SET^VALM10(LN," Reschedule SAGG to collect global data if necessary.")
End DoDot:1
+77 ;
+78 QUIT
+79 ;
FILES ;-- file data
+1 ;
+2 NEW TEXT,X
+3 ;
+4 SET LN=LN+1
+5 DO SET^VALM10(LN,"")
+6 SET LN=LN+1
+7 ; Oldest Recent")
DO SET^VALM10(LN,$JUSTIFY(" ",35)_" # of")
+8 SET LN=LN+1
+9 ; Date Date")
DO SET^VALM10(LN," File"_$JUSTIFY(" ",28)_"Entries")
+10 SET LN=LN+1
+11 ; ------- -------")
DO SET^VALM10(LN," ------------------------- -------")
+12 ; file name
+13 SET TEXT=" 8970.1-SAGG PROJECT"
+14 ; number of entries
+15 SET TEXT=TEXT_$JUSTIFY(" ",35-$LENGTH(TEXT))_$JUSTIFY($FNUMBER($PIECE($GET(^KMPS(8970.1,0)),U,4),",",0),7)
+16 SET LN=LN+1
+17 DO SET^VALM10(LN,TEXT)
+18 ;
+19 QUIT
+20 ;
LEGEND ;-- display full package name
+1 ;
+2 SET LN=LN+1
DO SET^VALM10(LN,"")
+3 SET LN=LN+1
DO SET^VALM10(LN,"")
+4 SET LN=LN+1
+5 DO SET^VALM10(LN," SAGG = Statistical Analysis of Global Growth")
+6 ;
+7 QUIT
+8 ;
STATUS ;-- current status
+1 ;
+2 NEW CURSTAT,DOW,OPT,SESSNUM,SITNUM,STAT,STRTDT
+3 ;
+4 SET SITNUM=$PIECE($$SITE^VASITE(),U,3)
if 'SITNUM
QUIT
+5 SET OPT="KMPS SAGG REPORT"
SET STAT=$$TSKSTAT^KMPSUTL1(OPT)
SET CURSTAT=$$CURSTAT^KMPDUTL1(STAT)
+6 SET LN=LN+1
+7 DO SET^VALM10(LN," Current Status.............. "_$PIECE(CURSTAT,U,2))
+8 IF $DATA(^XTMP("KMPS",SITNUM,0))
Begin DoDot:1
+9 SET SESSNUM=^XTMP("KMPS",SITNUM,0)
SET STRTDT=$PIECE(SESSNUM,U,4)
SET SESSNUM=+SESSNUM
+10 SET LN=LN+1
+11 DO SET^VALM10(LN," Session Number.............. "_SESSNUM)
+12 SET DOW=$$DOW^XLFDT(STRTDT)
+13 SET LN=LN+1
+14 DO SET^VALM10(LN," Start Date.................. "_$$FMTE^XLFDT(STRTDT,"P")_" ("_DOW_")")
End DoDot:1
+15 ;
+16 SET LN=LN+1
+17 DO SET^VALM10(LN,"")
+18 ;
+19 QUIT