1828505 Members
3141 Online
109978 Solutions
New Discussion

Need DCL help

 
SOLVED
Go to solution
James Viswasam
Advisor

Need DCL help

Hi
I have only beginner level knowledge in DCL. I am trying write a script that would track a process that goes into a loop ( CUR state with no I/O ) I know the process name starts with SRV. I need this to be done quickly as we have a problem that causes this. (This is ofcourse a temproary thing until the vendor fixes the application bug that is causing this)
Your help would be greatly appreciated.
9 REPLIES 9
Andy Bustamante
Honored Contributor

Re: Need DCL help

Take a look at F$GETJPI (help lexical F$GETJPI) and SYS$EXAMPLES:WORKING_SET.COM.

The command file gives a good example of how check all processes on a system. F$GETJPI can provide the I/O numbers you're looking for.


Andy
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
Hein van den Heuvel
Honored Contributor

Re: Need DCL help


Maybe instead of scripts you should look at tools or utilities?

Like
$moni proc/topcpu
and
$moni proc/cont/id...

Do you want to catch a program as soon as possible after it gets into a computable loop? I suspect this is a standard function of tools like DECamds or Openview, but do not really know.

I suppose you could write a dcl script to loop over all processes with F$GETJPI.
For each process grab cputime. Subtract prior cpu time stored in cpu_'pid. If within 95% of loop interval, report potential problem. After test remember the cpu time in a symbol cpu_'pid. After last process wait 10 seconds and try again.

Hein.


John Gillings
Honored Contributor
Solution

Re: Need DCL help

James,

I've attached a sample command procedure which looks for processes owned by a specified username (optional) with a process name starting with a specified prefix, it saves the DIOCNT and BIOCNT for each process discovered. When seen again, the state is checked. If CUR or COM, with no change in DIOCNT or BIOCNT, a mail message is sent to a specified user.

Modification to you exact specifications left as an exercise, usual disclaimers...
A crucible of informative mistakes
John Gillings
Honored Contributor

Re: Need DCL help

Oops, almost forgot...

Since this procedure creates two new symbols for each matching process found, if you leave it running long enough, especially if you have many processes, or high process turnover, it could potentially fill your symbol table.

Probably a good idea to stop and restart every so often!
A crucible of informative mistakes
Antoniov.
Honored Contributor

Re: Need DCL help

John,
at first glance, your dcl procedure has a little error:

$ IF(state.EQS."CUR".OR.state.EQS."COM").AND.
- (dio-dio'pid'.EQ.0).AND.(bio-bio'pid'.EQ.0)

where dio-dio'pid' and bio-bio'pid' don't seem assigned in elsewhere.
I guess you want to write
$ IF(state.EQS."CUR".OR.state.EQS."COM").AND.
- (dio'pid'.EQ.dio).AND.(bio'pid'.EQ.bio)

Antonio Vigliotti
Antonio Maria Vigliotti
Jan van den Ende
Honored Contributor

Re: Need DCL help

Antonio,

sorry, but I have to disagree.

John's procedure is entirely correct.

I think you confused the minus-sign with an underscore.

"dio - dio'pid' .eq. 0" is entirely equivalent with
"dio .eq. dio'pid'

The minus-sign in dio-'pid' is not, and can not be, a character in the name of a symbol, but always is the arithmetic "minus" function operator!.

Proost.

Have one on me.

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

Re: Need DCL help

Jan,
you are right. I confused minus with underscore because I don't use this form fo expression.

Thank you!

Antonio Vigliotti
Antonio Maria Vigliotti
James Viswasam
Advisor

Re: Need DCL help

Hi

Andy, I was looking at that lexical and trying to understand it. I will look at the examples from sys$examples.

Hi Hein, thats what I am doing for now, watch mon proc/topc interactively until I put a dcl script in place.

John, thanks a bunch for sharing a DCL command procedure. I was thinking along that lines to get and compare the DIOCNT and BIOCNT. will try to use it as an example since i do not have much time to start monitoring the looping process.

Anotnio/Jan , thanks for your efforts.

All, I am allocating the points and once again thanks for your quick responses.
I will update here with progress or questions.

James Viswasam
Advisor

Re: Need DCL help

John

It works great. I only had to modify it to send page messge and email.

Thanks

James