278 lines
7.6 KiB
Plaintext
Executable File
278 lines
7.6 KiB
Plaintext
Executable File
$INCLUDE UNIVERSE.INCLUDE MTF.INCL.H
|
|
$INCLUDE UNIVERSE.INCLUDE FILENAMES.H
|
|
$INCLUDE UNIVERSE.INCLUDE MACHINE.NAME
|
|
******************************************************************************
|
|
*
|
|
* System Admin Transaction Logging - List Logging State Information
|
|
*
|
|
* Module %M% Version %I% Date %H%
|
|
*
|
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
|
* The copyright notice above does not evidence any actual or intended
|
|
* publication of such source code.
|
|
*
|
|
*******************************************************************************
|
|
*
|
|
* Maintenence log - insert most recent change descriptions at top
|
|
*
|
|
* Date.... GTAR# WHO Description........................................
|
|
* 10/14/98 23801 SAP Change copyrights.
|
|
* 11/10/95 17630 CSM don't include needssync log files in available space
|
|
* 04/26/95 16198 GMH Add archive tape support
|
|
* 10/21/94 15120 DTM Added two new states
|
|
* 10/19/94 15159 DTM Added Checkpoint/Archive status to menu
|
|
* 05/15/94 13286 DTM Initial programming
|
|
*
|
|
*******************************************************************************
|
|
id = "%W%"
|
|
*******************************************************************************
|
|
$INCLUDE UNIVERSE.INCLUDE TLOG.H
|
|
|
|
*******************************************************************************
|
|
* Call initialization routines
|
|
*******************************************************************************
|
|
TPRINT @(-1)
|
|
GOSUB init.form
|
|
|
|
*******************************************************************************
|
|
* Begin processing
|
|
*******************************************************************************
|
|
CALL *DRAW.SCRN.B("Display Logging State", 1)
|
|
GOSUB init.menu
|
|
CALL *MNU.BAR.PR.B(Menu.Bar,1)
|
|
|
|
CALL *PUT.FORM.B(form.size,form,temp.form,PRMPT,1)
|
|
|
|
msg1 = "Select Ok to return to main menus"
|
|
retry = 1
|
|
B.array=""
|
|
B.array<1>=1
|
|
B.array<2>="Ok"
|
|
CALL *CHOICE.BOX.B(17,3, 40, msg1, B.array, 1, "" )
|
|
|
|
RETURN
|
|
*************************************************************************
|
|
* Init.form
|
|
* This routine is used TO initialize the form TO be printed on the
|
|
* screen for data input. It also sets up the default answers, if
|
|
* any
|
|
*
|
|
*************************************************************************
|
|
init.form:
|
|
;* initialize the form
|
|
form=NULL
|
|
temp.form=NULL
|
|
form<1,1>=@(5,3)
|
|
form<1,2>=@(25,3)
|
|
form<1,3>="Logging State"
|
|
form<1,4>=""
|
|
form<1,5>=form<1,4>
|
|
form<1,6>=36
|
|
form<2,1>=@(5,5)
|
|
form<2,2>=@(25,5)
|
|
form<2,3>="Logging Directory"
|
|
form<2,4>=""
|
|
form<2,5>=form<1,4>
|
|
form<2,6>=36
|
|
form<3,1>=@(5,6)
|
|
form<3,2>=@(25,6)
|
|
form<3,3>="Current Log File"
|
|
form<3,4>=""
|
|
form<3,5>=form<1,4>
|
|
form<3,6>=20
|
|
form<4,1>=@(5,8)
|
|
form<4,2>=@(25,8)
|
|
form<4,3>="Total Log Space"
|
|
form<4,4>=""
|
|
form<4,5>=form<1,4>
|
|
form<4,6>=20
|
|
form<5,1>=@(5,9)
|
|
form<5,2>=@(25,9)
|
|
form<5,3>="Available Log Space"
|
|
form<5,4>=""
|
|
form<5,5>=form<1,4>
|
|
form<5,6>=20
|
|
form<6,1>=@(5,11)
|
|
form<6,2>=@(25,11)
|
|
form<6,3>="Checkpoint Mode"
|
|
form<6,4>=""
|
|
form<6,5>=form<1,4>
|
|
form<6,6>=20
|
|
form<7,1>=@(5,13)
|
|
form<7,2>=@(25,13)
|
|
form<7,3>="Archive Mode"
|
|
form<7,4>=""
|
|
form<7,5>=form<1,4>
|
|
form<7,6>=20
|
|
form<8,1>=@(5,14)
|
|
form<8,2>=@(25,14)
|
|
form<8,3>="Archive Type"
|
|
form<8,4>=""
|
|
form<8,5>=form<1,4>
|
|
form<8,6>=20
|
|
form<9,1>=@(5,15)
|
|
form<9,2>=@(25,15)
|
|
form<9,3>="Device List"
|
|
form<9,4>=""
|
|
form<9,5>=form<1,4>
|
|
form<9,6>=20
|
|
|
|
;* Ok, we have the form displayed, let's put in some information
|
|
|
|
;* First, let's get the state of the Logging Subsystem
|
|
State = ""
|
|
RECIO( State, FINFO$AI.STATE, RECIO$FINFO )
|
|
BEGIN CASE
|
|
CASE State = AI$UNINIT
|
|
temp.form<1> = "Logging Uninitialized"
|
|
CASE State = AI$INACTIVE
|
|
temp.form<1> = "Logging Inactive"
|
|
CASE State = AI$INITIAL
|
|
temp.form<1> = "Logging In Initial Startup"
|
|
CASE State = AI$WARM.START
|
|
temp.form<1> = "Logging In Warm Start mode"
|
|
CASE State = AI$LOGGING
|
|
temp.form<1> = "Logging Enabled"
|
|
CASE State = AI$SUSPENDED
|
|
temp.form<1> = "Logging Suspended - Administrator"
|
|
CASE State = AI$FULL
|
|
temp.form<1> = "Logging Suspended - Log Files Full"
|
|
CASE State = AI$ERROR
|
|
temp.form<1> = "Logging Suspended - Internal Error"
|
|
CASE State = AI$DISABLED
|
|
temp.form<1> = "Logging Disabled"
|
|
CASE State = AI$SUSP.PROG
|
|
temp.form<1> = "Logging Suspend in Progress"
|
|
CASE State = AI$SHUT.PROG
|
|
temp.form<1> = "Logging Shutdown in Progress"
|
|
CASE 1
|
|
temp.form<1> = "Unknown Logging State"
|
|
END CASE
|
|
;* Ok, now let's get the path of the logging directory
|
|
|
|
temp.form<2>=""
|
|
Path = ""
|
|
RECIO( Path, RECIO$PATH )
|
|
IF ( Path = "" ) THEN
|
|
Path = "No Logging Directory"
|
|
END
|
|
temp.form<2> = Path
|
|
|
|
;* Ok, what's the current log file
|
|
|
|
fileno = ""
|
|
RECIO ( fileno, FINFO$AI.SEQUENCE, RECIO$FINFO )
|
|
|
|
IF State = AI$LOGGING THEN
|
|
temp.form<3> = "lg":fileno
|
|
END
|
|
ELSE
|
|
temp.form<3> = "N/A"
|
|
END
|
|
|
|
;* Ok, now we need to calculate the total amounst of space
|
|
;* We do this by summing together the sizes of all existing log files
|
|
;* we also need to determine the total amount of "full" space as well
|
|
|
|
sel.stat = "SSELECT UV_LOGS WITH STATUS # Released"
|
|
EXECUTE sel.stat CAPTURING junk
|
|
lping = 1
|
|
sum = 0
|
|
full = 0
|
|
|
|
OPEN '', "UV_LOGS" TO uv.log.fp ELSE
|
|
CALL *HELP.BOX.B(16,10,50,"Can't open UV_LOGS file" )
|
|
STOP @(-1)
|
|
END
|
|
|
|
LOOP
|
|
READNEXT temp2 THEN
|
|
READ rec FROM uv.log.fp, temp2 THEN
|
|
sum += rec<AIF.SIZE>
|
|
IF rec<AIF.STATUS> = "F" OR rec<AIF.STATUS> = "N" THEN
|
|
full += rec<AIF.SIZE>
|
|
END
|
|
END
|
|
ELSE
|
|
CALL *HELP.BOX.B(16,10,50,"Can't read record from UV_LOGS")
|
|
STOP @(-1)
|
|
END
|
|
END
|
|
ELSE lping = 0
|
|
UNTIL lping = 0 REPEAT
|
|
temp.form<4>=sum:" bytes"
|
|
avail = sum -full
|
|
temp.form<5>=avail:" bytes"
|
|
tmp=0
|
|
RECIO( tmp, FINFO$AI.CHECKPOINT, RECIO$FINFO )
|
|
IF ( tmp = 0 )THEN
|
|
temp.form<6> = "OFF"
|
|
END
|
|
ELSE
|
|
temp.form<6> = "ON"
|
|
END
|
|
tmp = 0
|
|
RECIO( tmp, FINFO$AI.ARCHIVE, RECIO$FINFO )
|
|
IF ( tmp = 0 ) THEN
|
|
temp.form<7> = "OFF"
|
|
END
|
|
ELSE
|
|
temp.form<7> = "ON"
|
|
END
|
|
* Check for tape archive
|
|
RECIO( tmp, FINFO$AI.ARCHIVE.TAPE, RECIO$FINFO )
|
|
if tmp = 0 THEN
|
|
temp.form<8> = "DISK"
|
|
temp.form<9> = "N/A"
|
|
end else
|
|
temp.form<2> = "N/A"
|
|
temp.form<4> = "N/A"
|
|
temp.form<5> = "N/A"
|
|
temp.form<8> = "TAPE"
|
|
DV = ""
|
|
RECIO(DV, "", RECIO$DEVICELIST)
|
|
temp.form<9> = convert(@vm, " ",DV)
|
|
end
|
|
form.size=9
|
|
form.line=1
|
|
RETURN
|
|
|
|
***************************************************************************
|
|
* init.menu - initializes menu bar
|
|
***************************************************************************
|
|
init.menu:
|
|
scratch=UVREADMSG(073087,"")
|
|
Menu.Bar = NULL
|
|
Menu.Bar<1,1> = 3 ;* Number of Items in Menu.Bar
|
|
Menu.Bar<1,2> = 1 ;* Line # on which to print the Menu Bar
|
|
* First Item
|
|
Menu.Bar<2,1,1>=scratch<1> ;* SubMenu Title
|
|
Menu.Bar<2,1,2>=1 ;* # of items in SubMenu
|
|
* SubMenu #1
|
|
Menu.Bar<2,2,1>=scratch<6> ;* SubMenu Item
|
|
Menu.Bar<2,2,2>=1 ;* Action Code (Returned to calling process)
|
|
Menu.Bar<2,2,3>=scratch<7>
|
|
* Second Item
|
|
Menu.Bar<3,1,1>=scratch<8> ;* SubMenu Title
|
|
Menu.Bar<3,1,2>=1 ;* # of items in SubMenu
|
|
* SubMenu #1
|
|
Menu.Bar<3,2,1>=scratch<6> ;* SubMenu Item
|
|
Menu.Bar<3,2,2>=2 ;* Action Code
|
|
Menu.Bar<3,2,3>=scratch<7>
|
|
scratch=UVREADMSG(073089,"")
|
|
Menu.Bar<4,1,1>=scratch<1>
|
|
Menu.Bar<4,1,2>=3
|
|
Menu.Bar<4,2,1>=scratch<2>
|
|
Menu.Bar<4,2,2>=3
|
|
Menu.Bar<4,2,3>=scratch<3>
|
|
Menu.Bar<4,3,1>=scratch<4>
|
|
Menu.Bar<4,3,2>=4
|
|
Menu.Bar<4,3,3>=scratch<5>
|
|
Menu.Bar<4,4,1>=scratch<6>
|
|
Menu.Bar<4,4,2>=5
|
|
Menu.Bar<4,4,3>=scratch<7>
|
|
RETURN
|
|
STOP @(-1)
|
|
END
|