如何在CA工作负载自动化AE(autosys)中查询作业信息?

时间:2017-01-18 06:34:07

标签: autosys workload

我来到一家新公司,它使用CA工作负载自动化AE(也称为autosys)来运行作业,但没有关于配置的文档。 我的第一步是找出服务器上运行的作业数量,每个作业的主题以及这些作业的运行方式。 我是新手使用autosys,我学会了解它有一个存储元数据的数据库(工作信息,日志等)。但我不知道如何连接到这个数据库。 有人知道这个数据库的默认设置吗?我想安装autosys的人大多使用默认设置。 任何帮助将不胜感激!

2 个答案:

答案 0 :(得分:0)

如果您有Unix访问权限 autorep -j job_name_pattern%| wc -l;

如果您通过URL访问,当您在QVIEW中搜索job_name_pattern%时,它应列出所有作业。

注意:对于每个应用程序,所有autosys作业都可以/应该遵循相同的命名模式,例如从APP id开始 123_JobA 123_JobB 123_Jo

答案 1 :(得分:0)

我编写了以下ksh脚本来展平任何JIL文件并添加执行状态信息,您可以修改它以执行您想要的任何任务。

#!/usr/bin/ksh

# unix scprit to flatten autorep -q

resetVar()
{
    AIF=""
    AD=""
    AH=""
    BF=""
    BN=""
    BS=""
    BT=""
    COM=""
    COD=""
    DC=""
    DOW=""
    DES=""
    EC=""
    IJ=""
    JL=""
    JT=""
    MAC=""
    MES=""
    MRA=""
    NR=""
    OWN=""
    PER=""
    PRI=""
    PRO=""
    RC=""
    RW=""
    SM=""
    ST=""
    SEF=""
    SOF=""
    TRT=""
    WF=""
    WFMS=""
    WI=""
    LSD=""
    LST=""
    LED=""
    LET=""
    STA=""
    RUN=""
}


writePartToFile()
{
 echo "$AIF;$AD;$AH;$BF;$BN;$BS;$BT;$COM;$COD;$DC;$DOW;$DES;$EC;$IJ;$JL;$JT;$MAC;$MES;$MRA;$NR;$OWN;$PER;$PRI;$PRO;$RC;$RW;$SM;$ST;$SEF;$SOF;$TRT;$WF;$WFMS;$WI" >> $TO_TPM
 #echo "$AIF;$AD;$AH;$BF;$BN;$BS;$BT;$COM;$COD;$DC;$DOW;$DES;$EC;$IJ;$JL;$JT;$MAC;$MES;$MRA;$NR;$OWN;$PER;$PRI;$PRO;$RC;$RW;$SM;$ST;$SEF;$SOF;$TRT;$WF;$WFMS;$WI" 
 resetVar

}

JOB_NAME="flatten JIL"
part1=""
part2=""


#---------------------------------
if test "$1." = "."
then
   echo "Missing first parameter (jil file to flatten)"; 
   exit 1;
fi

if test "$2." = "."
then
   echo "Missing second parameter (resulting flat file)";
 exit 1;
fi

TO_FLATTEN=$1
TO_RESULT=$2
CLE_FILE="lesCles"
CLE_TMP="lesClesTmp"
TO_TPM="tempFichier"
TO_STATUS="statusFichier"

rm $TO_RESULT
rm $CLE_TMP
rm $CLE_FILE
rm $TO_TPM
rm $TO_STATUS



