Operating System - OpenVMS
1752567 Members
5161 Online
108788 Solutions
New Discussion юеВ

Re: Monitoring SYS$BATCH queues via email

 
SOLVED
Go to solution
Challenger
New Member

Monitoring SYS$BATCH queues via email

I need to be able to monitor SYS$BATCH queues and report via email or phone call that an abort has occurred. Does Openvms 7.2-2 already have something like this built in? Or what DCL commands would handle this?

Thanks for your help.
7 REPLIES 7
Hein van den Heuvel
Honored Contributor
Solution

Re: Monitoring SYS$BATCH queues via email

OpenVMS does NOT have that build in.
There are tools that do DECscheduler (does that still exist?) and JAMS come to mind.
Other freeware and real solutions surely exist.

If you want to roll your own, then you could parse out $SHOW QUEUE and SHOW ENTRY output, but you should look at F$GETQUI.
This is NOT the easiest, in fact it is the hardest, lexical function to use, so be sure to google for examples.
Mind you, it is all to easy to spend days on getting a mostly working solution to one that is robust and works all the time and as needed. So you really should try to find an existing tool, be it free or paid for.

hth,
Hein.


Jess Goodman
Esteemed Contributor

Re: Monitoring SYS$BATCH queues via email

If by "abort" you mean a job has failed due to an error, then (assuming the failed job returns an error status to DCL) then you can do this:

$ SET QUEUE SYS$BATCH /RETAIN=ERROR

Run as a detached process a DCL monitoring script similar to this:

$ SET NOON
$ DJ := DISPLAY_JOB
$ FZ := FREEZE_CONTEXT
$OLOOP:
$ IF (F$GETQUI("DISPLAY_QUEUE","RETAINED_JOB_COUNT",-
"SYS$BATCH","WILDCARD") .GT. 0)
$ THEN
$ILOOP:
$ RETAIN = F$GETQUI(DJ,"JOB_RETAINED",,"ALL_JOBS")
$ IF (RETAIN)
$ THEN
$ JOB_NAME = F$GETQUI(DJ,"JOB_NAME",,FZ)
$ FINAL_STATUS = F$GETQUI(DJ,"CONDITION_VECTOR",,FZ)
$ ENTRY_NUMBER = F$GETQUI(DJ,"ENTRY_NUMBER",,FZ)
$ DELETE /ENTRY='ENTRY_NUMBER'
$ MAIL NL: mymail-
/SUBJ="Job ''JOB_NAME' failed; STATUS=%X''FINAL_STATUS'"
$ DUMMY = F$GETQUI("CANCEL_OPERATION")
$ GOTO OLOOP
$ ENDIF
$ IF (RETAIN .NES. "") THEN GOTO ILOOP
$ ENDIF
$ WAIT 00:00:30
$ DUMMY = F$GETQUI("CANCEL_OPERATION")
$ GOTO OLOOP
I have one, but it's personal.
Challenger
New Member

Re: Monitoring SYS$BATCH queues via email

Thanks for your answer.

What about the queue manager, anything there that may help?
marsh_1
Honored Contributor

Re: Monitoring SYS$BATCH queues via email

hi,

no the queue manager won't help here , as hein has mentioned it's either use a scheduling tool there are a number available at various price points or use something like jess's example.
you might want to retro fit a standardised error handling routine with smtp mail alerts into your current dcl scripts and use for all future as a template.

fwiw

Hoff
Honored Contributor

Re: Monitoring SYS$BATCH queues via email

OpenVMS itself does not have job scheduling, process scheduling, batch scheduling, task scheduling nor anything similar.

(Yes, there is something called a class scheduler, but that's not intended for this purpose.)

Freeware packages include a cron port and an updated version of kronos. Or you manage it from batch or your own DCL or other such hackery. Or you acquire and install one of the commercial packages. (DECscheduler is now CA ScheduleIT or some such, last I looked.)

Some scheduling-related topics:
http://64.223.189.234/node/97
http://64.223.189.234/node/501
http://64.223.189.234/node/872

John Gillings
Honored Contributor

Re: Monitoring SYS$BATCH queues via email

Challenger,

I have all queues set to RETAIN=ERROR so that failed jobs remain on the queue until explicitly deleted.

I also have a job that runs daily on all systems scanning queues, looking for jobs in unexpected states, and jobs where the command procedures has been updated. It sends a mail message if any are found.

I've included some sample code from the procedure as an attachment. It isn't complete, getting it to work in your environment left as an exercise.

The code to automatically resubmit a job where the command procedure has been updated is omitted, it's not something that should be done blindly, and the sanity checks I perform aren't applicable to other sites.
A crucible of informative mistakes
John Gillings
Honored Contributor

Re: Monitoring SYS$BATCH queues via email

ITRC dropped the attachment. Try again

(wouldn't it be nice if HP replaced this system with something reliable?)

A crucible of informative mistakes