[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference share::zap

Title:Zap Technical Conference
Notice:ZAP Version 5.3 is available. See note 1.1
Moderator:ZAPDEV::MACONI
Created:Mon Feb 24 1986
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:170
Total number of notes:492

42.0. "Phase 0: Zap V4.0" by NRADM5::MACONI (The Doctor) Wed Nov 18 1987 09:13

    Phase 0 of ZAP Version 4.0 is now beginning.  If you have any
    suggestions for this new version, please reply to this message.
    
    Here are some of the proposed changes in ZAP:
    
    	1.  VAXstation support:
    
    		Support of "groups" of users by uic and terminal
    		name/type with a specified action when ALL are idle.
    		Warning messages appearing in windows instead of
    		users windows.
    
    	2.  User specifiable actions:
    
    		In addition to currently being able to stop processes,
    		the ability to disconnect terminals (when supported),
    		or lock VAXstations.  Also, the ability to specify
    		command procedures to be executed for certain images.
    
    	3.  DCL command interface:
    
    		Allow ZAP to be started and stopped via DCL commands.
    		Specify log file names, and open new logs.
    
    	4.  Shared data areas:
    
    		Ability to change ZAP rules "on the fly" via a new
    		ZAP rules editor.  The ability to view the ZAP process
    		database.
    
    	5.  New selection criterea:
    
    		Start and stop times (each day) for specified rules
    		to be in effect.  Selection of processes by process
    		names.
    
    ?	6.  Keyboard monitor:
    
    		Ability to monitor keyboard input and disconnect or
    		lock (VAXstations) the process if no input is detected
    		during idle time limit.
    
    	Any additional suggestions would be appreciated.  This upgrade
    	is major project and may take some time.  Also, not all of the
    	above ideas may be incorporated in the new version.
    
    			Thanks in advance for any suggestions:
    
    					Keith Maconi
    					ZAP Developer
    
    	Note:  ZAP has been submitted to the ASSETS program to be
    		turned into a "real" DEC product.  I will keep
    		you informed of further developments.
T.RTitleUserPersonal
Name
DateLines
42.1ZAP SUGGESTION: LOG FILE SUMMARYUSHS01::ANDERSON2Jeff Anderson <HSO> DTN 441-3942Wed Dec 02 1987 11:5718
    At our installation, HSO DIS we want to summarize the ZAP.LOG file
    to show who and how many times they were logged out.  This way we
    can slap their hands and wire their equipment to 110 volt outlets
    and really ZAP them.
    
    I am writing the simple program to do this.  I will pass on when
    I am finished.  One thing I did notice in the log file is that the
    terminal name is displayed right next to the username.  Something
    like:
       logged out  VTA1473ANDERSON  ...
    
    This makes it harder to pick out the username because I am guessing
    that a terminal name of TTA4 would show up as "TTA4ANDERSON" in
    the log file.  I am going to write the program with VTAxxxx for
    terminal names.  So far we really like the ZAP program and the way
    it handles the All-in-1 subprocess.
     
42.2Terminal is 7 charactersNRADM5::MACONIThe DoctorWed Dec 02 1987 12:555
    It is easier than you think to get the device and user name.  The
    terminal name is ALWAYS displayed as a 7 character field.  They
    get stuck together when the device name has a four digit unit number.
    
    					Keith Maconi
42.3 < Mucho Gracho >USHS01::ANDERSON2Jeff Anderson &lt;HSO&gt; DTN 441-3942Thu Dec 03 1987 16:12210
    Thank-you!  After looking at the log this morning, I noticed this
    as well.  I finished my summary program and will add it to this
    note.  This way if others are using the zap program then they can save
    this note and compile the program.  As you can tell the program
    is in FORTRAN source but nothing too fancy is included.
    
    
    
    *** program ***
   
	PROGRAM ZAP$SUMMARY

C ******************************************************************************
C		Data Declarations
C ******************************************************************************

	CHARACTER*80	INREC
	INTEGER		POS_LOGOUT,POS_USER,ISTAT
	LOGICAL		MORE_RECORDS

	CHARACTER*12	USER_ARRAY(1000),LUSER
	INTEGER		NUM_LOGGED_OUT(1000),NUM_USERS_FOUND,TOTAL_LOGOUTS

	COMMON USER_ARRAY,NUM_LOGGED_OUT,NUM_USERS_FOUND,TOTAL_LOGOUTS,LUSER

C ******************************************************************************
C		Initialization
C ******************************************************************************

C		Open ZAP Log File
	OPEN(UNIT=10,ORGANIZATION='SEQUENTIAL',ACCESS='SEQUENTIAL',
	1	RECORDTYPE='VARIABLE',FORM='FORMATTED',STATUS='OLD',
	2	READONLY,SHARED,IOSTAT=ISTAT)

	IF (ISTAT .NE. 0) THEN
		CALL ERRSNS(,,,,ISTAT)
		CALL LIB$SIGNAL(%VAL(ISTAT))
	ENDIF

	MORE_RECORDS = .TRUE.
	TOTAL_LOGOUTS = 0
	POS_USER = 14

C ******************************************************************************
C		Mainline
C ******************************************************************************

	DO WHILE (MORE_RECORDS)
C			Read ZAP Log Record
		READ(UNIT=10,FMT='(A)',IOSTAT=ISTAT) INREC

C			If EOF Then Set Flag Else Process Record
		IF (ISTAT .EQ. -1) THEN
			MORE_RECORDS = .FALSE.
		ELSEIF (ISTAT .NE. 0) THEN
			CALL ERRSNS(,,,,ISTAT)
			CALL LIB$SIGNAL(%VAL(ISTAT))
		ELSE
C				If LOGOUT Record Then Summarize Record
		POS_LOGOUT = INDEX(INREC,'logged out')
		  IF (POS_LOGOUT .NE. 0) THEN
			TOTAL_LOGOUTS = TOTAL_LOGOUTS + 1
			LUSER = INREC(POS_USER:POS_LOGOUT-1)
			CALL ACCUMULATE_RECORD
		  ENDIF
		ENDIF
	ENDDO

	CLOSE(UNIT=10)
	CALL SORT_USER_ARRAY
	CALL WRITE_REPORT

	END



	SUBROUTINE ACCUMULATE_RECORD

C ******************************************************************************
C		Data Declarations
C ******************************************************************************

	CHARACTER*12	USER_ARRAY(1000),LUSER
	INTEGER		NUM_LOGGED_OUT(1000),NUM_USERS_FOUND,TOTAL_LOGOUTS

	COMMON USER_ARRAY,NUM_LOGGED_OUT,NUM_USERS_FOUND,TOTAL_LOGOUTS,LUSER

C ******************************************************************************
C		Initialization
C ******************************************************************************

C		Reset Array Slot
	I = 1

C ******************************************************************************
C		Mainline
C ******************************************************************************

C		Find the User in Array of Logged Out Users
	DO WHILE ((USER_ARRAY(I) .NE. LUSER) .AND. (I .LE. NUM_USERS_FOUND))
		I = I + 1
	ENDDO

C		If User Found in Logged Out Array
C		 Then Increment Number of Times User Has Been Logged Out
C		 Else Add New User Entry to Logged Out User Array
	IF (I .LE. NUM_USERS_FOUND) THEN
		NUM_LOGGED_OUT(I) = NUM_LOGGED_OUT(I) + 1 
	 ELSE
		NUM_USERS_FOUND = NUM_USERS_FOUND + 1
		USER_ARRAY(NUM_USERS_FOUND) = LUSER
		NUM_LOGGED_OUT(NUM_USERS_FOUND) = 1
	ENDIF

	END



	SUBROUTINE SORT_USER_ARRAY

C ******************************************************************************
C		Data Declarations
C ******************************************************************************

	CHARACTER*12	TEMP_USER
	INTEGER		TEMP

	CHARACTER*12	USER_ARRAY(1000),LUSER
	INTEGER		NUM_LOGGED_OUT(1000),NUM_USERS_FOUND,TOTAL_LOGOUTS

	COMMON USER_ARRAY,NUM_LOGGED_OUT,NUM_USERS_FOUND,TOTAL_LOGOUTS,LUSER

C ******************************************************************************
C		Initialization
C ******************************************************************************

C ******************************************************************************
C		Mainline
C ******************************************************************************

C		Sort the User Array
C			(Please Don't Fault Me For My Sort Technique!)
C			(Not a Big Array and Should Not Take Long)
	DO I = 1,NUM_USERS_FOUND-1
		DO J = I+1,NUM_USERS_FOUND
C				If Users Are Out of Order
C				 Then Switch User Array and Logged Out Array
			IF (USER_ARRAY(I) .GT. USER_ARRAY(J)) THEN
				TEMP_USER = USER_ARRAY(I)
				USER_ARRAY(I) = USER_ARRAY(J)
				USER_ARRAY(J) = TEMP_USER
				TEMP = NUM_LOGGED_OUT(I)
				NUM_LOGGED_OUT(I) = NUM_LOGGED_OUT(J)
				NUM_LOGGED_OUT(J) = TEMP
			ENDIF
		ENDDO
	ENDDO

	RETURN
	END




	SUBROUTINE WRITE_REPORT

C ******************************************************************************
C		Data Declarations
C ******************************************************************************

	CHARACTER*9	TODAY

	CHARACTER*12	USER_ARRAY(1000),LUSER
	INTEGER		NUM_LOGGED_OUT(1000),NUM_USERS_FOUND,TOTAL_LOGOUTS

	COMMON USER_ARRAY,NUM_LOGGED_OUT,NUM_USERS_FOUND,TOTAL_LOGOUTS,LUSER

C ******************************************************************************
C		Initialization
C ******************************************************************************

	OPEN(UNIT=6,STATUS='NEW',CARRIAGECONTROL='LIST')

C ******************************************************************************
C		Mainline
C ******************************************************************************

	CALL DATE(TODAY)

	WRITE(6,*) '                           ZAP SUMMARY LOG          ',TODAY
	WRITE(6,*) 
	WRITE(6,*) '     Username              Logged Out'

	DO I=1,NUM_USERS_FOUND

		WRITE(6,*) '     ',USER_ARRAY(I),'     ',NUM_LOGGED_OUT(I)

	ENDDO

	WRITE(6,*)
	WRITE(6,*) 'Total Users Listed: ',NUM_USERS_FOUND
	WRITE(6,*) 'Total Logouts: ',TOTAL_LOGOUTS

	CLOSE(UNIT=6)

	RETURN
	END
     
       
    
42.4ZAP$SUMMARY RUN INSTRUCTIONSUSHS01::ANDERSON2Jeff Anderson &lt;HSO&gt; DTN 441-3942Thu Dec 03 1987 16:2112
    
    AFTER ADDING THE PREVIOUS REPLY TO THE CONFERENCE, I NOTICED THAT
    IT NEEDS SOME LOGICAL ASSIGNMENTS FOR THE ASSOCIATED FILES.
    
    	$DEFINE/USER FOR010 zaplogfile
    		(Usually - ZAP$DIR:ZAP.LOG)
    	$DEFINE/USER FOR006 zapsumfil
    		(Optional - If not used it will be SYS$OUTPUT)
    	$RUN ZAP$DIR:ZAP$SUMMARY
    
            
    
42.5A few more ideas..ADOMV1::MANDERSONthe wind don&#039;t blow..... it suxThu Mar 10 1988 01:3327
    I have a few ideas on extending ZAP - being additional fields to
    the exceptions.
    
    1.	A BEFORE and AFTER field. I would like to be able to have ZAP log 
    	out a process if inactive but outside specified hours. ie during
    	the day leave alone but outside, say, 8am to 5pm .and. inactive
	then ZAP. If the fields are * then ZAP as now, if a value then 
    	accumulate ZAP time outside that. 
            
    2. 	A SHUTDOWN field to name a procedure or routine that can be run to 
    	shut down the process cleanly (or cleanup after??), rather than 
    	STOP /ID=?. If field is * then no procedure. 

    	A concern with this sort of utility relates to problems with users 
    	being dropped that have partially completed database transactions. 
    	With RMS journalling etc this isn't as important - but not every 
    	site will have that or Rdb or similar. 

    3. 	A PRIV field. If the account has specified privs then ZAP -
	don't want a SETPRV account hanging round for example.
    
    	
    I like the reports mentioned in the earlier replies, and will compile
    that soon and try it.

    Regards
    Kevin.
42.6suggestionsGLORY::HULLMotor City MadnessFri Apr 01 1988 21:5718
    Here are some next-version suggestions from a customer of mine who
    is currently running a home-grown WATCHDOG program, and to whom I attempted
    to sell ZAP:
    
    They use a current number of users to determine whether any zapping
    takes place, ie, on an 8650, with a max allowed 110 users, at 95
    they begin kicking off.  at 94 and below, all processes are immune.
    I added code for them to allow setting a logical to dynamically
    define a delta-value, (ie, +5, -5) to the current watch level.
    
    In heavy-use times, the sampling interval became faster than normal,
    so a standard 2-minute interval gets shortened to 1 min or even 30
    seconds to look for more processes to kill off during really bad
    crunches for resources.  Does ZAP handle anything like this now?

    Regards,
    
    	Al
42.7ThanksNRADM::MACONIThe DoctorMon Apr 04 1988 14:4117
    ZAP currently, and in the future, has a fixed scan time of 1 minute.
    However, there are plans for "time-dependant" rules in the next
    version which could kick off at pre-determined times.  Ex.  1 hour
    time limit, except between 3 and 5 pm when there is a 30 minute
    time limit.
    
    As far as turning ZAP "on-and-off" based on the number of users
    logged in, I do not believe that a feature such as that can be
    implemented in this version (although it is a possible future
    enhancement), due to ZAP exactly keeping track of users, just processes
    and where they are connected.
    
    (Effectively, it does a SHOW SYSTEM instead of a SHOW USERS).
    
    Thanks for the ideas,
    
    					Keith Maconi
42.8Ditto for tailored shutdownMDVAX3::TAYLORMark TaylorFri Jul 14 1989 14:369
I want to express my interest in the ability to execute a command procedure
when stopping a process, as was previously mentioned.  I am working on a
large project where we want an idle-process-killer but need to execute
a shutdown procedure.

Could you tell me if and when this capability will be included in ZAP?

Thanks,
Mark
42.9ZAP development on holdWOODS::MACONIThe Doctor is InMon Jul 17 1989 12:0410
    
    Version 4.0 of ZAP has been put on hold due to a lack of funding.
    
    I do hope to work more on it in my spare time, but there is not a
    lot of that.
    
    It is possible that I may be able to add a few new features to the
    current version, as long as they do not require a major re-write.
    
    					Keith Maconi
42.10We definitely need itMDVAX3::TAYLORMark TaylorMon Jul 17 1989 18:4812
Thanks for responding, Keith.

We are definitely going to use an idle-process-killer on the project, and 
we would like for it to be ZAP.  I'm pretty sure the only modification we would 
need is the execution of a command procedure before the stop/id.  We would
appreciate it if this could be included.  It seems like it would be a small
change.

But if you won't have the time soon (5 weeks), we could modify ZAP at
our site.   Is this allowed for a solution tool?

Mark
42.11Possible patchWOODS::MACONIThe Doctor is InWed Jul 19 1989 14:5920
    The following patch would be "relatively" easy to implement:
    
    	Insert an extra field in the ZAP exception record which may contain
    	one of the following values:
    
    		kill		- stop the process via $DELPRC
    		<none>		- use default method (kill)
    		filename	- create a detached process running in
    				  [1,4] which executes this file:
    				  ZAP$DIR:filename.COM
    					p1 = pid of process to be stopped
    
    	The original idea of having input forced into the users input
    buffer has proved too difficult and far too complex to maintain across
    the different versions of VMS.
    
    	If the above sounds interesting, please comment.
    
    					Keith
    
42.12On an image basis?MDVAX3::TAYLORMark TaylorThu Jul 20 1989 11:585
Sounds good, Keith.  That would allow us to do what we would like.  One
thing that would be nice, though not necessary, is the ability to specify
the kill/filename value on an image basis.

Mark