Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to change IP-Address and Hostname on HP-UX 11.31 using Script.

Mr.Right
Advisor

How to change IP-Address and Hostname on HP-UX 11.31 using Script.

Hi Gurus,

I have around 60 HP-UX 11.31 Boxes , please help me with a script through which I can perform the process of changing Host Name and IP address change on all the systems.

Thanks in Advance.

Right.
9 REPLIES
sujit kumar singh
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

hi

the best way is to use the commands

set_parms hostname
set_parms ip_addr
this amkes necessary changes to the other files too.
you might also need to change the default route, for that use SAM.

but these take you through the menus where you have to give responses.

or can try using SAM.

regar
Bulent ILIMAN
Trusted Contributor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

If you want to change every parameter from scratch than you can use

set_parms initial

also.
Steven Schweda
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

Is this a well defined task?

How much editing will be needed in
"/etc/hosts" on each system?

In how many other places will these changing
host names appear? NFS exports?
"/etc/hosts.equiv"? "~/.rhosts"? DNS data?

IP address changes are hard enough. Name
changes can be very troublesome, especially
with insufficient information and planning.
Expecting to be able to write "a script" to
do all the work seems (to me) to be asking
for trouble. (Or were you hoping that
someone else would write an error-free script
for you, which does exactly what you want
done?)
Mr.Right
Advisor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

Hi Steven,

Thanks for your reply , I am looking for some sample script for this IP-Address and Hostname Change.

I do not want any one to write for me, if any one can provide me sample script , I can work on the same and make them work for my environment.
Steven Schweda
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

> [...] I am looking for some sample script
> [...]

Fine, but exactly what do you want it to
change, and to what? Where will the new
addresses and names come from? How many
places will they need to go?

> Is this a well defined task?

I don't yet see a useful specification of
what you need to have done. (Of course, if
you could explain exactly what you need the
script to do, then it's not clear to me why
you can't write the thing.)

Someone may amaze me, but I doubt that anyone
has such a script (or at least a good one)
lying around. There are simply too many
site-dependent variables involved. (I asked
about a few of them, but got no answers.)
Rita C Workman
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

Mr. Right,

Mr. Schweda has made some very good reasons for not 'scripting' changing the full identity of a server via a script. So think this out....

Often software has imbedded information within it that encompasses host info. Like Data Protector for example. If you were to change the IP and the hostname on an HPUX box running DP - your backup software will have serious issues. And I know of the several vendors that on loading the software, it extracts host info and inputs into the software.

So...you mention 60 boxes. I'm guessing they are all running many things, but you do not once mention that you have checked the impact of changing IP's/hostnames.

A quick script is easy to write using the utility folks abvove mentioned. But planning to do that will likely adversely affect those boxes.

Kindest regards,
Rita
Torsten.
Acclaimed Contributor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

Strongly agree - "And I know of the several vendors that on loading the software, it extracts host info and inputs into the software. "

I know this too ;-)

Be prepared to see very strange things ...

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Bill Hassell
Honored Contributor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

And to add some additional clarity, you can use the set_parms script but this is interactive, not something you can run as a batch job to change all 60 with one command.

However, once you change the IP address and hostname, you may have to reboot every machine. Many applications and some OS tools like swinstall will fail to run as they have stored the hostname and/or IP address inside the application. And you may have multi-homed systems (servers with multiple LAN cards that may or may not need address changes. And of course, if you depend on DNS services, all of those new names and addresses must be changed before your servers will work correctly. And finally, some of these 60 machines may depend on each other and they may have local hosts files that have the old IP addresses. These will have to be updated as well as scheduling reboots for servers that provide services for other machines.

Changing host/IP can be trivial for a small workstation but can be a custom job for every large server. You may want to schedule to switchover in stages if at all possible. At the very least, there will need to be a lot of testing and rebooting -- not a scriptable task.


Bill Hassell, sysadmin
Sp4admin
Trusted Contributor

Re: How to change IP-Address and Hostname on HP-UX 11.31 using Script.

I have to agree with the others. I don't think that is something to script. I think the best why is to bit the bullet and do this manually with the "set_parms' commands.

My $0.02
sp,