0

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

4

2 回答 2

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;
于 2018-01-11T15:59:57.537 回答
0

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

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

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

于 2017-01-21T18:55:22.350 回答