Previous Topic: Sample ApplicationNext Topic: Other Examples


Monitor Examples

Various monitoring job types are available with the CA WA System Agent. They monitor resources on the operating environment where the agent is executing. For selected monitors, you can monitor another IP address. You can monitor the CPU usage, a disk drive usage, an IP address, processes, and selected logs. CA WA CA 7 Edition submits these jobs. When the condition is met, the job ends when the keyword WAITMODE WAIT is coded. For immediate feedback, WAITMODE NOW tests for the condition and the job succeeds if the condition is met, or fails if the condition is not met.

Note: For WAITMODE WAIT job types, the CA 7 job number is active to that job until the condition is met. Thus, the CA 7 job number is not available for other jobs being attached to the request queue.

In the preceding FTP example, FTP uses port 21 and thus that port must be active before FTP using it for data transmission. If port 21 is not available, raise the attention of the operations staff. The following is a job that verifies port 21 is available before trying an FTP job:

------------------------- CA-7 Agent Job Definition -------------------- Function: LIST (Add, DD, Delete, Format, List, Purge, Update) Job: AGQIP001 System: TESTAPP JOBNET: Owner: UID: 0 Agent Job Type: IP_MON Agent: WINA User: USERA Parmlib: &TESTJCL Member: AGQIP001 Use-Ovrd-Lib: N EXEC: Y Hold: N Verify: N DRClass: ARFSET: Satisfaction Lead Time: 0 WLBClass: A WLBPRTY: 000 Clock Time: 0000 Don't Schedule Before: 00000 0000 After: 99999 0000 LTERM: MASTER Prompt: Y Rqmt List: Y Rqmts Not Used: Y

The following are parameters to verify that IP port 21 is active:

IPADDRESS 999.99.9.999
IPPORT 21
STATUS RUNNING NOW    
WAITMODE NOW          

If the port is stopped, the job fails (back into the request queue) and the status returned indicates the fact:

LQ,JOB=416,LIST=ALL LIST=ALL CA-7#=0416 DATE=yy.ddd PAGE 0001 JOB QUEUE CA-7 -DAY(DDD) AND TIME(HHMM)-- CPU SCH ENTRY MSTR JOB NAME NAME JOB# DEADLINE SUB/START DUE-OUT SPEC/RUN ID MODE REQ STATUS AGQIP001 REQ 0416 ddd/hhmm ddd/hhmm ddd/hhmm OMIP-AGJ 001 DEMD 001 R-C0001 --------------------------- JOB INFORMATION --------------------------- . USER HAS ACKNOWLEDGED PROMPT . SYSTEM NAME = TESTAPP . DRCLASS = **NONE** . AGENT: EROCAGENT ------------------------- REQUIREMENTS STATUS ------------------------- _______ JOB RESTART REQUIRED -------------------------- AGENT INFORMATION -------------------------- Job Type: IP_MON JobNo: Agent: EROCAGENT Status: FAILED Ping 999.99.9.999.21 is stopped User:

If the job completes, the indicated port is active, and any triggered jobs (such as the FTP job) are submitted for execution. Verify the status using the command AGFILE,JOB=AGQIP001,TYPE=INFO (or the IN line command from the AGFILE,JOB=AGQIP001,LIST=ALL command):

----------------- CA-7 Job INFO For Agent EROCAGENT --------- Jobname: AGQIP001 CA7#: 0416 System: TESTAPP SchId: 0001 Q-DtTm: yyddd hhmm Job Type: IP_MON Agent: WINA Host: HOST-NAME-LOCATION STATUS: Ping 99.999.9.999.21 is running

Perhaps there is a process that an application must have stopped before it can submit some “job” to execute. The application can help ensure that the process is stopped by setting up a process monitor job.

------------------------- CA-7 Agent Job Definition --------------------- Function: LIST (Add, DD, Delete, Format, List, Purge, Update) Job: JOBPM System: TESTAPP JOBNET: Owner: UID: 0 Agent Job Type: PROCESS_MON Agent: UNIXA User: Parmlib: &TESTJCL Member: JOBPM Use-Ovrd-Lib: N EXEC: Y Hold: N Verify: N DRClass: ARFSET: Satisfaction Lead Time: 0 WLBClass: A WLBPRTY: 000 Clock Time: 0001 Don't Schedule Before: 00000 0000 After: 99999 0000 LTERM: MASTER Prompt: Y Rqmt List: Y Rqmts Not Used: Y

The control language (parameters) includes the following:

PROCESS abcApplication
STATUS STOPPED NOW     

The job completes successfully when the process is not currently executing. This can be verified through the AGFILE,JOB=JOBPM,TYPE=INFO command:

----------------- CA-7 Job INFO For Agent UNIXA --------- Jobname: JOBPM CA7#: 1419 System: TESTAPP SchId: 0001 Q-DtTm: yyddd hhmm Job Type: PROCESS_MON Agent: UNIXA Host: HOST-UNIXA STATUS: Process abcApplication is stopped

Note: For more information about monitoring jobs, see the CA Integrated Agent Services User Guide.