Adapter requests and responses for the Session-based CLI adapter

The following figure shows the adapter request for the Session-based CLI adapter (Microsoft Windows).

Tip

The working-dir command works for the first command in the Session-based approach. After the initial command, if the directory changes, you must use the change directory command (cd ) to alter the directory location.

XML sample of the Session-based CLI adapter request for Windows


<command-request>
  <commands>
    <command working-dir"C:\workdir\bmc" prompt="&gt;" continue-on-failure="false">cd LAP</command>
    <command prompt="&gt;">cmd.exe</command>
    <command prompt="&gt;">copy *.cer C:\workdir\bmc</command>
    <command prompt="Certs&gt;">dir</command>
  </commands>
</command-request>

Note

Starting with the 20.12.02 release, the Session-based CLI adapter can also execute a request when the adapter is enabled on a peer that is compliant with the Internet Protocol version 6 (IPv6).

The following figure shows the adapter request for the Session-based CLI adapter for command group (Windows).

XML sample of the Session-based CLI adapter request for Command Group for Windows


<command-request>
  <commands>
   <command prompt="&gt;">cmd.exe</command>
   <command-group prompt="&gt;">  
   <command>cd C:\server123</command>
   <command>cd C:\logs</command>
   <command>cd C:\Certs</command>
   <command>copy *.cer C:\server123</command>
   <command>dir</command>
   </command-group>
  </commands>
</command-request>


The following figure shows the adapter request for the Session-based CLI adapter for persistent connectivity (Windows).

XML sample of the Session-based CLI adapter request with persistent connectivity for Windows


<command-request>
    <connection>
        <name>my_named_connection</name>
        <terminate-on-exit>false</terminate-on-exit>
    </connection>
    <commands>
        <command working-dir"C:\workdir\bmc" prompt="&gt;" continue-onfailure="false">cd LAP</command>
        <command prompt="&gt;">cmd.exe</command>
        <command prompt="&gt;">copy *.cer C:\workdir\bmc</command>
        <command prompt="Certs&gt;">dir</command>
    </commands>
</command-request>


The following figure illustrates the adapter response for the Session-based CLI adapter for persistent connectivity (Windows).

XML sample of the Session-based CLI adapter response with persistent connectivity for Windows


<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata><os-id>Windows 2003</os-id>
        <os-version>5.2</os-version>
        <os-arch>x86</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
            <command>cd C:\\"Documents and Settings"</command>
            <line-count>0</line-count>
            <execution-milliseconds>16</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output/>
        </command-output>
        <command-output>
          <metadata>
            <command>dir </command>
            <line-count>10</line-count>
            <execution-milliseconds>78</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1"> Volume in drive C has no label.</line>
            <line index="2"> Volume Serial Number is D454-12A6</line>
            <line index="3"> Directory of C:\Program Files\BMC Software\AO7600June3\bin</line>
            <line index="4">07/08/2009  08:40 PM    <DIR>          .</line>
            <line index="5">07/08/2009  08:40 PM    <DIR>          ..</line>
            <line index="6">07/08/2009  08:40 PM           115,712 BMC Atrium Orchestrator CDP.exe</line>
            <line index="7">07/08/2009  08:40 PM             4,031 BMC Atrium Orchestrator CDP.lax</line>
            <line index="8">07/08/2009  08:40 PM            41,405 lax.jar</line>
            <line index="9">               3 File(s)        161,148 bytes</line>
            <line index="10">               2 Dir(s)  49,239,662,592 bytes free</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>


The following figure shows an adapter request for the Session-based CLI adapter (UNIX).

XML sample of the Session-based CLI adapter request for UNIX


<command-request>
  <commands>
  <command prompt="password:">telnet -l test</command>
  <command prompt="$">test</command>
  <command prompt="$">cd /tmp</command>
  <command prompt="$">pwd</command>
  <command prompt="$">ls -la |grep -iv "surefire"</command>
  <command prompt="$">cd</command>
  <command prompt="$">pwd</command>
  <command ignore-response="true">exit</command>
  </commands>
</command-request>


The following figure shows an adapter request for the Session-based CLI adapter for persistent connectivity (UNIX).

XML sample of the Session-based CLI adapter request with persistent connectivity for UNIX


<command-request>
     <connection>
          <name>my_connection</name>
          <terminate-on-exit>false</terminate-on-exit>
     </connection>
     <commands>
          <command working-dir="/">ls -l</command>
          <command>pwd</command>
     </commands>
</command-request>


The following figure illustrates the adapter response for the Session-based CLI adapter for persistent connectivity (UNIX).

XML sample of the Session-based CLI adapter response with persistent connectivity for UNIX platform


<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata>
      <os-id>Linux</os-id>
        <os-version>2.6.9-22.ELsmp</os-version>
        <os-arch>i386</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
          <command>ls -l</command>
            <working-dir>/</working-dir>
            <line-count>24</line-count>
            <execution-milliseconds>113</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
           <line index="1">total 174</line>
           .
           .
           .
            <line index="24">drwxr-xr-x   25 root root  4096 Aug 19  2008 var</line>
          </output>
        </command-output>
        <command-output>
          <metadata>
            <command>pwd</command>
            <line-count>1</line-count>
