Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-20-2017, 10:03 AM
ruben.dario ruben.dario is offline
Registered User
 
Join Date: Jun 2017
Posts: 5
Question Massive Hostname Change

Hello,

The main reason I am using SecureCRT is because I need to change the hostname (and interface descriptions) for over more than 5000+ Cisco routers/switches in a practical and "fast" way.

It seems that the best method for completing this task is using the VanDyke's example script "RunCommandsOnMultipleHostsAndLogResults.vbs" which allows to connect to a list of IP Addresses (or hostnames) and run a list of commands. However this list of commands (in my case) must be unique for each IP address, due the configuration of different hostnames. That is, executing a unique set of commands suck as #hostname HOSTA, for IP_1; then #hostname HOSTB, for IP_2 and so on...

If you have any suggestion for this requirement, I will be more than grateful.

Many thanks in advance,

Ruben D. Colmenares
ruben.colmenares@wdna.com
Reply With Quote
  #2  
Old 06-20-2017, 10:59 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,322
Hi Ruben,

I think "fast" may be a subjective term in this case.

If I understand correctly what you are saying, you are going to need 5000 separate ##commands_variable.txt files, correct?

Have you done any of the setup so far?

If so, is any part of the specific entry in the ##hosts.txt file used to identify the specific "commands filename"?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 06-20-2017, 11:31 AM
ruben.dario ruben.dario is offline
Registered User
 
Join Date: Jun 2017
Posts: 5
Hey Brenda!

Indeed, maybe "fast" was incorrectly used. What I meant, was to look a more efficient way through SecureCRT rather updating each NE's hostname manually.

Answering your first question, Yes. I'd need a specific configuration file for each router/switch; considering that each hostname will be different.

For the hosts.txt file, I'll have something like this:

14.191.214.6
14.191.214.5

Then, the commands to execute:

enable
config
sysname NEW_HOSTNAME


So as you can see there is no specification of the configuration command script in the hostname files.

Thanks,
Reply With Quote
  #4  
Old 06-20-2017, 11:48 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,322
Hi Ruben,

Are you saying in the commands file, only that one command differs from host to host?

Do you want to be prompted to provide NEW_HOSTNAME?

If not, is there some sort of pattern so it can be automated?

Can you list the explicit steps of how you would do this manually?

If the list contains sensitive data, please send an email to support@vandyke.com and include "Attn Brenda - Forum Thread #12733" in the subject line.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 06-20-2017, 11:57 AM
ruben.dario ruben.dario is offline
Registered User
 
Join Date: Jun 2017
Posts: 5
That's correct Brenda. The only "field" that'll be different from one command configuration script from another is the "NEW_HOSTNAME" info.

The manual configuration it's very simple:

Right after the NE is logged on:

<CX-OpLab>system-view
[CX-OpLab]
[CX-OpLab]sysname TestsNamingConvention
[TestNamingConvention]
[TestNamingConvention]

And for the interfaces description:

[TestNamingConvention]inter
[TestNamingConvention]interface GigabitEthernet6/0/13
[TestNamingConvention-GigabitEthernet6/0/13]description InterfaceNamingConvention


Every NE to manipulate holds the same OS and syntaxis, so the command script can be used to all 5000+ NEs. However the HOSTNAME information must be different for each element.
Reply With Quote
  #6  
Old 06-20-2017, 01:13 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,322
Hi Ruben,

What is the "TestsNamingConvention" pattern you will be using?

What is the "InterfaceNamingConvention" pattern will be using?

Is this something that can be derived from the IP address?

Do you already have a file that contains all 5000 IP addresses?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
batch , change , hostname , script


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:59 AM.