$! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-011 26-Jun-1992 $! On 3-AUG-1992 10:52:55.64 By user GOATHUNTER (@WKUVX1.BITNET) $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. DAEMONS.VAX;1 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$trnlnm("SHARE_LOG") then $ w = "!" $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ x = P1 - f$parse(P1,,,"version") $ y = f$search(x) $ if y .eqs. "" then $ goto file_absent $ x = f$integer(f$parse(P1,,,"version")-";") $ y = f$integer(f$parse(y,,,"version")-";") $ if x .gt. y then $ goto file_absent $ if f$mode() .eqs. "INTERACTIVE" then $ goto file_interactive $ if x .eq. y then e "-W-EXISTS, File ''P1' exists. Skipped." $ if x .ne. y then e "-W-NEWERVERSION, of File ''P1' exists. Skipped." $file_delete: $ delete 'f'* $ exit $file_interactive: $ if x .eq. y then e "-W-EXISTS, File ''P1' exists." $ if x .ne. y then e "-W-NEWERVERSION, of File ''P1' exists." $ read/error=file_delete/end=file_delete- /prompt="Create new version [y/n]: " - sys$command x $ if .not. x then $ e "-W-SKIPPED, File ''P1' skipped." $ if .not. x then $ goto file_delete $ P1 = P1 - f$parse(P1,,,"version") $file_absent: $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:= CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b)); LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1); IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE; MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1; ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")= 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF"; POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r); ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1; COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE, "output_file"));ENDPROCEDURE;Unpacker;QUIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create 'f' X$!************************************************************************** V**** X$! X$!`09 TITLE: ATR_DAEMON.COM X$! X$!`09 WRITTEN BY: Michael M. Frazier X$! X$!`09 PURPOSE: This command file will run as a Detatched Process X$!`09`09 and wake up periodically to check the ACMS Audit X$!`09`09 Trail (ACMSATR). A mail message will be mailed X$!`09`09 to ATR_DAEMON_DISTRIB if errors are found. X$! X$!************************************************************************** V**** X$! X$! X$ INITIALIZE: X$`09 set on X$! X$`09 on error then goto fatal_error X$`09 node_name = f$getsyi("nodename") X$`09 set proc/name="''f$trnlnm("ATR_DAEMON_PROCNAM")'" X$! X$`09 on error then gosub catch_error X$`09 old_priv = f$setprv("SYSPRV") X$`09 if .not. f$privilege("SYSPRV") then goto no_privs X$`09 sleep_time = f$trnlnm("ATR_DAEMON_SLEEP") X$! X$`09 lf`5B0,8`5D = 10 X$`09 cr`5B0,8`5D = 13 X$! X$ START: X$`09 set noon X$`09 delete/nolog/noconf 'f$trnlnm("ATR_DAEMON_INPUT")';* X$`09 set on X$`09 on error then gosub catch_error X$`09 mcr acmsatr list/since="-''sleep_time'"/out=atr_daemon_input !- X$!`09`09 acms$audit_log X$`09 if f$search("atr_daemon_input",1) .eqs. "" then goto sleep X$! X$`09 if f$search("ATR_DAEMON_OUTPUT",1) .nes. "" then - X`09 delete/nolog/noconf 'f$trnlnm("ATR_DAEMON_OUTPUT")';* X$`09 define tpu$work sys$sysdisk !Work disk with lots of freespace X$`09 edit/tpu/nosect/nodispl/command=atr_daemon:find_atr_error - X`09 atr_daemon_input X$`09 if f$search("atr_daemon_output",1) .eqs. "" then goto sleep X$! X$`09 mail/noself/subj="ACMSATR Errors found on ''node_name'..." - X`09 atr_daemon_output atr_daemon_distrib X$! X$ SLEEP: X$`09 sleep_time = f$trnlnm("ATR_DAEMON_SLEEP") X$`09 wait 'sleep_time' X$`09 goto start X$! X$! X$!************************************************************************** V**** X$! X$!`09 Subroutines X$! X$!************************************************************************** V**** X$! X$ NO_PRIVS: X$`09 username = f$getjpi("","USERNAME") X$`09 err_msg = "''username' does not have SYSPRV. Daemon aborting." X$`09 log_msg = f$fao( - X`09`09"!%T !ASATR_Daemon recieved the following error:!AS!AS", - X`09`09 warn, node_name, err_msg) X$`09 gosub open_log X$`09 goto fatal_error X$! X$ CATCH_ERROR: X$`09 err_stat = $status X$`09 on error then goto fatal_error X$`09 err_msg = f$message(err_stat) X$`09 log_msg = f$fao( - X`09`09"!%T !AS::ATR_Daemon recieved the following error:!AS", - X`09`09 0, node_name, cr + lf + err_msg) X$ OPEN_LOG: X$`09 open/append/error=new_log error_log atr_daemon_errors X$`09 goto write_log X$! X$ NEW_LOG: X$`09 open/write error_log atr_daemon_errors X$! X$ WRITE_LOG: X$`09 write error_log log_msg X$`09 close error_log X$! X$`09 return X$! X$ FATAL_ERROR: X$`09 mail/noself/subj="A Fatal Error occured in ATR Daemon on ''node_name'"- X`09 nl: atr_daemon_errdis X$`09 exit X X`0C X X!*************************************************************************** V*** X! X!`09 TITLE: FIND_ATR_ERROR.TPU X! X!`09 WRITTEN BY: Michael M. Frazier X! X!`09 PURPOSE: This TPU batch file will search for ATR Errors in X!`09`09 the 'Text' line of the ATR report, and write the X!`09`09 errors to the ATR_DAEMON_OUTPUT file. X! X!*************************************************************************** V*** X! Xset (message_flags,0); Xinput_file`09 := get_info (command_line, "file_name"); Xmain_buffer`09 := create_buffer ("MAIN", input_file); Xstaging_buffer`09 := create_buffer ("Staging Buffer"); Xerror_buffer`09 := create_buffer ("Error Buffer"); Xerror_pattern`09 := LINE_BEGIN & "Text : " & ("Task canceled" `7C X`09`09`09`09`09`09"Signal by" `09 `7C X`09`09`09`09`09`09"Error" `09 `7C X`09`09`09`09`09`09MATCH ("failed") `7C X`09`09`09`09`09`09"Unsuccessful Appl"); Xasterisk_pattern := LINE_BEGIN & "******"; Xjbc_pattern`09 := LINE_BEGIN & "-JBC-S-NORMAL"; Xerrors_found`09 := 0; Xposition (beginning_of (main_buffer)); Xloop X found_range := search_quietly (error_pattern, forward); X exitif found_range = 0; X position (found_range); X start_range := search_quietly (asterisk_pattern, reverse); X position (start_range); X start_pos := select (none); X position (found_range); X end_range := search_quietly (asterisk_pattern, forward); X position (end_range); X error_stuff := select_range; X position (beginning_of (staging_buffer)); X copy_text (error_stuff); X jbc_position := search_quietly (jbc_pattern, reverse); X if jbc_position = 0 then X`09position (error_buffer); X`09copy_text (error_stuff); X`09errors_found := errors_found + 1; X endif; X erase(staging_buffer); X start_pos := 0; X position (main_buffer); Xendloop; Xif errors_found > 0 X then write_file (error_buffer,"ATR_DAEMON_OUTPUT"); Xendif; Xdelete (staging_buffer); Xquit; X X`0C X X$!************************************************************************** V**** X$! X$!`09 TITLE: START_ATR_DAEMON.COM X$! X$!`09 WRITTEN BY: Michael M. Frazier X$! X$!`09 PURPOSE: This command procedure will define the ATR_DAEMON X$!`09`09 system logicals, and then create the ATR_DAEMON X$!`09`09 detached process. X$! X$!`09`09 This procedure should be placed in the SYS$STARTUP X$!`09`09 directory, and executed at System Startup. X$! X$!`09 FORMAT: $ @SYS$STARTUP:START_ATR_DAEMON X$! X$!************************************************************************** V**** X$! X$`09@SYS$STARTUP:ATR_DAEMON_LOGICALS X$`09username = f$trnlnm("ATR_DAEMON_USERNAME") X$`09if username .eqs. "" then username = "SYSTEM" X$`09RUN/DETACHED`09SYS$SYSTEM:LOGINOUT /UIC='username' - X`09`09`09/INPUT=ATR_DAEMON:ATR_DAEMON.COM - X`09`09`09/OUTPUT=NL: - X`09`09`09/PRIORI=4 X$`09EXIT X X`0C X X$!************************************************************************** V**** X$! X$!`09 TITLE: ATR_DAEMON_LOGICALS.COM X$! X$!`09 WRITTEN BY: Michael M. Frazier X$! X$!`09 PURPOSE: This procedure defines the logicals used by the X$!`09`09 ATR_DAEMON and ATR_ERROR command files. X$! X$!************************************************************************** V**** X$! Definitions of Logicals X$! X$! ATR_DAEMON`09 - The directory the Daemon lives in X$! ATR_DAEMON_SCRATCH - Work area for Daemon temporary files X$! ATR_DAEMON_ERRORS - Filename where Daemon errors are to be logged X$! ATR_DAEMON_INPUT - Temporary File created with ATR LIST/OUT= X$! ATR_DAEMON_OUTPUT - File that contains only the ATR Errors X$! ATR_DAEMON_PROCNAM - The process name for the ATR_DAEMON X$! ATR_DAEMON_DISTRIB - Distribution List or Username(s) of who gets mailed X$!`09`09`09 the ATR_DAEMON_OUTPUT file X$! ATR_DAEMON_ERRDIS - Distribution List or Username(s) of who gets mailed X$!`09`09`09 notification of Daemon's death by a Fatal error X$! ATR_DAEMON_SLEEP - How long the Daemon sleeps between runs X$! ATR_DAEMON_USERNAME - Username that the Daemon will run under X$!************************************************************************** V**** X$! X$ define/system/nolog atr_daemon`09 DISK:`5BATR`5D X$ define/system/nolog atr_daemon_scratch DISK:`5BATR.SCRATCH`5D X$ define/system/nolog atr_daemon_errors atr_daemon_scratch:atr_daemon_erro Vr.log X$ define/system/nolog atr_daemon_input`09 atr_daemon_scratch:atr.log X$ define/system/nolog atr_daemon_output atr_daemon_scratch:atr_errors.txt X$ define/system/nolog atr_daemon_procnam "ATR Daemon" X$ define/system/nolog atr_daemon_distrib "@your_distrubution_list" X$ define/system/nolog atr_daemon_errdis "@error_distrubution_list" X$ define/system/nolog atr_daemon_sleep`09 "00:30:00" X$ define/system/nolog atr_daemon_username "SYSTEM" X X`0C X X$!************************************************************************** V**** X$! X$!`09 TITLE: ATR_ERROR.COM X$! X$!`09 WRITTEN BY: Michael M. Frazier X$! X$!`09 PURPOSE: This command file will list the Errors found in X$!`09`09 the ACMSATR. By Default this will show all errors X$!`09`09 for today since midnight. X$! X$!`09 FORMAT: $ @ATR_ERROR `5Bacmsatr_switches`5D X$! X$!`09 NOTE: Do NOT use the /OUT switch as a parameter X$! X$!************************************************************************** V**** X$! X$! X$ verify_sw = f$verify(0) X$ INITIALIZE: X$`09 edit = "$ edit" X$`09 say := write sys$output X$`09 p1 = "/since=today " + p1 X$`09 set on X$`09 on error then gosub catch_error X$`09 old_priv = f$setprv("SYSPRV") X$`09 if .not. f$privilege("SYSPRV") then goto no_privs X$`09 in_file = f$trnlnm("ATR_DAEMON_INPUT") X$`09 out_file = f$trnlnm("ATR_DAEMON_OUTPUT") X$! X$ START: X$`09 set noon X$`09 if f$search(in_file) .nes. "" then - X`09 delete/nolog/noconf 'in_file';* X$`09 if f$search(out_file) .nes. "" then - X`09 delete/nolog/noconf 'out_file';* X$`09 set on X$`09 say "" X$`09 say "Now getting Audit Trail (''p1')..." X$`09 mcr acmsatr list/out='in_file' 'p1' X$`09 if f$search(in_file,1) .eqs. "" then goto finish X$! X$`09 say "Editing Audit Trail..." X$`09 say "" X$`09 edit := edit X$`09 edit/tpu/nosect/nodispl/command=atr_daemon:find_atr_error - X`09`09`09`09`09`09`09 atr_daemon_input X$`09 if f$search(out_file,1) .eqs. "" then goto no_errors X$! X$`09 type/page 'out_file' X$`09 goto finish X$! X$ NO_ERRORS: X$`09 say "" X$`09 say "No errors were found." X$`09 say "" X$`09 goto finish X$! X$ NO_PRIVS: X$`09 say "" X$`09 say "User must have SYSPRV to see ACMS$AUDIT_LOG" X$`09 say "" X$`09 goto finish X$! X$ FINISH: X$`09 old_priv = f$setprv(old_priv) X$`09 verify_sw = f$verify(verify_sw) X$`09 exit 1 X$! X$ CATCH_ERROR: X$`09 err_stat = $status X$`09 verify_sw = f$verify(verify_sw) X$`09 exit 'err_stat' $ CALL UNPACK DAEMONS.VAX;1 124596795 $ v=f$verify(v) $ EXIT