<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Interactive script in IMC</title>
    <link>https://community.hpe.com/t5/imc/interactive-script/m-p/7072796#M5649</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Not exactly - but you can use the feature "Response prompt" feature in the scripts to essentially expect certain output (success or error output), and have the script act differently depending on which success or error output is received.&lt;/P&gt;&lt;P&gt;Here is a description of response prompt from the iMC in-context help:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Successful Prompt&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;means the command run successfully and continuing next command only if the device's echo information matches the prompt. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Error Prompt&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;means the command run failed and exit when the device's echo information matches the error prompt. In the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Advanced Mode&lt;/STRONG&gt;, the default mode is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Successful Prompt&lt;/STRONG&gt;, the "!" means&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Error Prompt&lt;/STRONG&gt;. For example, the string "dis acl number ^|^ acl" indicates a successful prompt of "acl", whereas the string "dis acl number ^|^ !acl" indicates an error prompt of "acl".&lt;/LI&gt;&lt;LI&gt;To specify only a prompt for a line, input the prompt content and ^|^. For example [device]^|^. To specify only command for a line, input the content of the command directly.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There's also a detailed tip when creating a CLI Script:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HPE Intelligent Management Center Variables.png" style="width: 20000px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/113214i5DC647BF71DA5FC3/image-size/large?v=v2&amp;amp;px=2000" role="button" title="HPE Intelligent Management Center Variables.png" alt="HPE Intelligent Management Center Variables.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So response prompt is essentially like creating an "if" statement. The programming equivalent of "while"/"for" shouldn't be needed, as you can simply deploy the CLI script on many devices at once, and either adjust the variables on a per-device basis or run the exact same commands on all devices.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jun 2021 11:50:20 GMT</pubDate>
    <dc:creator>jguse</dc:creator>
    <dc:date>2021-06-29T11:50:20Z</dc:date>
    <item>
      <title>Interactive script</title>
      <link>https://community.hpe.com/t5/imc/interactive-script/m-p/7071890#M5627</link>
      <description>&lt;P&gt;Hello ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would like to know if it was possible to create interactive scripts with iMC. For example, when I run the script, it asks me the hostname, the IP address ... of the switch that I have to write.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is it possible ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 10:51:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/imc/interactive-script/m-p/7071890#M5627</guid>
      <dc:creator>Chuv</dc:creator>
      <dc:date>2019-12-05T10:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive script</title>
      <link>https://community.hpe.com/t5/imc/interactive-script/m-p/7072222#M5632</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Indeed, iMC supports interactive CLI Scripts. These will be run via Telnet/SSH on the devices of your choosing, and the commands they run can contain variables, which you would fill out during deployment of the script.&lt;/P&gt;&lt;P&gt;CLI Scripts can be created via &lt;STRONG&gt;Service &amp;gt; Configuration Center &amp;gt; Configuration Templates&lt;/STRONG&gt;. Create a new CLI script and replace the parts of the commands where you would like to use variables with ${variable-name} such as the following example for ProCurve/ArubaOS:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;configure

vlan ${vlan-id}

ip address ${vlan-ip-address}

name ${vlan-name}

exit

write memory&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you deploy the script, it will prompt you to fill out these variables, which can be filled out with separate or combined values for individual or multiple devices.&lt;/P&gt;&lt;P&gt;Hope that helps. Let me know if you have any further questions.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:12:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/imc/interactive-script/m-p/7072222#M5632</guid>
      <dc:creator>jguse</dc:creator>
      <dc:date>2021-06-24T14:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive script</title>
      <link>https://community.hpe.com/t5/imc/interactive-script/m-p/7072567#M5643</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I have another question. Is it possible to make loops (when, for, if)?&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 12:29:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/imc/interactive-script/m-p/7072567#M5643</guid>
      <dc:creator>Chuv</dc:creator>
      <dc:date>2019-12-11T12:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Interactive script</title>
      <link>https://community.hpe.com/t5/imc/interactive-script/m-p/7072796#M5649</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Not exactly - but you can use the feature "Response prompt" feature in the scripts to essentially expect certain output (success or error output), and have the script act differently depending on which success or error output is received.&lt;/P&gt;&lt;P&gt;Here is a description of response prompt from the iMC in-context help:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Successful Prompt&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;means the command run successfully and continuing next command only if the device's echo information matches the prompt. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Error Prompt&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;means the command run failed and exit when the device's echo information matches the error prompt. In the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Advanced Mode&lt;/STRONG&gt;, the default mode is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Successful Prompt&lt;/STRONG&gt;, the "!" means&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Error Prompt&lt;/STRONG&gt;. For example, the string "dis acl number ^|^ acl" indicates a successful prompt of "acl", whereas the string "dis acl number ^|^ !acl" indicates an error prompt of "acl".&lt;/LI&gt;&lt;LI&gt;To specify only a prompt for a line, input the prompt content and ^|^. For example [device]^|^. To specify only command for a line, input the content of the command directly.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There's also a detailed tip when creating a CLI Script:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HPE Intelligent Management Center Variables.png" style="width: 20000px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/113214i5DC647BF71DA5FC3/image-size/large?v=v2&amp;amp;px=2000" role="button" title="HPE Intelligent Management Center Variables.png" alt="HPE Intelligent Management Center Variables.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So response prompt is essentially like creating an "if" statement. The programming equivalent of "while"/"for" shouldn't be needed, as you can simply deploy the CLI script on many devices at once, and either adjust the variables on a per-device basis or run the exact same commands on all devices.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 11:50:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/imc/interactive-script/m-p/7072796#M5649</guid>
      <dc:creator>jguse</dc:creator>
      <dc:date>2021-06-29T11:50:20Z</dc:date>
    </item>
  </channel>
</rss>

