CWCLI and XML issue on RME 4.3

MIBS, SMMPv1, SMMPv2, SMMPv3 and management
Guest

CWCLI and XML issue on RME 4.3

Post by Guest » Thu Dec 16, 2010 10:33 pm

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 FilesCSCOpx ftpboot[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~2CSCOpx empargValFile.txt --><cwcli> INFO - Devices to be attempted in the job:[DisplayName]<cwcli> INFO - The job 5548 is createdWaiting for the job results .............!<cwcli> - Job Status: Job SucceededSuccessful 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 TFTPSUMMARY========        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.101Apr 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 FilesCSCOpx ftpboot[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

Guest

Re:CWCLI and XML issue on RME 4.3

Post by Guest » Thu Dec 16, 2010 11:40 pm

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

Guest

Re:CWCLI and XML issue on RME 4.3

Post by Guest » Fri Dec 17, 2010 12:35 am

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

Guest

Re:CWCLI and XML issue on RME 4.3

Post by Guest » Fri Dec 17, 2010 1:02 am

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 cwclis -f argument on the server.

Post Reply