DOCUMENTATION FOR snap BY DANIEL J. GRAHAM SNAP is a process control program for the system manager. It allows many different kinds of viewing and manipulations on user or system processes. SNAP is a very fancy SHOW USERS. it gives a useful screen of information about each user process on the system. (Optionally, it also gives the same stuff about system processes.) You can get a bunch of statistics on the process, you can view what is going on on a terminal or write to that terminal's buffer, you can delete a process, force an image exit on a process, change priority, suspend or resume a process. WARNING: Do not install this program with privs. It is very dangerous and could seriously compromise your system's security if used by someone with intent to do damage. Do not make it available to any but trusted systems people. Building SNAP: There are some parts of the program SNAP.FOR which will need editing before you build the image. - SNAP will see up to 200 processes. If you anticipate viewing more, modify the MAX_PROCESS parameter at the top of the program SNAP.FOR. - The usernames that are skipped in a non-system view [what normally happens] are SYSTEM, DECNET, MRMANAGER, MRTIDY and ORACLE. The last one is because we run that product. If you wish to alter that list, simply modify the appropriate IF statement a few lines beyond label 10 in SNAP.FOR. - The VIEW function depends on the LIB$DO_COMMAND call. A small command file is executed to run the program that can't be a part of the SNAP image, then SNAP is rerun. In this instances, you must edit SNAP.FOR to tell the program where the VIEW.COM file is located. Do a search within your editor for the string DCLCMD. You will find the place. Note that the string is defined as a CHARACTER*49. If your string is longer, extend that definition. You will also want to edit VIEW.COM to indicate the proper location of WATCH.EXE, the program activated by the VIEW function. Execute the BUILD.COM file to make everything happen correctly. Define a foreign symbol like so: $ SNAP := $DISK:[DIRECTORY]SNAP.EXE Then to run SNAP, just enter the command SNAP, or SNAP S if you want to see all system processes too. NOTE -- When BUILD.COM is compiling the MACRO modules and programs, you will see some generated warnings about the code not being fit for multiprocessor systems. Ignore this. We haven't been able to find the reason for the warnings, but the package does seem to run just fine on SMP systems. Using SNAP: SNAP uses SMG$ screens and key capture commands to make operation easy. First, a screen is painted with one line for each process and the commands at the bottom. The first 18 processes are displayed upon initialization. Pressing the DOWN ARROW will display the next 18. Pressing the UP ARROW will revert to the previous 18. Pressing the keypad comma will take the display to the last 18 processes, the keypad minus will display the first 18. The various actions work on specific processes. To select an action, you may enter the first letter of that action and press return; you may use the right and left arrows to highlight the word of the action you desire at the bottom of the display and press return or you may press the appropriate keypad key and not bother pressing return. It is necessary to have the process you wish to act upon in the process scroll window BEFORE you choose an action type. Entering "A" will simply update the basic information again. Entering an "E" will cause an exit, as will a "Q," a control Z or PF4. A Control W or PF3 will refresh the screen in case of broadcast message foul-ups. The A (again) command redisplays the processes that are not system ones. A keypad 9 will change the display to include all system processes too. Using A after this will again revert the display to non-system processes only. By default, SNAP sees only user processes, omitting system usernames as mentioned earlier. To view all processes on the system, invoke SNAP with a parameter of "S", $ SNAP S, or use the keypad as mentioned above. Actions: Again - This does not act upon a process, but regathers the process information and displays it. The window is shifted to the first 18 processes, non-system ones only are shown. Delete - This will Delete the selected process. Force - This will force an image exit on the selected process, using the FORCEX system service. Stats - This will gather some statistics about the processes, including their current directory and their LAT server and port if you are using those items. Cont - This does a SHOW PROCESS/CONTINUOUS on a process. It does this by running an external command file and rerunning the program, kludgy but the only way I could find to do it. View - This executes the WATCH program which allows you to view a terminal and, optionally, force input to it. This is the really dangerous one and should be given out carefully. DO NOT ATTEMPT TO VIEW an RTA device, it will crash the system. Leave View with a control-z. Toggle input mode to the Viewed terminal with a control-backslash. Toggle input mode off before exiting, or you will input a control-z to the viewed terminal. Modify - This presents a small menu with three choices, modify a process's priority, suspend a process or resume one. UAF - This will select some data from the System Authorization file and display it. Exit - This exits the program. At almost every point in the program an E, Q or CTRL/Z will cause an exit. Refresh Screen - In case of broadcasts screwing up the screen, the standard CTRL/W screen refresh is implemented. Keypad Mode: Here is a picture of the keypad commands: +------+------+------+------+ | | This |Redraw| Exit | | | Help |Screen|Screen| +------+------+------+------+ |Modify| UAF |Again/|Top of| | Proc | Info |system| List | +------+------+------+------+ | View | Proc | Show |End of| | Term |Stats | Cont | List | +------+------+------+------+ | Do |Delete|Force | | |Again |Proc | ^Y |Press | +------+------+------+ for + | | |action| | | | | +-------------+------+------+ The "Top of List," "End of List" and "Again/system" functions are available only in keypad mode. Thanks go to the authors of lib_default_dir.mar and watch.mar. Watch.mar is a program that can get you into a lot of trouble, especially with people being paranoid about invasion of privacy. Use it with care and discretion and, for Pete's sake, don't brag about having it to users who don't need to know. I am happy to answer questions and entertain all suggestions for better performance or additional features. ----------- Dan Graham Dynamics Research Corporation, Andover, Ma (508) 475-9090 x2352 Internet address: graham@drcvax.af.mil ====================================================================== DISCLAIMER: Neither I nor my employer take any responsibility for any effects of using this program package. It is possible that in some cases, these programs may be illegal to use or against government or company policy. Use is at the risk and discretion of each individual receiving the program package. We assume no responsibility for any damage caused by the use of SNAP or WATCH, whether of a business, personal or data processing nature.