Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Using CW2K to compare two configs

I have CW2K RWAN (latest version). I am trying to use cwconfig to compare two different configurations. Here is the command I am using

cwconfig -m my-email-address -device router1 router2

I get the following error

<cwconfig> * Fatal error * CWCONFIGFILE Environment variable not set

I have not found any reference to this in the help or on the Cisco web site.

5 REPLIES
Blue

Re: Using CW2K to compare two configs

If you want to avoid the -p option which will reveal the password in clear text in cli, you will have to store your username and password in a file and set a variable CWEXPORTFILE which points to the file. You will have to maintain this file and control access permissions to prevent unauthorised access.The password must be provided in the file in the following format:

username password

If you don't want to use the above method, you can sue the -u user -p password option as well. So, for example, if you want to use the compare function to compare different configuration versions of the same device.

Example:

cwconfig compare -u user -p pass -device zebra.domain.com -version 2 5

For more details on this command usage and syntax, just search for cwconfig in the on-line help within the RME app and you'll see the details.

New Member

Re: Using CW2K to compare two configs

Rizwan

Thanks for the input. I did try with the -p and -u options. I will probably use the file.

But my real question is Can I compare the config of two different devices, not two different configs of the same device. This is possible using the GUI of CW2K. Can it be done at the command line?

Blue

Re: Using CW2K to compare two configs

From the CW2K GUI, you can compare the configs of two different devices. Goto RME->Configuration Management->Compare Configurations->Click 2 Versions of Different Devices. The Compare Configurations dialog box displays fields in which you enter your search criteria.

- To specify devices whose configurations you want to compare, click Device, then click Select. The Device Selection window appears.

- Select the devices whose configuration versions you want to compare.

- To specify patterns to search for, click Pattern, then click Select. The Patterns dialog box appears.

-In the Pattern Info area, enter text patterns to search for. To search for more than one pattern, enter the second and third patterns in the Pattern 2 and Pattern 3 fields.

- For Type, click And to search for configurations that include all patterns, or click Or to search for configurations that have at least one pattern.

- Click Exclude to search for configurations that do not match the patterns.

- Click OK. The Compare Configurations dialog box now contains all the criteria you specified.

- For Show Configs, click Latest to view the most recent configuration, or click All to view all configuration versions.

- Click Finish. The Configuration Version Compare report appears. You get an error message if only one or no configuration versions match your criteria.

New Member

Re: Using CW2K to compare two configs

Rizwan

Thanks again for the quick response. Although your answer is technically correct it only tells me what I already mentioned in my request. I know that I can compare two different configurations in the CW2K GUI. However my question is How do I do this from the command line so I can automate the process? I need to be able to automate the process. I do not want to have to run this manually every day for 25 sets of devices. We are implementing a backup hub site and need to keep multiple sets of devices in synch. There are 25 pairs of devices. It is very labor intensive to have to do this manually.

Thanks

Alan

Blue

Re: Using CW2K to compare two configs

Yes, it should work. You can specify multiple devices by separating each device name with a comma. Also can use the -version option to compare specific cconfig versions. I just tried it and it works fine for me.

cwconfig { compare | delete } -u userid -p password

[-d debuglevel] [-m email] [-l logfile] { -device list |

-view name | -device list -view name } { -version

version1 [version2] | -date date1 [date2] } [-continue]

Compare Function

Compare (specified by "compare") lists the differences between versions of a device configuration. You can specify the versions to be compared by using the -version option or the -date option. If you specify the -version option with

only one version number, that version is compared with the latest archived configuration of the device. If you specify the -date option with only one date, the configuration version with that date is compared with the latest archived

configuration. When specifying a date, use the format mm/dd/yyyy. If you do not specify either a date or a version, the latest two archived configurations are compared. You can specify multiple devices by separating each device

name with a comma. The output of the Compare function can be interpreted as follows

. lines preceded by '+' sign signify those occurring only

in the first version but not in the latter

. lines preceded by '-' sign signify those occurring only

in the latter version but not in the first

. lines preceded by '<' and '>' connote those which are

present in both files but differ from each other

110
Views
0
Helpful
5
Replies
CreatePlease to create content