Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Devices NetView -> CW2K help

Status
Not open for further replies.

voidmain

IS-IT--Management
Sep 2, 2003
3
US
I am a n00b with CiscoWorks 2000 but have been tasked with taking over the CW2K administration for our company (the old administrator left before I was hired).

We currently have an automated process set up to add new devices to our CW2K database that involves exporting a device list from NetView and importing that device list into CiscoWorks using the "checkaddr.pl" and the "crmimport.pl" scripts.

The import itself works flawlessly, however any new devices that are added to CiscoWorks do not have their telnet/enable passwords defined in the database and will not archive until these passwords are manually set.

Currently we are going through manually and setting these passwords via RME->Administration->Inventory->ChangeDeviceAttributes. This is a tedious process and we are looking for a way to make this easier. It would be great if we could set default passwords for any new devices that are added as they will all be the same. It also looks like I might be able to create some sort of template but I have come up empty handed on this as well.

We're about to add 5,000 new devices so.... I have written my own Perl script that allows me to query the database directly but I can't quite figure out exactly how the passwords are stored, and I don't really want to do it this way anyway as it appears Cisco frowns upon direct database manipulation and would not support it.

If anyone could give me a pointer or two I would certainly appreciate it. Any other n00b CW2K administrator documentation that you can point me to would be very helpful as well.
 
First method that works is to export the RME data as CSV format. Open the file in Excel. Populate the missing fields. Import the file back into CW2000. Use Imported information, rather then managed.

Second method is to take the data from NetView via a script. (ovtopodump -o |grep 1.3.6.1.4.1.9.1 and ovtopodump -o |grep 1.3.6.1.4.1.9.5)
Create a CSV formatted file with the proper header for importing into CW2000. If the network uses various community strings, this becomes more complex then the first method.
 
Thanks for all the suggestions. The issue was to find an automated way of doing this. I could take the CSV file that was exported from NetView and add the appropriate password information via a script except there appears to be no supported method of import that will accept these extra fields short of point&click in the CW interface which certainly isn't an automated solution.

It's turning out to not be all that big of a deal to this point but it would certainly be better if there were an automated way. In fact what I really would like to be able to do is set the TACACS ID and Password for a given device name from the command line (I'm not a point & clicker).

I have written a command line query in Perl to give me a list of devices in the CW database that are erroring because of invalid/nonexistent TACACs IDs. If I could just feed that list to a script that would set the ID/Passwd for a given device it would be golden.

I imagine something like this:

#!/bin/sh
for dev in `getbadpasswords.pl`
do
/opt/CSCOpx/bin/chdev.pl -DEV $dev -TID tacacsuser -TPW tacacspwd
done

But that would be too easy.

Thanks again!
 
Update: I finally have this fully automated. I had mentioned that we were using "crmimport.pl" to do a nightly import of a seed file from our NetView system. I mistakenly assumed that crmimport.pl could only handle the CSV fields "devname,ROstr,RWstr" because that is all we pass in our seed file. After some testing I realized that crmimport.pl can handle all the fields that DataPrep.pl and the other utility can handle (19 fields).

I had this one step from being fully automated by writing a process that was run from cron every morning at 6:30 and queried the database for failed archive messages pertaining to no passwords in the database. It then generated a CSV import file from that list and placed it in a directory where it could be imported using the web interface. Once I realized the "crmimport.pl" could do the same thing that the web interface import does I just added it to the script that generates the CSV file and it is now fully automated.

Sure it probably would have been better to just determine which devices are new in the seed file and add the passwords to it and I just may modify the process to work like that in the future but for now it's working well enough. On a side note, the utility I wrote to generate the CSV file from search criteria works very well. It's been a great debugging tool as well. Here are the options:

Code:
$ getpwd -h

Usage: getpwd [OPTION]...

Search Options:
  -a,   --all                   Show entire database
  -c|t, --[cfg]type=CFGTYPE     Can be [Rr]un, or [Ss]tart
  -d,   --device=DEVSTR         Device name (or partial device name)
  -e,   --errors                Show only devices with errors
        --errorstr=ERRSTR       Show only devices with errors matching ERRSTR
  -f,   --fullerrors            Show full error messages
  -i,   --importformat          Output in CSV format ready for CW import
  -n,   --nohead                No page heading
  -r,   --rows=NUMROWS          Rows per page (0 = no header)
  -u,   --uniqhosts             Show unique hostnames only
  -h,   --help                  Print this help

I have also written a Perl/Tk GUI wrapper for the above script. The script queries the RME database directly and displays device and password information (passwords are not encrypted in the database surprisingly).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top