Copyright 1990-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 December, 1990 RoboVAX By Kevin G. Barkes I hate system management. Well, let me clarify that. I hate managing my VAXstation 3100. Sometimes people forget that a VAXstation is not an MS-DOS PC with a thyroid problem. It's a real VAX, running real VMS. And sometimes it's a real pain. As a member of the VAX Professional Review Board, I frequently test code on my machine. Some of these programs are system utilities which do funny things. How funny depends on the skill of the programmer and how long it takes to reboot after VMS seizes up and has the silicon equivalent of an anxiety attack. Then there are the routine functions, like checking for odd device errors, and determining whether critical processes are still working after experimenting with potentially nasty code. On a "normal" multi-user VAX, a system manager has an elaborate network of reliability sensors. They're called users. When something starts getting out of line, you can bet they will start squawking mightily. A VAXstation user is in an entirely different world. It's not unusual for a workstation to be up for weeks, during which time things silently can start going sour. A disk drive begins accumulating errors; something whacked the queue manager; you're almost out of space on your system disk. It's a great inconvenience to have to manually check for this stuff, so I wrote a small DCL command procedure to keep an eye on my system's operations and scream bloody murder when it detects something's gone awry. RoboVAX is a daemon that notifies you when an unusual condition occurs. "Unusual" depends upon your tastes. This code was hacked out in about an hour and lacks the added niceties a robust utility should possess. On the plus side, its simiplicity makes modifying it an uncomplicated, straightforward task. The procedure takes a little over a second to execute on a VAXstation 3100. Your mileage may vary, depending upon the extent of your additions. It's presently configured to run every ten minutes; a day's worth of RoboVAX monitoring consumes about two and a half minutes of CPU time. RoboVAX runs as a detached process, invoked by the command file ROBOSTART.COM (Program 2.) It should be run with a [SYSTEM] UIC to insure it can check on detached system processes. There are several public domain programs which permit "zeroing out" device error counts. I use one to reset the values after examining the source of a RoboVAX alert, eliminating "old" problems from re-tripping an alarm. I have several sites using RoboVAX-like utilities. I constantly amaze my clients by being able to determine what's wrong within seconds of logging in. Maybe it's the SHOW LOG/SYS RV* at the very beginning of my LOGIN.COM file... ******************************** PROGRAM 1. $! 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 "MKA500" $! $! Check free disk space $ CALL FREEDISK "DKA100" "100000" $ CALL FREEDISK "DKA200" "20000" $ CALL FREEDISK "DKA300" "20000" $! $! 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 $ 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 *************************************************** PROGRAM 2 $ RUN/DETACH/UIC=[SYSTEM] - /INPUT=SYS$MANAGER:ROBOVAX - /OUTPUT=NL: SYS$SYSTEM:LOGINOUT $ EXIT ---------- ********************* Kevin G. Barkes is an independent consultant. He publishes the KGB Report newsletter, operates the www.kgbreport.com website, lurks on comp.os.vms, and can be reached at kgbarkes@gmail.com.