I have to trasfer about 500 configs from CW server to my PC (then to another server). I don't have access to the Shadow directory or cwcli. To many configs to use cut and paste from the config viewer. I appreciate you help.
They ciscoworks server allows this for authorised persons. Since you don't have access to the shadow directory or cwcli it seems you are not authorised.
Are you looking for a backdoor?
The only methods to get configs are:
1) Via the GUI (as you said too much to cut and paste
2) Shadow directory -- need permissions
3) cwcli -- need permissions
There's no other way to get around this without having appropriate permissions on the server or via the web.
You could use something like:
./cwcli export inventory -u admin
the best best is to do cwcli -help to get all parameters
I have a simular requirement. A customer whises to copy the configs (about 350) on another drive as a backup independant of ciscoworks availablilty.
I've noticed the cwcli has been upgraded.
It now insists on XML output even if we don't request it using "-xml"
Unfortunatly a "-txt" option has been forgoten.
Any ideas how to get the configs out in txt format without knowing all the names?
Anyway the folder should contain the config of any new devices as well without having to update a device list.
Any nifty tool to unXML the files?
Shadow directory would be a good alternative but is not filled and because each config change requires a ticket and an approval at this customer it will be hard to fill it up.
I have fixed this bug. The fix will be available in LMS 2.6 due out in September. Shadow will then be updated each time the config is fetched regardless of changes as long as a shadow entry does not already exist for the given device.
As for a -txt option for cwcli, this is not there. The default cwcli config export will export to plain text, but it only operates on one device at a time unless you use an input file. If you wanted to dynamically generate this input file for all devices, you could write a script which wraps dcrcli lsids to list all the devices by display name and DCR device ID. You could then parse out the display names, and build an input file based on that. Then, you could use the '%' wildcard to cwcli config export, and pass the name of the input file. This would effectively accomplish what you want by exporting each device's configuration to a flat file in plain text format.
Good morning Joe,
Thanks for your response, and the fix.
I'm just wondering, Is that possible to make the entire configurations export process easily executable from the CW GUI, rather then from the cwcli ?
Bulk config export is not done through the GUI since we offer the shadow directory and CLI methods for getting at the configs. I don't see this changing. Perhaps when the shadow fix goes in, this won't be as much of an issue.
However, if you do not have access to the CiscoWorks server file systems, you could put together a solution where you create a file share (either NFS or Samba on Solaris or SMB on Windows) and then invoke cwcli via the web interface to dump the configurations out to this file share. Since dcrcli is also runnable via the web, you could adapt my previous script idea to do this. This file share would then be mounted on your local machine where you could access the configs.
Of course, an easier solution would be to simply export the shadow directory and password protect it as necessary.
I just put together a rough script implementing what I suggested. This can be run from any machine (not necessarily the CiscoWorks server). It requires Perl 5, and LWP. It will export all configs to a specified directory on the CiscoWorks server (e.g. an NFS or SMB exported directory). This script is distributed under the BSD license.
It's good to know this is fixed.
I will see how I can write something with dcrcli and cwcli for now. Unfortunately the platform is windows so batchfile scripting is not so straight forward.
Use Perl. You can build a batch script to bootstrap it if needed. I do this all the time when developing tools for CiscoWorks.
I think I'm ready for a holiday.(should already be on it)
cwcli config export -u usr -p passwd -device % -continue
gives the configs in txt format (.cfg) like I want them.
Sorry about the fuzz.
Yes, this certainly works if you don't mind the configs being exported to PX_DATADIR (i.e. NMSROOT\files on Windows and /var/adm/CSCOpx/files on Solaris). However, if you do not have access to the CiscoWorks server file system and if exporting the shadow directory is not feasible, then accessing these files might prove impossible.
The only way to get the export files to go to another location on both operating systems is to specify an input file to cwcli config export. Doing this for all devices would probably be best done with a script that wraps both dcrcli and cwcli.