Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Running MONITOR IO in a batched command file

 
SOLVED
Go to solution
Neal Kirby
Advisor

Running MONITOR IO in a batched command file

Greetings.

Thanks for taking the time to read my concern.

SCENARIO:
When I run MONITOR IO I see IO stats as they occur. When I am finished, I choose CTRL Z and the session ceases.

If I wanted to grab 5 min intervals every hour for 24 hours - I need to submit this to a batch queue in a .COM file. This is fine.

QUESTION:
How do I handle the (CTRL Z) in the .COM file?

Is there something like e.g. /TIME=5 command that will run MONITOR IO for 5 minutes. At which point I /OUTPUT the screen to a text file. The job exits and I can start again in an hour.

Or am I barking up the wrong tree & there is a better way of capturing this information.

Thanks as always.

Neal Kirby
9 REPLIES
Jan van den Ende
Honored Contributor

Re: Running MONITOR IO in a batched command file

Neal,

for all kinds of batches like this (and even more: if a procedure might get to hang and needs stopping if not finished before a certain time, especially UNattended ones) I created a little procedure which accepts absolute time OR delta time as a parameter.
This procedure is SPAWNed. It finds out its MASTERPID, and just waits until the specified time. IF the spawned process is still around at the specified time, it notifies SYSTEM MGT, and kills its parent.
If the intended process has done its task, it stops the supprocess. Very little overhead, and quite robust.

Proven VERY effective for unattended BACKUPs; especially before MiniMerge became available, and ca. 1 hour of IO intensive ShadowCopy needed to be finished well before the earliest office workers became active. :-)

( In your case, the starting again should, and can easily) be implemented separately.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Hoff
Honored Contributor
Solution

Re: Running MONITOR IO in a batched command file

The MONITOR qualifiers involved here are /BEGINNING and /ENDING, which do pretty much what you want. See the System Management Utilities Reference manual for details on the /RECORD qualifier and the recording operation, or HELP MONITOR for some related materials.

The /RECORD stuff can then be played back (using MONITOR and its /INPUT qualifier) at your leisure.

http://h71000.www7.hp.com/doc/83final/6048/6048pro_046.html#bottom_046

Or have a look at installing and using the (free) T4 tools, which uses MONITOR for you, and is set up for capturing and displaying performance data. T4 is discussed here:

http://www.openvms.compaq.com/openvms/products/t4/index.html
Volker Halle
Honored Contributor

Re: Running MONITOR IO in a batched command file

Neal,

try something like:

$ monitor io/end="+0-0:5:00"/summ/nodispl

This will create a MONITOR.SUM file for the 5-minute interval.

There are also some examples on how to use MONITOR in batch in SYS$EXAMPLES:MON*.COM.

Volker.
labadie_1
Honored Contributor

Re: Running MONITOR IO in a batched command file

You have 2 command files in sys$examples that will help you, submon.com and monsum.com

A little tweaking may be needed to suit your needs.

$ ty
_File: sys$examples:submon.com
$ ! Copyright (c) 1987 Digital Equipment Corporation. All rights reserved.
$ !
$ ! SUBMON.COM (Submit MONITOR.COM file)
$ !
$ ! This command file is to be placed in a cluster-accessible
$ ! directory called SYS$MONITOR. At system startup time, for
$ ! each node, it is executed by SYSTARTUP.COM, following logical
$ ! name definitions for the cluster-accessible directories,
$ ! SYS$MONITOR and MON$ARCHIVE.
$ !
$ !
$ ! Submit detached MONITOR process to do continuous recording.
$ !
$ !
$ RUN SYS$SYSTEM:LOGINOUT.EXE -
/UIC=[1,4] -
/INPUT=SYS$MONITOR:MONITOR.COM -
/OUTPUT=SYS$MONITOR:MONITOR.LOG -
/ERROR=SYS$MONITOR:MONITOR.LOG -
/PROCESS_NAME="Monitor" -
/WORKING_SET=100 -
/MAXIMUM_WORKING_SET=100 -
/EXTENT=512 -
/NOSWAPPING
$ !
$ !
$ ! End of SUBMON.COM
$ !
$ dir sys$examples:monsum

