2008/11/28

Autosys Command line

CA Autosys Command Line

1. autoflags
2. autoping
3. autorep
4. autosyslog
5. chase
6. chk_auto_up
7. clean_file
8. jil
9. cron2jil
10. job_depends
11. monbro
12. sendevent
13. autosys_secure
14. autobcp


Change DBMAINT time
Check if DBMAINT processed



1. autoflags
Usage: autoflags -aiodvxrhn
a -- ALL information
i -- tape id #
o -- operating system
d -- database
v -- AutoSys version #
x -- AutoSys full version #
r -- AutoSys release #
h -- hostid
n – hostname

Command description
To show autosys information such as version, hostname, database


Example
$ autoflags –a
G1 SOLAR SYB 4.5 0 83f842c5 kcscws90


2. autoping
Usage: autoping <-m machineALL> [-A] [-D]
where: machine is the machine to ping, or 'ALL' for ALL machines
-D = check the Database connections on that machine
-A = Send an ALARM if there are problems.

Command description
To verify that server and client machine are properly configured and are communicating
successfully

Example
$ autoping –m kcsinp41 –D
AutoPinging Machine [kcsinp41] AND checking the Remote Agent's DB Access.
AutoPing WAS SUCCESSFUL!


3. autorep
Usage: [-J JobName] <-d -s -q -o [OverRide #] -w>
[-r run_num] [-L Print Level] [-x]
[-G GlobalName] [-M MachineName] [-D DataServer:DataBase]

Command description
- To list a variety of information about jobs


Example
- show job information

$ autorep –J backup-ca-autosys1-daily
Job Name Last Start Last End ST Run Pri/Xit
____________________________ ____________________ ____________________ __ _______ ___

backup-ca-autosys1-daily 07/10/2008 23:00:09 07/10/2008 23:03:51 SU 1735024/1

- show job detail
$ autorep –J backup-ca-autosys1-daily –q
/* ----------------- backup-ca-autosys1-daily ----------------- */

insert_job: backup-ca-autosys1-daily job_type: c
box_name: BACKUP-CA-DAILY
command: /opt/CA/cabackup/scripts/45expconf2.sh
machine: kcsinp41
owner: autosys@kcsinp41
permission: gx,wx
description: "This job for export configure at AUTOSYS DEVELOPE (kcsinp41)"
std_out_file: /cbs/autosys/log/$AUTO_JOB_NAME.out
std_err_file: /cbs/autosys/log/$AUTO_JOB_NAME.err
alarm_if_fail: 1
profile: /etc/profile

- show job information run 1 day ago ( maximum to 7 days ago)
$ autorep –J backup-ca-autosys1-daily –r -1
- show all jobs
$ autorep –J ALL


4. autosyslog
Usage: autolog [-e -j Job_Name ] [-p]

-e [ monitor (tail -f) the event processor output file. ]
-j job_name [ Inspect the latest remote agent output file for job_name ]
-p Include the output from the environment if available (RemoteProFile)
หรือ [autosys@kcsinp41]$cd $AUTOUSER

[autosys@kcsinp41]$pwd
/opt/CA/UAJM/autouser/out
Tail –f event_demon.D45

Command description
- Being used to view either the event processor log file or the remote agent log file for the
specified job

Example
$ autosyslog -e


Monitoring primary event processor output file:
/opt/CA/UAJM/autouser/out/event_demon.D45

*** To break out type control-c (^c) ***

[10:16:12.0932] [1] [ktbux283 connected for by-pass-report]
[10:16:12.1428] [1] EVENT: CHANGE_STATUS STATUS: STARTING JOB: by-pass-report
[10:16:15.2616] [1] EVENT: CHANGE_STATUS STATUS: RUNNING JOB: by-pass-report
[10:16:26.5451] [1] EVENT: CHANGE_STATUS STATUS: SUCCESS JOB: by-pass-report
[10:16:26.7411] [1] [ktbux283 connected for restore_report_283]
[10:16:27.8023] [1] EVENT: CHANGE_STATUS STATUS: STARTING JOB: restore_report_283
[10:16:29.8942] [1] EVENT: CHANGE_STATUS STATUS: RUNNING JOB: restore_report_283
[10:16:30.9691] [1] EVENT: CHANGE_STATUS STATUS: SUCCESS JOB: restore_report_283
[10:16:31.1797] [1] [ktbux283 connected for by-pass-report]
[10:16:32.2364] [1] EVENT: CHANGE_STATUS STATUS: STARTING JOB: by-pass-report
[10:16:34.3130] [1] EVENT: CHANGE_STATUS STATUS: RUNNING JOB: by-pass-report

5. chase
Usage: [ -A ] [ -E ]
Option
-A Indicates that if chase detects any consistencies ( such as, jobs that should be running, but are not) it sends alarms to RDBMSs
-E Indicates that if ad job and the job’s Remote Agent are not running on the client machine, but the database indicates they should be, chase puts the job in FAILURE status triggering the job to be restarted If the job definition includes the n_retrys attribute

Command description
- To check what job is running at this time


Example
$ chase

Running the Chase Process.
______________________________________________________________________________

______________________________________________________________________________

Checking on Jobs in the STARTING state...

There are NO Jobs that have been in the STARTING state
more than 120 Seconds.

______________________________________________________________________________

Checking on Jobs in the RUNNING state...
______________________________________________________________________________

[ktbux204a connected for ]
______________________________________________________________________________

Examining Job: tmp_ftp_pmt_tlrpmt_cbsgo On Machine: ktbux204a
OK! Both the auto_remote daemon and the job are still running.
______________________________________________________________________________

[ktbux204b connected for ]
______________________________________________________________________________

Examining Job: gl-fms-balance-extract On Machine: ktbux204b
OK! Both the auto_remote daemon and the job are still running.
______________________________________________________________________________

[ktbux283 connected for ]
______________________________________________________________________________

Examining Job: by-pass-report On Machine: ktbux283
OK! Both the auto_remote daemon and the job are still running.
______________________________________________________________________________

Chase is done!

6. chk_auto_up
Command description
- To check status of event processor and event server


Example
$ chk_auto_up

______________________________________________________________________________

Attempting (1) to Connect with Database: AUTOSYSDBD:autosys

*** Have Connected successfully with Database: AUTOSYSDBD:autosys. ***
______________________________________________________________________________

Connected with Event Server: AUTOSYSDBD:autosys

______________________________________________________________________________

______________________________________________________________________________


Checking Machine: kcsinp41
Primary Event Processor is RUNNING on machine: kcsinp41


7. clean_file
Usage: clean_file –d days
-d days
Specify that log files older than the number of days will be removed

Command description
- deletes old Remote Agent log files


Example
- removed log files older than 7 days
$ clean_files –d 7


8. jil
Usage: jil [-q] [-S autoserv_instance] [-V none job batch ]

Command description
- jil is scripting language used to create job definitions


Example
- To used jil command to create job detailed in job_detail.txt

$ more job_detail.txt
/* ----------------- backup-ca-autosys1-daily ----------------- */

insert_job: backup-ca-autosys1-daily job_type: c
box_name: BACKUP-CA-DAILY
command: /opt/CA/cabackup/scripts/45expconf2.sh
machine: kcsinp41
owner: autosys@kcsinp41
permission: gx,wx
description: "This job for export configure at AUTOSYS DEVELOPE (kcsinp41)"
std_out_file: /cbs/autosys/log/$AUTO_JOB_NAME.out
std_err_file: /cbs/autosys/log/$AUTO_JOB_NAME.err
alarm_if_fail: 1
profile: /etc/profile
$ jil < job_detail.txt
$ autorep –J job_detail.txt –q
/* ----------------- backup-ca-autosys1-daily ----------------- */

insert_job: backup-ca-autosys1-daily job_type: c
box_name: BACKUP-CA-DAILY
command: /opt/CA/cabackup/scripts/45expconf2.sh
machine: kcsinp41
owner: autosys@kcsinp41
permission: gx,wx
description: "This job for export configure at AUTOSYS DEVELOPE (kcsinp41)"
std_out_file: /cbs/autosys/log/$AUTO_JOB_NAME.out
std_err_file: /cbs/autosys/log/$AUTO_JOB_NAME.err
alarm_if_fail: 1
profile: /etc/profile

9. cron2jil
usage: cron2jil -f cronFile \
[ -d outputDirectory ] [ -i includeFile ] [ -m machine ] [ -p prefix]
Option
-f crontab_file Specifies the name of crontab formatted file
-d output_directory Specifies the directory to which the *.jil and *.cal should be written. The default is the current working directory
-i include_file Specifies the name of a file containing JIL statements

Command description
- To convert crontab file to a corresponding JIL script (*.jill file)


10. job_depends
Usage: job_depends < -c -d -t > <-J JobName>
[-F From Date/Time (MM/DD/YYYY HH:MM)]
[-T To Date/Time]
[-L Print Level] [-D DataServer:DataBase]
Option
-c Current Condition Status
-d Dependencies Only
-t Time Dependencies

Command description
- show dependencies and conditions of a job


Example
$ job_depends -c -J report-go-convert


Start Dependent
Job Name Status Date Cond? Cond? Jobs?
-------- ------- ---------------- ----- ---------
report-go-convert SUCCESS No Yes Yes

Condition: s(report-go-split)

Atomic Condition Current Status T/F
---------------- -------------- ---
SUCCESS(report-go-split) SUCCESS T

Dependent Job Name Condition
------------------ ---------
report-go-arrangment SUCCESS(re...)
______________________________________________________________________________

11. monbro
Usage: monbro -N name [-P polling frequency] [-D DataServer:DataBase] [-q]
Option
-N name Specifies the name of monitor or report (browser) to be run, you can type ALL for all
-P poll_frequency Applies to monitors only and indicates the time interval (seconds), the default is 10 seconds.

Command Description
- Run monitor or report that has already been defined, using JIL or the monitor/browser editor


Example
$ monbro –N ALL

12. sendevent
Usage: sendevent -E EVENT [-S AUTOSERV] [-A Alarm] [-J JobName]
[-s Status] [-P Event Priority] [-M Max Send Trys ]
[-q Job Que Priority] [-G Global=Value] [-C Comment]
[-U (Un-SENDEVENT)] [-T Time of Event] [-K Signal(s)]
Option
-E event Specifies the event to be sent
STARTJOB à start job
KILLJOB à kill job
DELETEJOB à delete job
FORCE_STARTJOB à force starting job
JOB_ON_ICE à on ice job
JOB_OFF_ICE à off ice job
JOB_ON_HOLD à on hold job
JOB_OFF_HOLD à off hold job
STOP_DEMON à stop event processor
-J job name Specifies job name

Command Description
- To send events for variety of purposes, including starting or stopping jobs


Example
- force starting job named “test_job”
$ sendvent –E FORCE_STARTJOB test_job
- stop event processor
$ sendevent –E STOP_DEMON


13. autosys_secure
AutoSys Security Utility
autosys_secure [-h] [-q] {-a -c -d}
{-u -editu -execu} user@domain_or_host
[-o old password] [-p password] [-host domain_or_host]
-h help
-p new password
-q Run Quietly (No Prints)
-a Add a New User
-c Change an Existing User
-d Delete an Existing User
-u AutoSys user@domain_or_host Required for ALL options
-o old password , Required for -c with -u
-p current password , Required for -d with -u
-p new password , Required for -a and -c with –u

Command description
- Maintain the edit and exec superuser ownership, remote authentication methods and database password


Example
$ autosys_secure
Please select an action to perform:
[1] Administer EDIT/EXEC superusers.
[2] Change AutoSys database password.
[3] Change AutoSys remote authentication method.
[4] Create AutoSys User@Host or Domain password.
[5] Change AutoSys User@Host or Domain password.
[6] Delete AutoSys User@Host or Domain password.
[7] Exit autosys_secure.
[A] Get Encrypted Password for Adapters.


14. autobcp
usage: autobcp source_server target_server dump_file autosys_password [source_db_name target_db_name batch_size bcp_format]

Command description
- To synchronize database by firstly deleting target database and then copy database from source database to target database


Example
$ cd /opt/CA/UAJM/autosys/install
$ ./autobcp AUTOSYSDBP AUTOSYSDBS dump autosys

Sybase database command
1. xql
Usage: xql [ -U ][ -P ][ -S ][ -D ][ -c ][ -f ][ -d ][ -i ][ -I ][ -l ][ -w ][ -T ][ -x ]
************************************************************************************
* [-U user ] Sybase User *
* [-P password ] Sybase Password *
* [-S server ] Sybase Server *
* [-D database ] Database name *
* [-c sqltext ] SQL text to process *
* [-f filename ] file with SQL in it *
* [-d delimiter] output file field delimiter ( default: "" ) *
* [-i ] ISQL compatible output *
* [-I ] ISQL compatible output, with no header *
* [-l ] Long format - columns and values, one to a line. *
* [-w nnn ] Width of output line for -i option *
* [-T nnn ] Interactive xql timeout time in minutes.(-T0 for no exit) *
* [-x ] Version Information

Command description
- access to database


Example
$ xql -Uautosys -Pautosys -D autosys -S AUTOSYSDBS
xql>>[AUTOSYSDBD][autosys] 1>

Change DBMAINT time
$cd /opt/CA/UAJM/autouser
1. $Backup /opt/CA/UAJM/autouser/config.P45 ทั้งเครื่อง kcsinp01 และ kcsinp02
2. แก้ไขเป็นเวลาที่ต้องการ DBMaintTime=hh:mm
3. Recycle EP

Check if DBMAINT processed
$cd /opt/CA/UAJM/autouser/out
$cat DBMaint.out