<execution-milliseconds>90</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1">/home/user2/CDP7600</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>
<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata>
      <os-id>Linux</os-id>
        <os-version>2.6.9-22.ELsmp</os-version>
        <os-arch>i386</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
          <command>ls -l</command>
            <working-dir>/</working-dir>
            <line-count>24</line-count>
            <execution-milliseconds>113</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
           <line index="1">total 174</line>
           .
           .
           .
            <line index="24">drwxr-xr-x   25 root root  4096 Aug 19  2008 var</line>
          </output>
        </command-output>
        <command-output>
          <metadata>
            <command>pwd</command>
            <line-count>1</line-count>
<execution-milliseconds>90</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1">/home/user2/CDP7600</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>
<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata>
      <os-id>Linux</os-id>
        <os-version>2.6.9-22.ELsmp</os-version>
        <os-arch>i386</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
          <command>ls -l</command>
            <working-dir>/</working-dir>
            <line-count>24</line-count>
            <execution-milliseconds>113</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
           <line index="1">total 174</line>
           .
           .
           .
            <line index="24">drwxr-xr-x   25 root root  4096 Aug 19  2008 var</line>
          </output>
        </command-output>
        <command-output>
          <metadata>
            <command>pwd</command>
            <line-count>1</line-count>
<execution-milliseconds>90</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1">/home/user2/CDP7600</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>
<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata>
      <os-id>Linux</os-id>
        <os-version>2.6.9-22.ELsmp</os-version>
        <os-arch>i386</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
          <command>ls -l</command>
            <working-dir>/</working-dir>
            <line-count>24</line-count>
            <execution-milliseconds>113</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
           <line index="1">total 174</line>
           .
           .
           .
            <line index="24">drwxr-xr-x   25 root root  4096 Aug 19  2008 var</line>
          </output>
        </command-output>
        <command-output>
          <metadata>
            <command>pwd</command>
            <line-count>1</line-count>
<execution-milliseconds>90</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1">/home/user2/CDP7600</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>
<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata>
      <os-id>Linux</os-id>
        <os-version>2.6.9-22.ELsmp</os-version>
        <os-arch>i386</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
          <command>ls -l</command>
            <working-dir>/</working-dir>
            <line-count>24</line-count>
            <execution-milliseconds>113</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
           <line index="1">total 174</line>
           .
           .
           .
            <line index="24">drwxr-xr-x   25 root root  4096 Aug 19  2008 var</line>
          </output>
        </command-output>
        <command-output>
          <metadata>
            <command>pwd</command>
            <line-count>1</line-count>
<execution-milliseconds>90</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1">/home/user2/CDP7600</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>
<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata>
      <os-id>Linux</os-id>
        <os-version>2.6.9-22.ELsmp</os-version>
        <os-arch>i386</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
          <command>ls -l</command>
            <working-dir>/</working-dir>
            <line-count>24</line-count>
            <execution-milliseconds>113</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
           <line index="1">total 174</line>
           .
           .
           .
            <line index="24">drwxr-xr-x   25 root root  4096 Aug 19  2008 var</line>
          </output>
        </command-output>
        <command-output>
          <metadata>
            <command>pwd</command>
            <line-count>1</line-count>
<execution-milliseconds>90</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1">/home/user2/CDP7600</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>
<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata>
      <os-id>Linux</os-id>
        <os-version>2.6.9-22.ELsmp</os-version>
        <os-arch>i386</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
          <command>ls -l</command>
            <working-dir>/</working-dir>
            <line-count>24</line-count>
            <execution-milliseconds>113</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
           <line index="1">total 174</line>
           .
           .
           .
            <line index="24">drwxr-xr-x   25 root root  4096 Aug 19  2008 var</line>
          </output>
        </command-output>
        <command-output>
          <metadata>
            <command>pwd</command>
            <line-count>1</line-count>
<execution-milliseconds>90</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1">/home/user2/CDP7600</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>
<command-result>
  <metadata>
    <status>success</status>
  </metadata>
  <targets-output>
    <target-output>
      <metadata>
      <os-id>Linux</os-id>
        <os-version>2.6.9-22.ELsmp</os-version>
        <os-arch>i386</os-arch>
        <status>success</status>
      </metadata>
      <commands-output>
        <command-output>
          <metadata>
          <command>ls -l</command>
            <working-dir>/</working-dir>
            <line-count>24</line-count>
            <execution-milliseconds>113</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
           <line index="1">total 174</line>
           .
           .
           .
            <line index="24">drwxr-xr-x   25 root root  4096 Aug 19  2008 var</line>
          </output>
        </command-output>
        <command-output>
          <metadata>
            <command>pwd</command>
            <line-count>1</line-count>
<execution-milliseconds>90</execution-milliseconds>
            <exit-code>0</exit-code>
            <status>success</status>
          </metadata>
          <output>
            <line index="1">/home/user2/CDP7600</line>
          </output>
        </command-output>
      </commands-output>
    </target-output>
  </targets-output>
</command-result>
Was this page helpful? Yes No Submitting... Thank you

Comments