Directory SYS$COMMON:[SYSHLP.EXAMPLES]

MONSUM.COM;1

Total of 1 file.
$ ty sys$examples:submon.com
$ ! Copyright (c) 1987 Digital Equipment Corporation. All rights reserved.
$ !
$ ! SUBMON.COM (Submit MONITOR.COM file)
$ !
$ ! This command file is to be placed in a cluster-accessible
$ ! directory called SYS$MONITOR. At system startup time, for
$ ! each node, it is executed by SYSTARTUP.COM, following logical
$ ! name definitions for the cluster-accessible directories,
$ ! SYS$MONITOR and MON$ARCHIVE.
$ !
$ !
$ ! Submit detached MONITOR process to do continuous recording.
$ !
$ !
$ RUN SYS$SYSTEM:LOGINOUT.EXE -
/UIC=[1,4] -
/INPUT=SYS$MONITOR:MONITOR.COM -
/OUTPUT=SYS$MONITOR:MONITOR.LOG -
/ERROR=SYS$MONITOR:MONITOR.LOG -
/PROCESS_NAME="Monitor" -
/WORKING_SET=100 -
/MAXIMUM_WORKING_SET=100 -
/EXTENT=512 -
/NOSWAPPING
$ !
$ !
$ ! End of SUBMON.COM
$ !
$ ty sys$examples:monsum.com
$ ! Copyright (c) 1987 Digital Equipment Corporation. All rights reserved.
$ !
$ ! MONSUM.COM (Generate cluster multi-file summaries)
$ !
$ ! This command file is to be placed in a cluster-accessible directory
$ ! called SYS$MONITOR and executed at the convenience of the cluster
$ ! manager. The file generates both 24-hour and "prime time" cluster
$ ! multi-file summaries and resubmits itself to run each day at midnight.
$ !
$ SET DEF SYS$MONITOR
$ SET NOON
$ !
$ ! Compute file specification for MONSUM.COM and resubmit the file.
$ !
$ FILE = F$ENVIRONMENT("PROCEDURE")
$ FILE = F$PARSE(FILE,,,"DEVICE")+F$PARSE(FILE,,,"DIRECTORY")+F$PARSE(FILE,,,"NAME")
$ SUBMIT 'FILE' /AFTER=TOMORROW /NOPRINT
$ !
$ ! Generate 24-hour cluster summary.
$ !
$ !
$ MONITOR/INPUT=(SYS$MONITOR:*MON*.DAT;*,MON$ARCHIVE:*MON*.DAT;*) -
/NODISPLAY/SUMMARY=MONSUM.SUM -
ALL_CLASSES,DISK/ITEM=ALL,SCS/ITEM=ALL -
/BEGIN="YESTERDAY+0:0:0.00" /END="TODAY+0:0:0.00" /BY_NODE
$ !
$ !
$ ! Mail 24-hour summary file to cluster manager and delete the file from
$ ! SYS$MONITOR.
$ !
$ !
$ !
$ MAIL/SUBJECT="Daily Monitor Cluster-wide Summary" MONSUM.SUM cluster_manager
$ DELETE MONSUM.SUM;*
$ !
$ ! Generate prime-time cluster summary.
$ !
$ !
$ MONITOR/INPUT=(SYS$MONITOR:*MON*.DAT;*,MON$ARCHIVE:*MON*.DAT;*) -
/NODISPLAY/SUMMARY=MONSUM.SUM -
ALL_CLASSES,DISK/ITEM=ALL,SCS/ITEM=ALL -
/BEGIN="YESTERDAY+9:0:0.00" /END="YESTERDAY+18:0:0.00" /BY_NODE
$ !
$ !
$ ! Mail prime-time summary file to cluster manager and delete the file
$ ! from SYS$MONITOR.
$ !
$ !
$ MAIL/SUBJECT="Prime-Time Monitor Cluster-wide Summary" MONSUM.SUM cluster_manager
$ DELETE MONSUM.SUM;*
$ !
$ ! End of MONSUM.COM
$ !
$
P Muralidhar Kini
Honored Contributor

