Quickly Create and Execute Script Execution Tasks

<p class="shortdesc">Through quickly executing (script execution tasks), you can create and execute script execution tasks in batch on multiple hosts.</p> <section class="section context" id="script__context_dy3_1xz_bkb"><div class="tasklabel"><h2 class="doc-tairway">About this task</h2></div> <p class="p">You can manually import scripts, upload scripts from your computer or public platform, or clone existing scripts, and execute them in batch.</p> </section> <section><div class="tasklabel"><h2 class="doc-tairway">Procedure</h2></div><ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd">Log in to the <a class="xref" href="https://pinganyun.com/console/osp" target="_blank">Operation System Platform Console</a>.</span> </li><li class="li step stepexpand" id="script__step_edm_kyj_mlb"> <span class="ph cmd">In the left navigation pane, click <span class="ph menucascade"><span class="ph uicontrol">Job Management </span><abbr title="and then"> > </abbr><span class="ph uicontrol">Fast Execute</span></span>.</span> </li><li class="li step stepexpand"> <span class="ph cmd">On the <span class="keyword wintitle">Fast Execution</span> page, select <span class="ph uicontrol">Script execution</span> as the <span class="ph uicontrol">Task Type</span>.</span> <div class="itemgroup info"> <img class="image" id="script__image_kmh_sdl_bkb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20201407174751-1fb81a739c67.png"> </div> </li><li class="li step stepexpand" id="script__step_vk2_vxz_bkb"> <span class="ph cmd">After that, you need to complete the following configuration.</span> <div class="itemgroup info"> <img class="image" id="script__image_k3n_ydl_bkb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20201407174751-1278e9659166.png"> <table class="table frame-all" id="script__table_gjj_zdl_bkb"><caption></caption><colgroup><col style="width:34.01360544217687%"><col style="width:65.98639455782312%"></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="script__table_gjj_zdl_bkb__entry__1">Configuration Item</th> <th class="entry" id="script__table_gjj_zdl_bkb__entry__2">Description</th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__1 "> <p class="p"><span class="ph uicontrol">Task Name</span></p> </td> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__2 "> <p class="p" id="script__p_hvg_3hr_bkb">About the script execution task name.</p> </td> </tr> <tr class="row"> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__1 "> <p class="p"><span class="ph uicontrol">Task Description</span></p> </td> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__2 "> <p class="p" id="script__p_r2l_3hr_bkb">About the script execution task description.</p> </td> </tr> <tr class="row"> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__1 "> <p class="p"><span class="ph uicontrol">Script type</span></p> </td> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__2 "> <p class="p" id="script__p_c3q_3hr_bkb">Select the script type according to the host type: </p> <ul class="ul" id="script__ul_hz1_hjt_bkb"> <li class="li">If the host is of <strong class="ph b">Linux</strong> system, select <span class="ph uicontrol">Shell</span> as the script type. </li> <li class="li">If the host is of <strong class="ph b">Windows</strong> system, select <span class="ph uicontrol">PowerShell</span> as the script type. </li> </ul> </td> </tr> <tr class="row"> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__1 "> <p class="p"><span class="ph uicontrol">Target host</span></p> </td> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__2 "> <div class="p" id="script__p_cqz_pgl_bkb">Select the hosts on which the scripts will be executed. (The corresponding OS type of Hosts will be filtered with selected scripts. Linux hosts can be chosen with Shell script, and Windows hosts can be chosen with PowerShell script). Currently, there are two methods for selecting hosts: <ul class="ul" id="script__ul_kyt_4gl_bkb"> <li class="li"> <p class="p"><strong class="ph b">Method One: Select Host</strong></p> <p class="p">Click <span class="ph uicontrol">+Select host</span>. On the <span class="keyword wintitle">Select host</span> page that opens, tick one or more hosts, and then click <span class="ph uicontrol">Select</span>.</p> <img class="image" id="script__image_vpq_hkt_bkb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20201407174751-14a9185093a4.png" width="500"> </li> <li class="li"> <p class="p"><strong class="ph b">Method Two: Import Host</strong></p> <p class="p">Click <span class="ph uicontrol">Fast Import</span>. In the <span class="ph uicontrol">Host List</span> field, enter host names or IP addresses, and then click <span class="ph uicontrol">Host match</span>. If the matches succeed, click <span class="ph uicontrol">Confirm</span>.</p> <div class="note note note_note"><span class="note__title">Note:</span> Type in IP or Host Name, separated by comma(,), semicolon(;), vertical bar(|), or line break( ).</div> <img class="image" id="script__image_p5l_tkt_bkb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20201407174751-136848aa92e8.png" width="500"> </li> </ul></div> </td> </tr> <tr class="row"> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__1 "> <p class="p"><span class="ph uicontrol">Script source</span></p> </td> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__2 "> <p class="p">Four methods are supported currently: </p> <ul class="ul" id="script__ul_obg_j2l_bkb"> <li class="li"><span class="ph uicontrol">Manual Input</span>: Write a script in the script creator.</li> <li class="li"><span class="ph uicontrol">Local Upload</span>: According to the script type, select a script file from your computer and add the script content to the creator.<div class="note note note_note"><span class="note__title">Note:</span> The maximum size of the script file is 30K. </div></li> <li class="li"><span class="ph uicontrol">Script Clone</span>: Select one of your scripts and add the content to the creator.</li> <li class="li"><span class="ph uicontrol">Public Script</span>: Select one of the scripts provided by public platform and add the content to the creator.</li> </ul> </td> </tr> <tr class="row"> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__1 "> <p class="p"><span class="ph uicontrol">Script content</span></p> </td> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__2 "> <p class="p" id="script__p_pkk_jhr_bkb">The specific content of the script executed on the host. </p> <div class="note note note_note" id="script__note_m14_rkr_dkb"><span class="note__title">Note:</span> The content cannot exceed 30000 characters. </div> </td> </tr> <tr class="row"> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__1 "> <p class="p"><span class="ph uicontrol">Script parameter</span></p> </td> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__2 "> <p class="p">Click <span class="ph uicontrol">Execute now</span>, and then the script content will be saved as a file in the system and is executed via Powershell, CMD or Bash based on the operating system. The script parameters will be appended to the actually executed command.</p> <p class="p">For example, suppose the script is named as <code class="ph codeph">abc.ps1</code> and is executed via Powershell, and the script parameters are <code class="ph codeph">key1=value1,key2=value2</code>, then the command finally executed in the target server is <code class="ph codeph">powershell -File abc.ps1 key1=value1 key2=value2</code>. </p> </td> </tr> <tr class="row"> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__1 "> <p class="p"><span class="ph uicontrol">Overtime </span></p> </td> <td class="entry" headers="script__table_gjj_zdl_bkb__entry__2 "> <p class="p" id="script__p_dhs_h3l_bkb">Set up the overtime of task execution. If the process exceeds the set time, CloudAgent will end the progress. Use minute as the unit and the time range is between one minute to 30 minutes. If the setup is left blank, the overtime by default will be 30 minutes. </p> </td> </tr> </tbody></table> </div> </li><li class="li step stepexpand"> <span class="ph cmd">After finishing the configuration, click <span class="ph uicontrol">Execute now</span>.</span> <div class="itemgroup info"> <div class="p" id="script__p_pmr_f3q_dkb"> <div class="note note note_note"><span class="note__title">Note:</span> If you click <span class="ph uicontrol">Save as</span>, the task will be saved in the <span class="ph uicontrol">Task Management</span>.</div> </div> </div> </li></ol></section> <section class="section result" id="script__result_edz_mfl_bkb"><div class="tasklabel"><h2 class="doc-tairway">Results</h2></div> <p class="p">After you click “Execute now”, the system will jump to the script <span class="keyword wintitle">Execution Details</span> page. You can see the <span class="ph uicontrol">Task Overview</span> and the <span class="ph uicontrol">Machine execution list</span>.</p> <div class="p"> <img class="image" id="script__image_ftl_hjq_dkb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20201407174751-191be2719493.png" width="800"> </div> </section>
Did the above content solve your problem? Yes No
Please complete information!

Call us

400-151-8800

Email us

cloud@pingan.com

Online customer service

Instant reply

Technical Support

cloud products