添加脚本
<p class="shortdesc">您可以将一些常用的脚本及命令添加到OSP中,方便您的管理及调用。</p>
<section class="section context" id="addscript__context_bml_nw3_dkb"><div class="tasklabel"><h2 class="doc-tairway">背景信息</h2></div>
<p class="p">用脚本执行功能,可实现批量执行某类操作,例如变更主机的配置信息(如主机名称、IP地址等)。通过添加脚本的功能,您可以将一些常用配置脚本添加至系统中。</p>
</section>
<section><div class="tasklabel"><h2 class="doc-tairway">操作步骤</h2></div><ol class="ol steps"><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>
</li><li class="li step stepexpand">
<span class="ph cmd">在<span class="keyword wintitle">添加脚本</span>页面,完成如下配置。</span>
<div class="itemgroup info">
<img class="image" id="addscript__image_q3p_bhr_bkb" src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20201407174753-1d0a828c937a.png" width="600">
<table class="table frame-all" id="addscript__table_ucs_chr_bkb"><caption></caption><colgroup><col style="width:24.87562189054727%"><col style="width:75.12437810945275%"></colgroup><thead class="thead">
<tr class="row">
<th class="entry" id="addscript__table_ucs_chr_bkb__entry__1">配置项</th>
<th class="entry" id="addscript__table_ucs_chr_bkb__entry__2">说明</th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry" headers="addscript__table_ucs_chr_bkb__entry__1 ">
<p class="p"><span class="ph uicontrol">脚本名称</span></p>
</td>
<td class="entry" headers="addscript__table_ucs_chr_bkb__entry__2 ">
<p class="p">关于该脚本执行任务的名称。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="addscript__table_ucs_chr_bkb__entry__1 ">
<p class="p"><span class="ph uicontrol">描述</span></p>
</td>
<td class="entry" headers="addscript__table_ucs_chr_bkb__entry__2 ">
<p class="p">关于该脚本执行任务的描述。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="addscript__table_ucs_chr_bkb__entry__1 ">
<p class="p"><span class="ph uicontrol">脚本类型</span></p>
</td>
<td class="entry" headers="addscript__table_ucs_chr_bkb__entry__2 ">
<p class="p">根据主机类型选择脚本类型:</p>
<ul class="ul" id="addscript__ul_ixy_5kr_dkb">
<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="addscript__table_ucs_chr_bkb__entry__1 ">
<p class="p"><span class="ph uicontrol">脚本内容</span></p>
</td>
<td class="entry" headers="addscript__table_ucs_chr_bkb__entry__2 ">
<p class="p">在主机执行的脚本的具体内容。</p>
<div class="note note note_note"><span class="note__title">说明:</span> 所填写内容不能超过30000字符。</div>
</td>
</tr>
</tbody></table>
</div>
</li><li class="li step stepexpand">
<span class="ph cmd">完成后,单击<span class="ph uicontrol">保存</span>。</span>
</li></ol></section>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!