echo 'alarm_if_fail;auto_delete;auto_hold;box_failure;box_name;box_success;box_terminator;command;condition;date_conditions;days_of_week;description;exclude_calendar;insert_job;job_load;job_terminator;machine;max_exit_success;max_run_alarm;n_retrys;owner;permission;priority;profile;run_calendar;run_window;start_mins;start_times;std_err_file;std_out_file;term_run_time;watch_file;watch_file_min_size;watch_interval;last_start_date;last_start_time;last_end_date;last_end_time;status;run' >> $TO_RESULT;
 while read line; do    
    if test "${line#*:}" != "$line"
    then        
      cle="$(echo "$line" | cut -d":" -f 1)"
      #echo "cle = $cle"
      part2="$(echo "$line" | cut -d":" -f 2)"   
      #echo "part2 = $part2"        
      val="$(echo "$part2" | cut -d" " -f 2)"
      #echo "val = $val"    
    fi  
    if test "$cle" = "insert_job"
    then
    #on n'est sur la premiere ligne
        if test "$IJ." = "."
        then
            ;                           
        else          
            if test "$BN." = "."
            then             
             echo $IJ >> $CLE_TMP
            else
             echo $BN >> $CLE_TMP
            fi      
            writePartToFile         
        fi
        IJ=$val
        JT="$(echo "$line" | cut -d":" -f 3)"                   
    else    
    #on n est pas sur le premiere ligne 
        val=$part2
        case $cle in
            alarm_if_fail) AIF=$val;;
            auto_delete) AD=$val;;
            auto_hold) AH=$val;;
            box_failure) BF=$val;;
            box_name) BN=$val;;
            box_success) BS=$val;;
            box_terminator) BT=$val;;
            command) COM=$val;;
            condition) COD=$val;;
            date_conditions) DC=$val;;
            days_of_week) DOW=$val;;
            description) DES=$val;;
            exclude_calendar) EC=$val;;
            insert_job) IJ=$val;;
            job_load) JL=$val;;
            job_terminator) JT=$val;;
            machine) MAC=$val;;
            max_exit_success) MES=$val;;
            max_run_alarm) MRA==$val;;
            n_retrys) NR=$val;;
            '#owner') OWN=$val;;
            permission) PER=$val;;
            priority) PRI=$val;;
            profile) PRO=$val;;
            run_calendar) RC=$val;;
            run_window) RW=$val;;
            start_mins) SM=$val;;
            start_times) ST=$val;;
            std_err_file) SEF=$val;;
            std_out_file) SOF=$val;;
            term_run_time) TRT=$val;;
            watch_file) WF=$val;;
            watch_file_min_size) WFMS=$val;;
            watch_interval) WI=$val;; 
        esac        
    fi

done  < $TO_FLATTEN;
#Traiter derniere occurence
if test "$BN." = "."
then
    echo $IJ >> $CLE_TMP
else
    echo $BN >> $CLE_TMP
fi      
writePartToFile     

echo "Les cles"
cat $CLE_TMP | sort | uniq > $CLE_FILE
cat $CLE_FILE
rm $CLE_TMP

#------------------------------
 while read line; do        
    autorep -J ${line} -w  >> $TO_STATUS;   
done  < $CLE_FILE;
#----------------------------------------
echo " Resultats"
while read line; do
unJob="$(echo "$line" | cut -d";" -f 14)"
details="$(grep -w  "$unJob" "$TO_STATUS" | head -n 1)" 
LSD="$(echo "$details" | awk '{print $2}')"
if test "$LSD" = "-----"
then
    LST=""
    LED="$(echo "$details" | awk '{print $3}')"
    if test "$LED" = "-----"
    then
        LET=""
        STA="$(echo "$details" | awk '{print $4}')"
        RUN="$(echo "$details" | awk '{print $5}')"
    else
        LET="$(echo "$details" | awk '{print $4}')"
        STA="$(echo "$details" | awk '{print $5}')"
        RUN="$(echo "$details" | awk '{print $6}')"
    fi
else
    LST="$(echo "$details" | awk '{print $3}')"
    LED="$(echo "$details" | awk '{print $4}')"
    if test "$LED" = "-----"
    then
        LET=""
        STA="$(echo "$details" | awk '{print $5}')"
        RUN="$(echo "$details" | awk '{print $6}')"
    else
        LET="$(echo "$details" | awk '{print $5}')"
        STA="$(echo "$details" | awk '{print $6}')"
        RUN="$(echo "$details" | awk '{print $7}')"
    fi
fi

echo " ligne= ${line};${LSD};${LST};${LED};${LET};${STA};${RUN}"
echo "${line};${LSD};${LST};${LED};${LET};${STA};${RUN}" >> $TO_RESULT
resetVar
done  < $TO_TPM;