Commands

Note: Sample job to understand the commands and execution

Job Name: AUTOSYS_INFO_SAMPLE_JOB


➤ Job States and Status :

AutoSys keeps track of the current state, or status, of every job. The value of a job’s status is used to determine when to start other jobs that are dependent on the job. The job status is displayed in the job report generated by the autorep command, and in the job report you can view in the Job Activity Console

 Job status abbreviations

INACTIVE: 
The job has not yet been processed. Either the job has never been run, or its status was intentionally altered to “turn off” its previous completion status.
ACTIVATED:
The top-level box that this job is in is now in the RUNNING state, but the job itself has not started yet.
STARTING: 
The event processor has initiated the start job procedure with the Remote Agent.
RUNNING: 
The job is running. If the job is a box job, this value simply means that the jobs within the box may be started (other conditions permitting). If it is a command or file watcher job, the value means that the process is actually running on the remote machine.
SUCCESS: 
The job exited with an exit code equal to or less than the “maximum exit code for success.” By default, only the exit code “0” is interpreted as “success.” If the job is a box job, this value means that all the jobs within the box have finished with the status SUCCESS (the default), or the “Exit Condition for Box Success” evaluated to true
FAILURE: 
The job exited with an exit code greater than the “maximum exit code for success.” By default, any number greater than zero is interpreted as “failure.” AutoSys issues an alarm if a job fails
TERMINATED: 
The job terminated while in the RUNNING state. A job can be terminated if a user sends a KILLJOB event or if it was defined to terminate if the box it is in failed. If the job itself fails, it has a FAILURE status, not a TERMINATED status. A job may also be terminated if it has exceeded the maximum run time (term_run_time attribute, if one was specified for the job), or if it was killed from the command line through a UNIX kill command. AutoSys issues an alarm if a job is terminated.
RESTART: 
The job was unable to start due to hardware or application problems, and has been scheduled to restart.
QUE_WAIT: 
The job can logically run (that is, all the starting conditions have been met), but there are not enough machine resources available.
ON_HOLD: 
This job is on hold and will not be run until it receives the JOB_OFF_HOLD event.
ON_ICE: 
This job is removed from all conditions and logic, but is still defined to AutoSys. Operationally, this condition is like deactivating the job. It will remain on ice until it receives the JOB_OFF_ICE event. 



➤ To check the status of JOB

    autorep -j AUTOSYS_INFO_SAMPLE_JOB

➤ To check only the status of box

    autorep -j AUTOSYS_INFO_SAMPLE_JOB -lo

➤To get the jil of main Box

    autorep –j AUTOSYS_INFO_SAMPLE_JOB -qlo

➤ To get the jil of all boxes/Child Job inside the box

    autorep –j AUTOSYS_INFO_SAMPLE_JOB -q

➤ To check the dependency of job

         job_depends –cJ AUTOSYS_INFO_SAMPLE_JOB

 To check the Information for past job runs 

         autorep –J AUTOSYS_INFO_SAMPLE_JOB –r –1    

Note: Change the last number to get the history run details -2, -3, -4 so on.

➤ Executes a specified job via the scheduler, means it will check the conditions before going to RU state.

    sendevent –E STARTJOB –J AUTOSYS_INFO_SAMPLE_JOB


Start a specified job regardless of starting conditions of previous job

    sendevent –E FORCE_STARTJOB –J AUTOSYS_INFO_SAMPLE_JOB

To KILL or TERMIANTE a specified job

    sendevent –E KILLJOB –J AUTOSYS_INFO_SAMPLE_JOB 

Command to put job ON_HOLD

    sendevent –E JOB_ON_HOLD –J AUTOSYS_INFO_SAMPLE_JOB

Command to OFF_HOLD/Release the job

    sendevent –E JOB_OFF_HOLD –J AUTOSYS_INFO_SAMPLE_JOB

Command to put job ON_ICE 

    sendevent –E JOB_ON_ICE –J AUTOSYS_INFO_SAMPLE_JOB

Command to OFF_ICE the job

    sendevent –E JOB_OFF_ICE –J AUTOSYS_INFO_SAMPLE_JOB

➤ Command to change the job STATUS

    sendevent –E CHANGE_STATUS –s SUCCESS –J AUTOSYS_INFO_SAMPLE_JOB

Other status: RUNNING, FAILURE, TERMINATED, INACTIVE, ACTIVE.

➤ Command to set Global Variable (GV) in the Database.

    sendevent –E SET_GLOBAL –G “global_name=value”

    Value: UP Or Down
    UP   - Application is UP and running fine
    DOWN - Application is down or GV is down to support activities 

➤ This command is used to get the machine report. This gives the lists the machine’s max load, current load, and factor. To report for all the machines use ALL option.

    autorep –M <machine_name>



No comments:

Post a Comment