编辑任务
<p class="shortdesc">您可以对已经创建好的任务修改其相关信息。</p>
<section class="section prereq" id="edittask__prereq_yfl_411_ckb"><div class="tasklabel"><h2 class="doc-tairway">前提条件</h2></div>
<p class="p">已完成脚本执行任务或健康巡检任务的创建。</p>
</section>
<section id="edittask__steps_d5g_x5l_bkb"><div class="tasklabel"><h2 class="doc-tairway">操作步骤</h2></div><ol class="ol steps" id="edittask__steps_d5g_x5l_bkb"><li class="li step stepexpand">
<span class="ph cmd">登录<a class="xref" href="https://pinganyun.com/console/osp" target="_blank">系统管理服务OSP控制台</a>。</span>
</li><li class="li step stepexpand">
<span class="ph cmd">在左侧导航栏中,单击<span class="ph menucascade"><span class="ph uicontrol">作业管理</span><abbr> > </abbr><span class="ph uicontrol">任务管理</span></span>。</span>
</li><li class="li step stepexpand">
<span class="ph cmd">在<span class="keyword wintitle">任务管理</span>页面,找到目标任务,单击<span class="ph uicontrol">操作</span>列的<span class="ph uicontrol">编辑</span>。</span>
<div class="itemgroup info">
<img class="image" id="edittask__image_eyq_r11_ckb" src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20201407174752-17f9399b9cb4.png" width="750">
</div>
</li><li class="li step stepexpand">
<span class="ph cmd">在<span class="keyword wintitle">编辑</span>页面中,对相关信息进行编辑。</span>
<div class="itemgroup info">
<ul class="ul" id="edittask__ul_es2_511_ckb">
<li class="li">
<p class="p"><strong class="ph b">脚本执行任务</strong></p>
<table class="table frame-all" id="edittask__table_o4w_w11_ckb"><caption></caption><colgroup><col style="width:34.01360544217687%"><col style="width:65.98639455782312%"></colgroup><thead class="thead">
<tr class="row">
<th class="entry" id="edittask__table_o4w_w11_ckb__entry__1">配置项</th>
<th class="entry" id="edittask__table_o4w_w11_ckb__entry__2">说明</th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__1 ">
<p class="p"><span class="ph uicontrol">任务名称</span></p>
</td>
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__2 ">
<p class="p" id="edittask__d21e108">关于该脚本执行任务的名称。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__1 ">
<p class="p"><span class="ph uicontrol">任务描述</span></p>
</td>
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__2 ">
<p class="p" id="edittask__d21e124">关于该脚本执行任务的描述。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__1 ">
<p class="p"><span class="ph uicontrol">脚本类型</span></p>
</td>
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__2 ">
<p class="p" id="edittask__d21e140">根据主机类型选择脚本类型:</p>
<ul class="ul" id="edittask__d21e143">
<li class="li">若主机为<strong class="ph b">Linux</strong>类型,则选择脚本类型为<span class="ph uicontrol">Shell</span>。</li>
<li class="li">若主机为<strong class="ph b">Windows</strong>类型,则选择脚本类型为<span class="ph uicontrol">PowerShell</span>。</li>
</ul>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__1 ">
<p class="p"><span class="ph uicontrol">目标机器</span></p>
</td>
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__2 ">
<div class="p" id="edittask__d21e177">设置脚本需要在哪些主机上执行。(根据脚本类型筛选出对应的主机,Shell类型对应Linux主机,PowerShell类型对应Windows主机)。目前支持两种方式选择主机:<ul class="ul" id="edittask__d21e179">
<li class="li">
<p class="p"><strong class="ph b">方式一:选择主机</strong></p>
<p class="p">单击<span class="ph uicontrol">+选择机器</span>,在弹出的<span class="keyword wintitle">主机选择</span>页面中,勾选一个或者多个主机,然后单击<span class="ph uicontrol">选择</span>。</p>
<img class="image" id="edittask__d21e199" src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20201407174751-16a350799ebd.png" width="500">
</li>
<li class="li">
<p class="p"><strong class="ph b">方式二:导入主机</strong></p>
<p class="p">单击<span class="ph uicontrol">快速导入</span>,在<span class="ph uicontrol">主机列表</span>框中,输入主机名称或者IP地址,输入完成后单击<span class="ph uicontrol">主机匹配</span>。匹配无误后,单击<span class="ph uicontrol">确定</span>。</p>
<div class="note note note_note"><span class="note__title">说明:</span> 输入的IP或主机名称,可以用“英文逗号,”、“英文分号;”、“|”或“换行符”将多个主机名进行分隔。</div>
<img class="image" id="edittask__d21e226" src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20201407174751-1ef2ca479d9b.png" width="500">
</li>
</ul></div>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__1 ">
<p class="p"><span class="ph uicontrol">脚本来源</span></p>
</td>
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__2 ">
<p class="p">目前支持四种方式:</p>
<ul class="ul" id="edittask__d21e246">
<li class="li"><span class="ph uicontrol">手工录入</span>:直接在脚本编辑器中,编写脚本。</li>
<li class="li"><span class="ph uicontrol">本地上传</span>:根据脚本类型,选择一个本地计算机的脚本文件,并将脚本内容填充到脚本编辑器中。<div class="note note note_note"><span class="note__title">说明:</span> 脚本文件大小不超过30K。</div></li>
<li class="li"><span class="ph uicontrol">脚本克隆</span>:从您所管理的脚本中,选择一个脚本,将内容填充到脚本编辑器。</li>
<li class="li"><span class="ph uicontrol">公共脚本</span>:从公共平台提供的脚本中,选择一个脚本,将内容填充到脚本编辑器。</li>
</ul>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__1 ">
<p class="p"><span class="ph uicontrol">脚本内容</span></p>
</td>
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__2 ">
<p class="p" id="edittask__d21e285">在主机执行的脚本的具体内容。</p>
<div class="note note note_note" id="edittask__d21e288"><span class="note__title">说明:</span> 所填写内容不能超过30000字符。</div>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__1 ">
<p class="p"><span class="ph uicontrol">脚本参数</span></p>
</td>
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__2 ">
<p class="p">单击<span class="ph uicontrol">立即执行</span>后,系统会把脚本内容保存成一个脚本文件,并根据操作系统使用Powershell、CMD或Bash来执行,脚本参数内的内容会被拼接到实际执行的命令的末尾。</p>
<p class="p">例如,假设脚本名为<code class="ph codeph">abc.ps1</code>并使用Powershell来执行脚本,脚本参数中的内容为<code class="ph codeph">key1=value1,key2=value2</code>,则最终在目标服务器中执行的命令为<code class="ph codeph">powershell
-File abc.ps1 key1=value1 key2=value2</code>。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__1 ">
<p class="p"><span class="ph uicontrol">超时时间</span></p>
</td>
<td class="entry" headers="edittask__table_o4w_w11_ckb__entry__2 ">
<p class="p" id="edittask__d21e335">设置任务执行超时时间,如果超过了设定的时间,CloudAgent会结束任务进程。单位分钟,范围1~30,空设置将默认超时时间为30分钟。</p>
</td>
</tr>
</tbody></table>
</li>
<li class="li">
<p class="p"><strong class="ph b">健康巡检任务</strong></p>
<table class="table frame-all" id="edittask__table_p14_fbp_tkb"><caption></caption><colgroup><col style="width:34.01360544217687%"><col style="width:65.98639455782312%"></colgroup><thead class="thead">
<tr class="row">
<th class="entry" id="edittask__table_p14_fbp_tkb__entry__1">配置项</th>
<th class="entry" id="edittask__table_p14_fbp_tkb__entry__2">说明</th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__1 ">
<p class="p"><span class="ph uicontrol">任务名称</span></p>
</td>
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__2 ">
<p class="p">关于该健康巡检任务的名称。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__1 ">
<p class="p"><span class="ph uicontrol">任务描述</span></p>
</td>
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__2 ">
<p class="p">关于该健康巡检任务的描述。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__1 ">
<p class="p"><span class="ph uicontrol">巡检模板</span></p>
</td>
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__2 ">
<p class="p">单击下拉按钮,按操作系统选择不同的巡检模板。</p>
<p class="p">选择完成后,单击<span class="ph uicontrol">模板详情</span>您可以查看该模板的详细信息。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__1 ">
<p class="p"><span class="ph uicontrol">目标机器</span></p>
</td>
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__2 ">
<ul class="ul" id="edittask__ul_ztn_rgl_bkb">
<li class="li">
<p class="p"><strong class="ph b">方式一:选择主机</strong></p>
<p class="p">单击<span class="ph uicontrol">+选择机器</span>,在弹出的<span class="keyword wintitle">主机选择</span>页面中,勾选一个或者多个主机,然后单击<span class="ph uicontrol">选择</span>。</p>
<img class="image" id="edittask__d21e199" src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20201407174751-16a350799ebd.png" width="500">
</li>
<li class="li">
<p class="p"><strong class="ph b">方式二:导入主机</strong></p>
<p class="p">单击<span class="ph uicontrol">快速导入</span>,在<span class="ph uicontrol">主机列表</span>框中,输入主机名称或者IP地址,输入完成后单击<span class="ph uicontrol">主机匹配</span>。匹配无误后,单击<span class="ph uicontrol">确定</span>。</p>
<div class="note note note_note"><span class="note__title">说明:</span> 输入的IP或主机名称,可以用“英文逗号,”、“英文分号;”、“|”或“换行符”将多个主机名进行分隔。</div>
<img class="image" id="edittask__d21e226" src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20201407174751-1ef2ca479d9b.png" width="500">
</li>
</ul>
</td>
</tr>
<tr class="row">
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__1 ">
<p class="p"><span class="ph uicontrol">超时时间</span></p>
</td>
<td class="entry" headers="edittask__table_p14_fbp_tkb__entry__2 ">
<p class="p">设置任务执行超时时间,如果超过了设定的时间,CloudAgent会结束任务进程。单位分钟,范围1~30,空设置将默认超时时间为30分钟。</p>
</td>
</tr>
</tbody></table>
</li>
</ul>
</div>
</li><li class="li step stepexpand">
<span class="ph cmd">完成后,单击<span class="ph uicontrol">确认创建</span>。</span>
</li></ol></section>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!