Re: Running MONITOR IO in a batched command file

Hi Neal,

>> How do I handle the (CTRL Z) in the .COM file?
You can tell Monitor to collect data only for some period of time.
You can specify the ending time using the /ENDING qualifier.
If you dont specify the /ENDING then MONITOR will continue its work
until you terminate it using Crtl/C or Crtl/Z.

Check the following link -
http://h71000.www7.hp.com/doc/83final/6048/6048pro_046.html
-> Refer help for /ENDING

You need to make use of the /ENDING in your command procedure.

In the Command procedure, if you want monitor to run for 5 mins only then
* Take Current Time
* End time = Current time + 5 mins
* MONITOR *** /ENDING=End time

Hope that helps.

Regards,
Murali
Let There Be Rock - AC/DC
Hoff
Honored Contributor

Re: Running MONITOR IO in a batched command file

Jan's generic approach is a stepping-stone on the way to a scheduling package. There are many such around that build on the rather limited capabilities available within VMS here. On SUBMIT /AFTER and the periodic RUN stuff, or on tools such as cron and Kronos, maybe a port of the open-source launchd (Apache license), or commercial scheduling packages.

http://en.wikipedia.org/wiki/Launchd

I've previously groused about the lack of capable job scheduling being a problem, of course.
Andy Bustamante
Honored Contributor

Re: Running MONITOR IO in a batched command file

In addition to answers already posted about using monitor directly, consider installing T4 http://h71000.www7.hp.com/openvms/products/t4/index.html to collect data. This will provide more information in a potentially more useful form. Since T4 usses monitor as one input, you also have the raw monitor data file availble. You can review this file with

$ monitor/input= io

Use the /view option to speed display rate.

And yes, you can read this file while monitor is writing, use /begin and /end to narrow your window.

I used to run monitor in batch, with daily summaries of "prime time" emailed to me before T4 became available. You have the option of creating 1 large file over your 24 hour period and extracting reports. Anything you do manually will only duplicate the functionality of T4 and TLViz.

If you don't have time to do it right, when will you have time to do it over? Reach me at first_name + "." + last_name at sysmanager net
Robert Gezelter
Honored Contributor

Re: Running MONITOR IO in a batched command file

Neal,

Generally, I would recommend gathering the full spectrum of performance data (as is done by T4 using MONITOR/RECORD as a foundation.

Playing the data back later, one can do choose to look at as broad or as limited set of data as one pleases. More importantly, if one is trying to understand peaks of IO activity, being able to drill down into other issues is often clarifying (particularly when using tools such as the companion to T4, which allow plotting of data over time).

My general rule: Gather broad data, then do narrow or broad analysis as appropriate. With today's storage capacities, the difference in volume is not great. I also note that attention should be paid to ensure adequate RMS extend and buffering factors for the MONITOR output file. To be able to remove the activity generated by MONITOR itself, it also helps to have a separate disk volume (or an otherwise low activity volume) to store the data.

As Hoff noted, the underlying parameters are /BEGIN and /END, together with /RECORD.

- Bob Gezelter, http://www.rlgsc.com
Neal Kirby
Advisor

Re: Running MONITOR IO in a batched command file

Thanks to everyone who supported this Thread. In the end I used T4 (first suggested by Hoff). It was simple to setup and we a bit of practice the output was very usable, especially when the file was outputted to Windows and the information displayed on TLVIZ.
http://h71000.www7.hp.com/openvms/products/t4/