cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
959
Views
0
Helpful
3
Replies

CWCLI and XML issue on RME 4.3

Sean Gilkes
Level 1
Level 1

Hi All,

     On a Windows 2008 Server with SP1 running LMS 3.2, I have a script that creates IOS configuration files with the appropriate XML command file for use with the cwcli config import function.  The XML file contains the following tags and values:


<payload>
<command>
   cwcli config import -u admin -p [Base64PWD] -device [DisplayName]
  <arg>
   -f
  </arg>
  <arg-val>
   D:\Program Files\CSCOpx\tftpboot\[DisplayName].cfg.[ID]
  </arg-val>
</command>
</payload>

When I execute the sample script to invoke the Servelet, as provided in the RME users guide, I get the information that the job is running:

<!-- Executing: cwcli config import -u admin -p [Base64PWD] -device [DisplayName] -f D:\PROGRA~2\CSCOpx\temp\argValFile.txt -->
<cwcli> INFO - Devices to be attempted in the job:
[DisplayName]
<cwcli> INFO - The job 5548 is created
Waiting for the job results ...

..........!
<cwcli> - Job Status: Job Succeeded

Successful Devices:
[DisplayName]
<cwcli> INFO - CM0107 Import the config file to PRIMARY Running Config on device successful CM0091 Check if the device prompt is available.
CM0089 Config archival successful for [DisplayName]
<cwcli> INFO - The transport mode used is TFTP

SUMMARY
========
        Successful: import
<!-- Processing complete -->

After this is where it gets weird!  On the switch - having previously issued the command "term mon" - I see the following output displayed:

Apr 28 16:56:38: %SYS-5-CONFIG_I: Configured from console by cw_2000_hq on vty2 (10.185.64.101)
Apr 28 16:56:46: %SYS-5-CONFIG_I: Configured from tftp://[CWServer]/20110428165646943-[DeviceIP].cfg by console

and checking the device I see that no changes have taken place.  Inspection of the file that was sent via TFTP to the device indicates why - it contains garbage:


   D:\Program Files\CSCOpx\tftpboot\[DisplayName].cfg.[ID]
 
end

The file I am specifying between the XML <arg-val> tags contains these commands:

interface FastEthernet0/21
  switchport access vlan 2400
  switchport mode access
  no cdp enable
  spanning-tree portfast
  ip verify source
  shutdown
!
end

Can anyone tell me what I am doing wrong, please..?

Thanks,

SRGi

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

The documentation is wrong.  Your payload should include the commands you want to deploy.  So, use:



   cwcli config import -u admin -p [Base64PWD] -device [DisplayName]
 
   -f
 

 

interface FastEthernet0/21
  switchport access vlan 2400
  switchport mode access
  no cdp enable
  spanning-tree portfast
  ip verify source
  shutdown
!
end
 

View solution in original post

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

The documentation is wrong.  Your payload should include the commands you want to deploy.  So, use:



   cwcli config import -u admin -p [Base64PWD] -device [DisplayName]
 
   -f
 

 

interface FastEthernet0/21
  switchport access vlan 2400
  switchport mode access
  no cdp enable
  spanning-tree portfast
  ip verify source
  shutdown
!
end
 

Hello Joseph,

     Once again you have come to my rescue!  Could you tell me where you found this information, please..?

Thanks,

SRGi

I had to read the code to see how it was handling the data passed to it.  I saw that the value of the file argument was being stored in a temp file, and that temp file was being passed to cwcli's -f argument on the server.

Review Cisco Networking for a $25 gift card