- %ZOSVKSD ;OAK/KAK - Calculate Disk Capacity ;5/9/07 10:36
- ;;8.0;KERNEL;**121,197,268,456**;Jul 26, 2004
- ;
- ; This routine will help to calculate disk capacity for
- ; either DSM or Cache system platforms by looking up
- ; volume set table information
- ;
- EN(SITENUM,SESSNUM,VOLS,OS) ;-- called by routine SYS+2^KMPSLK
- ;--------------------------------------------------------------------
- ; SITENUM = Station number of site
- ; SESSNUM = SAGG session number
- ; VOLS = Array containing names of monitored volumes
- ; OS = Type of M platform (CVMS, CWINNT)
- ;
- ; Returns ^XTMP("KMPS",SITENUM,SESSNUM,"@VOL",vol_name) = vol_size
- ;--------------------------------------------------------------------
- ;
- Q:'$G(SITENUM)
- Q:$G(SESSNUM)=""
- Q:$G(OS)=""
- ;
- D @OS
- ;
- Q
- ;
- CVMS ;--------------------------------------------------------------------
- ; Version for Cache for OpenVMS platform
- ;--------------------------------------------------------------------
- ;
- ;-- code from routine %FREECNT
- ;
- N DIR
- ;
- S DIR=""
- F S DIR=$O(^|"%SYS"|SYS("UCI",DIR)) Q:DIR="" D
- .;
- .N BLKSIZ,DIRUP,ISBIGDB,MAX,SIZE,VOLTOT,X,Y,ZU
- .;
- .Q:$G(^|"%SYS"|SYS("UCI",DIR))]""
- .S X=DIR
- .X ^%ZOSF("UPPERCASE")
- .;
- .; strip off trailing '\' if needed
- .I $E(Y,$L(Y))="\" S Y=$E(Y,1,$L(Y)-1)
- .S DIRUP=Y
- .;
- .; use $ZU(49) to see if directory is mounted
- .S ZU=$ZU(49,DIR)
- .;
- .; quit if directory does not exist or is dismounted
- .Q:ZU<0
- .;
- .; quit is directory is not mounted
- .Q:+ZU=256
- .;
- .S ISBIGDB=0
- .S BLKSIZ=$P(ZU,",",2)
- .;
- .I BLKSIZ>2048 D
- ..S ISBIGDB=1
- ..S VOLTOT=$P(ZU,",",22)
- .;
- .E D
- ..I $ZBITGET($ZVERSION(0),21) S SIZE=+$P(ZU,",",23),MAX=$P(ZU,",",24)
- ..E S SIZE=+$P(ZU,",",2),MAX=$P(ZU,",",4)
- ..I 'SIZE Q
- ..S VOLTOT=MAX*SIZE
- .;
- .;-- end of code from routine %FREECNT
- .;
- .D SETNODE(SITENUM,SESSNUM,DIRUP,VOLTOT)
- ;
- Q
- ;
- CWINNT ;--------------------------------------------------------------------
- ; Version for Cache for Windows NT platform
- ;--------------------------------------------------------------------
- ;
- ;-- code from routine %FREECNT
- ;
- N DIR,DIRUP,VOLTOT
- N X,Y,ZU
- ;
- S DIR=""
- F S DIR=$O(^|"%SYS"|SYS("UCI",DIR)) Q:DIR="" D
- .Q:$G(^|"%SYS"|SYS("UCI",DIR))]""
- .S X=DIR
- .X ^%ZOSF("UPPERCASE")
- .;
- .; strip off trailing '\' if needed
- .I $E(Y,$L(Y))="\" S Y=$E(Y,1,$L(Y)-1)
- .S DIRUP=Y
- .;
- .; use $ZU(49) to see if directory is mounted
- .S ZU=$ZU(49,DIR)
- .;
- .; quit if directory does not exist or is dismounted
- .Q:ZU<0
- .;
- .; quit is directory is not mounted
- .Q:+ZU=256
- .;
- .; volume size = blocks per map * number of maps
- .S VOLTOT=+$P(ZU,",",2)*$P(ZU,",",4)
- .;
- .;-- end of code from routine %FREECNT
- .;
- .D SETNODE(SITENUM,SESSNUM,DIRUP,VOLTOT)
- ;
- Q
- ;
- SETNODE(SITENUM,SESSNUM,VOLNAM,VOLTOT) ;
- ; Set the @VOL node in the ^XTMP("KMPS" global array
- ;
- ; quit if SAGG is not monitoring this volume set (directory)
- Q:'$D(VOLS(VOLNAM))
- ;
- S ^XTMP("KMPS",SITENUM,SESSNUM,"@VOL",VOLNAM)=VOLTOT
- Q
- ;
- ;
- DCMPST(VERSION) ;-
- ;---------------------------------------------------------------------------
- ;---------------------------------------------------------------------------
- Q:$G(VERSION)="" ""
- I VERSION<5.1 D DecomposeStatus^%DM(RC,.MSGLIST,0,"") Q
- E D DecomposeStatus^%SYS.DATABASE(RC,.MSGLIST,0,"")
- Q
- ;
- GETDIRGL(VERSION) ;-extrinsic function
- ;----------------------------------------------------------------------------
- ; ; set up GLOARRAY array indexed by global name
- ;----------------------------------------------------------------------------
- Q:$G(VERSION)="" ""
- I VERSION<5.1 Q $$GetDirGlobals^%DM(DIRNAM,.GLOARRAY)
- E Q $$GetDirGlobals^%SYS.DATABASE(DIRNAM,.GLOARRAY)
- ;
- GLOINTEG(VERSION) ;- extrinsic function
- ;----------------------------------------------------------------------------
- ; check integrity of a single global
- ; will stop if there are more than 999 errors with this global
- ;----------------------------------------------------------------------------
- Q:$G(VERSION)="" ""
- I VERSION<5.1 Q $$CheckGlobalIntegrity^%DM(DIRNAM,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)
- E Q $$CheckGlobalIntegrity^%SYS.DATABASE(DIRNAM,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)
- %ZOSVKSD ;OAK/KAK - Calculate Disk Capacity ;5/9/07 10:36
- +1 ;;8.0;KERNEL;**121,197,268,456**;Jul 26, 2004
- +2 ;
- +3 ; This routine will help to calculate disk capacity for
- +4 ; either DSM or Cache system platforms by looking up
- +5 ; volume set table information
- +6 ;
- EN(SITENUM,SESSNUM,VOLS,OS) ;-- called by routine SYS+2^KMPSLK
- +1 ;--------------------------------------------------------------------
- +2 ; SITENUM = Station number of site
- +3 ; SESSNUM = SAGG session number
- +4 ; VOLS = Array containing names of monitored volumes
- +5 ; OS = Type of M platform (CVMS, CWINNT)
- +6 ;
- +7 ; Returns ^XTMP("KMPS",SITENUM,SESSNUM,"@VOL",vol_name) = vol_size
- +8 ;--------------------------------------------------------------------
- +9 ;
- +10 IF '$GET(SITENUM)
- QUIT
- +11 IF $GET(SESSNUM)=""
- QUIT
- +12 IF $GET(OS)=""
- QUIT
- +13 ;
- +14 DO @OS
- +15 ;
- +16 QUIT
- +17 ;
- CVMS ;--------------------------------------------------------------------
- +1 ; Version for Cache for OpenVMS platform
- +2 ;--------------------------------------------------------------------
- +3 ;
- +4 ;-- code from routine %FREECNT
- +5 ;
- +6 NEW DIR
- +7 ;
- +8 SET DIR=""
- +9 FOR
- SET DIR=$ORDER(^|"%SYS"|SYS("UCI",DIR))
- IF DIR=""
- QUIT
- Begin DoDot:1
- +10 ;
- +11 NEW BLKSIZ,DIRUP,ISBIGDB,MAX,SIZE,VOLTOT,X,Y,ZU
- +12 ;
- +13 IF $GET(^|"%SYS"|SYS("UCI",DIR))]""
- QUIT
- +14 SET X=DIR
- +15 XECUTE ^%ZOSF("UPPERCASE")
- +16 ;
- +17 ; strip off trailing '\' if needed
- +18 IF $EXTRACT(Y,$LENGTH(Y))="\"
- SET Y=$EXTRACT(Y,1,$LENGTH(Y)-1)
- +19 SET DIRUP=Y
- +20 ;
- +21 ; use $ZU(49) to see if directory is mounted
- +22 SET ZU=$ZU(49,DIR)
- +23 ;
- +24 ; quit if directory does not exist or is dismounted
- +25 IF ZU<0
- QUIT
- +26 ;
- +27 ; quit is directory is not mounted
- +28 IF +ZU=256
- QUIT
- +29 ;
- +30 SET ISBIGDB=0
- +31 SET BLKSIZ=$PIECE(ZU,",",2)
- +32 ;
- +33 IF BLKSIZ>2048
- Begin DoDot:2
- +34 SET ISBIGDB=1
- +35 SET VOLTOT=$PIECE(ZU,",",22)
- End DoDot:2
- +36 ;
- +37 IF '$TEST
- Begin DoDot:2
- +38 IF $ZBITGET($ZVERSION(0),21)
- SET SIZE=+$PIECE(ZU,",",23)
- SET MAX=$PIECE(ZU,",",24)
- +39 IF '$TEST
- SET SIZE=+$PIECE(ZU,",",2)
- SET MAX=$PIECE(ZU,",",4)
- +40 IF 'SIZE
- QUIT
- +41 SET VOLTOT=MAX*SIZE
- End DoDot:2
- +42 ;
- +43 ;-- end of code from routine %FREECNT
- +44 ;
- +45 DO SETNODE(SITENUM,SESSNUM,DIRUP,VOLTOT)
- End DoDot:1
- +46 ;
- +47 QUIT
- +48 ;
- CWINNT ;--------------------------------------------------------------------
- +1 ; Version for Cache for Windows NT platform
- +2 ;--------------------------------------------------------------------
- +3 ;
- +4 ;-- code from routine %FREECNT
- +5 ;
- +6 NEW DIR,DIRUP,VOLTOT
- +7 NEW X,Y,ZU
- +8 ;
- +9 SET DIR=""
- +10 FOR
- SET DIR=$ORDER(^|"%SYS"|SYS("UCI",DIR))
- IF DIR=""
- QUIT
- Begin DoDot:1
- +11 IF $GET(^|"%SYS"|SYS("UCI",DIR))]""
- QUIT
- +12 SET X=DIR
- +13 XECUTE ^%ZOSF("UPPERCASE")
- +14 ;
- +15 ; strip off trailing '\' if needed
- +16 IF $EXTRACT(Y,$LENGTH(Y))="\"
- SET Y=$EXTRACT(Y,1,$LENGTH(Y)-1)
- +17 SET DIRUP=Y
- +18 ;
- +19 ; use $ZU(49) to see if directory is mounted
- +20 SET ZU=$ZU(49,DIR)
- +21 ;
- +22 ; quit if directory does not exist or is dismounted
- +23 IF ZU<0
- QUIT
- +24 ;
- +25 ; quit is directory is not mounted
- +26 IF +ZU=256
- QUIT
- +27 ;
- +28 ; volume size = blocks per map * number of maps
- +29 SET VOLTOT=+$PIECE(ZU,",",2)*$PIECE(ZU,",",4)
- +30 ;
- +31 ;-- end of code from routine %FREECNT
- +32 ;
- +33 DO SETNODE(SITENUM,SESSNUM,DIRUP,VOLTOT)
- End DoDot:1
- +34 ;
- +35 QUIT
- +36 ;
- SETNODE(SITENUM,SESSNUM,VOLNAM,VOLTOT) ;
- +1 ; Set the @VOL node in the ^XTMP("KMPS" global array
- +2 ;
- +3 ; quit if SAGG is not monitoring this volume set (directory)
- +4 IF '$DATA(VOLS(VOLNAM))
- QUIT
- +5 ;
- +6 SET ^XTMP("KMPS",SITENUM,SESSNUM,"@VOL",VOLNAM)=VOLTOT
- +7 QUIT
- +8 ;
- +9 ;
- DCMPST(VERSION) ;-
- +1 ;---------------------------------------------------------------------------
- +2 ;---------------------------------------------------------------------------
- +3 IF $GET(VERSION)=""
- QUIT ""
- +4 IF VERSION<5.1
- DO DecomposeStatus^%DM(RC,.MSGLIST,0,"")
- QUIT
- +5 IF '$TEST
- DO DecomposeStatus^%SYS.DATABASE(RC,.MSGLIST,0,"")
- +6 QUIT
- +7 ;
- GETDIRGL(VERSION) ;-extrinsic function
- +1 ;----------------------------------------------------------------------------
- +2 ; ; set up GLOARRAY array indexed by global name
- +3 ;----------------------------------------------------------------------------
- +4 IF $GET(VERSION)=""
- QUIT ""
- +5 IF VERSION<5.1
- QUIT $$GetDirGlobals^%DM(DIRNAM,.GLOARRAY)
- +6 IF '$TEST
- QUIT $$GetDirGlobals^%SYS.DATABASE(DIRNAM,.GLOARRAY)
- +7 ;
- GLOINTEG(VERSION) ;- extrinsic function
- +1 ;----------------------------------------------------------------------------
- +2 ; check integrity of a single global
- +3 ; will stop if there are more than 999 errors with this global
- +4 ;----------------------------------------------------------------------------
- +5 IF $GET(VERSION)=""
- QUIT ""
- +6 IF VERSION<5.1
- QUIT $$CheckGlobalIntegrity^%DM(DIRNAM,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)
- +7 IF '$TEST
- QUIT $$CheckGlobalIntegrity^%SYS.DATABASE(DIRNAM,GLO,999,.GLOTOTBLKS,.GLOPNTBLKS,.GLOTOTBYTES,.GLOPNTBYTES,.GLOBIGBLKS,.GLOBIGBYTES,.GLOBIGSTRINGS,.DATASIZE)