Copyright 1994-2016 by Kevin G. Barkes All rights reserved. This article may be duplicated or redistributed provided no alterations of any kind are made to this file. This edition of DCL Dialogue is sponsored by Networking Dynamics, developers and marketers of productivity software for OpenVMS systems. Contact our website www.networkingdynamics.com to download free demos of our software and see how you will save time, money and raise productivity! Be sure to mention DCL Dialogue! DCL Dialogue Originally published March, 1994 RoboVAX Revisited Back in December of 1990 I published a system management utility called RoboVAX that continues to haunt me to this day. The procedure was widely distributed over various networks and online services, and was included in "DCL on the Edge of Forever and Other Related Tales", a collection of about a dozen of these columns printed in booklet form a couple years ago. Nary a month passes that I don't receive at least one expanded version of the original via e-mail and at least two requests for me to redistribute or republish it. So, here it is (See Program). RoboVAX is a bare bones DCL-based system monitor that runs as a detached process. It's not very complicated, which makes it easy to modify and embellish, as witnessed by my aforementioned collection of about 30 RoboVAX variations which I've accumulated over the years. With its default execution cycle of ten minutes, RoboVAX has used about 28 minutes of CPU time over my VAXstation 4000 Model 60's current uptime of 42 days, so it isn't much of a resource hog. It's best to start RoboVAX from your system startup file using the command: $ RUN/DETACH/UIC=[SYSTEM] - /INPUT=SYS$MANAGER:ROBOVAX.COM - /OUTPUT=NL: SYS$SYSTEM:LOGINOUT The procedure works simply. It first tries to change its process name to "RoboVAX". If it fails, it assumes another RoboVAX process exists and the procedure stops. The existence of certain critical processes, device error counts, free disk space and the presence of the SYS$BATCH queue are monitored by RoboVAX, which sends a REPLY message to whomever you specify. Since broadcast REPLYs can quickly scroll off the screen, RoboVAX uses logical name assignments to permit easy monitoring and spot checks. A SHOW LOGICAL/SYSTEM RV* will display the status of all the items RoboVAX is monitoring. You can write other procedures which check the contents of the RV logicals and perform additional functions, like paging you if something goes out of whack. Subroutines are CALLed to reduce coding and permit the passing of parameters. This makes it a simple matter to add or delete items to be monitored. There's one rather ugly hack I added to the original RoboVAX procedure. The DCL lexical function f$getdvi doesn't permit you to get the counts on cpu and memory errors. This information is available, though, by looking directly at the system data structures and examining the longwords where OpenVMS stores the counts. SYS$SYSTEM:SYS.MAP contains the key. Search for references to EXE$GL_MEMERRS and EXE$GL_MCHKERRS; these symbols contain the addresses of the longwords we need. Note that the addresses can change with new releases of OpenVMS and that you'll have to manually update them as required. Undocumented Feature: Peter Sandhu called into the BBS to report a handy little surprise built into the OpenVMS 6.0 flavor of the SEARCH command. Peter says SEARCH now reports what file it is searching when control-t is pressed, similar to the behavior of the BACKUP command. A cursory search of the 6.0 DCL Dictionary didn't reveal this tidbit. Thanks to Kevin Flannery, Steven A. Haaser, Billy D'Augustine, Joe Koffley, Christopher Markis, Kevin Kohler, Randy Rahn, Warren Wright, David O. Blanchard, Sanjay Kumar, Paul Kratchman and Perry Bret Wischow who sent mail to kgbarkes@gmail.com since the last column appeared. Your comments and suggestions are appreciated. "Zube", a self-described "system grunt/grad student" at Colorado State, commented about my December column concerning the problems I had with my recent VAXstation lease. "You mention that you were spending over $660 dollars for hardware and software support and that this was like buying two copies of MS-DOS every day. Not to pick nits, but if the average month has 30 days (for the sake of argument) then this means you would purchase 60 copies of MS-DOS per month. At $660, each copy of DOS costs $11. Does Microsoft or the SPA know about this?" Okay, Zube, ya caught me. Would you believe quantity discounts? The MS-DOS v6.2 $9.99 update special? The fact I'm willing to pay $660 a month should be a pretty clear indication of my math skills, anyway... Observation of the month: Several persons have commented that the Internet has become to the 90s what CB radio was to the 70s. And I'm afraid they're right. Words to live by: "Always do exactly what your boss would do if he knew what he was talking about."-Grande's Law. ******************** Kevin G. Barkes is an independent consultant who observes that the "general interest" newsgroups on the Internet are a prime example of the concept that you get what you pay for, and suggests that colleges make certain that their students' vocabularies include words greater than four letters before granting them net access. Kevin lurks on comp.os.vms and can be reached at kgbarkes@gmail.com. PROGRAM $! RoboVAX.COM $! Bare bones system monitor. $! $ SET NOON $ SET PROCESS/NAME="RoboVAX" $ IF $SEVERITY .EQ. 1 THEN GOTO TOP_OF_JOB $ REPLY/URGENT/USER=BARKES/BELL "Another RoboVAX Process Exists" $ EXIT $! $ TOP_OF_JOB: $! Check for processes which should exist: $ CALL C_PROC "OPCOM" "OPCOM Process Disappeared" $ CALL C_PROC "ERRFMT" "ERRFMT Process Disappeared" $ CALL C_PROC "JOB_CONTROL" "JOB_CONTROL Process Disappeared" $ CALL C_PROC "DPA" "DPA Process Disappeared" $! $! Check error counts: $ CALL ERRCOUNT "TTA2" $ CALL ERRCOUNT "TTA3" $ CALL ERRCOUNT "DKA100" $ CALL ERRCOUNT "DKA200" $ CALL ERRCOUNT "DKA300" $ CALL ERRCOUNT "ZRA0" $ CALL ERRCOUNT "MKA500" $ CALL ERRCOUNT "MKA700" $! $! Check free disk space $ CALL FREEDISK "DKA100" "100000" $ CALL FREEDISK "DKA200" "250000" $ CALL FREEDISK "DKA300" "250000" $ CALL FREEDISK "ZRA0" "500000" $! $! Check for queue status: $ SHOW QUEUE SYS$BATCH $ IF $SEVERITY .NE. 1 $ THEN REPLY/BELL/USER=BARKES "SYS$BATCH queue is missing." $ ASSIGN/NOLOG/SYSTEM "SYS$BATCH is missing" RV_BATCH $ ELSE $ ASSIGN/NOLOG/SYSTEM "SYS$BATCH exists" RV_BATCH $ ENDIF $! Check for memory and cpu errors $ MEM_ERR = F$CVUI(0,16,F$FAO("!AD",4,%X800044F4)) $ MCH_ERR = F$CVUI(0,16,F$FAO("!AD",4,%X800044F0)) $ IF MEM_ERR .NE. 0 THEN REPLY/BELL/URGENT/USER=BARKES - "There are ''MEM_ERR' memory errors." $ IF MCH_ERR .NE. 0 THEN REPLY/BELL/URGENT/USER=BARKES - "There are ''MCH_ERR' cpu errors." $ ASSIGN/NOLOG/SYSTEM "RV_MEMORY_ERRORS=''MEM_ERR'" RV_MEMORY $ ASSIGN/NOLOG/SYSTEM "RV_CPU_ERRORS=''MCH_ERR'" RV_CPU $ WAIT 00:10:00 $ GOTO TOP_OF_JOB $! $!**************************** $! SUBROUTINE $!**************************** $! Process existence subroutine: $ C_PROC: SUBROUTINE $ CHECK = 0 $ SHOW PROCESS/NOOUTPUT 'P1' $ CHECK = $SEVERITY $ IF .NOT. CHECK $ THEN - REPLY/BELL/URGENT/USER=BARKES "''P2'" $ ASSIGN/NOLOG/SYSTEM "RV_!''P1'_!Does not exist" "RV_''P1'_PROCESS" $ ELSE $ ASSIGN/NOLOG/SYSTEM "RV_!''P1'!_Exists" "RV_''P1'_PROCESS" $ ENDIF $ ENDSUBROUTINE $! $! Disk space subroutine: $ FREEDISK: SUBROUTINE $ FREESPACE = F$GETDVI(P1,"FREEBLOCKS") $ IF FREESPACE .LT. P2 THEN - $ REPLY/BELL/URGENT/USER=BARKES - "''P1' is down to ''FREESPACE' blocks." $ ASSIGN/NOLOG/SYSTEM "RV_''P1'_FREESPACE=''FREESPACE'" RV_'P1' $ ENDSUBROUTINE $! $! Device error subroutine: $ ERRCOUNT: SUBROUTINE $ ERRORS = F$GETDVI(P1,"ERRCNT") $ IF ERRORS .NE. 0 THEN REPLY/BELL/URGENT/USER=BARKES - "''P1' has ''ERRORS' errors." $ ASSIGN/NOLOG/SYSTEM "RV_''P1'_ERRORS=''ERRORS'" RV_'P1' $ ENDSUBROUTINE