Operating System - HP-UX
1836581 Members
1540 Online
110102 Solutions
New Discussion

Service Guard and gethostby name()

 

Service Guard and gethostby name()



I have an application that is running in a service guard environment.It calls gethostbyname to determine which node it is running on. The info returned is for the actual system where the process is running.
Is there some way to get the information for the floating IP address returned?

Thanx in Advacne,

Ken
4 REPLIES 4
Tim D Fulford
Honored Contributor

Re: Service Guard and gethostby name()

I'm not so sure I undestand you. If you mean a (fucticious) command like getpackagename(), you do not need it as the IP & package name should be unique, the variable is the host it is on.

If however, you expect gethostbyname to return your package name then it wont, it will return the host name.

Regards

Tim
-
A. Clay Stephenson
Acclaimed Contributor

Re: Service Guard and gethostby name()

If you have a hostname entry in DNS, NIS, and/or /etc/hosts for your package name/IP address then that will be returned.
If it ain't broke, I can fix that.
melvyn burnard
Honored Contributor

Re: Service Guard and gethostby name()

Take a read of the Managing MC/ServiceGuard at
http://docs.hp.com/hpux/pdf/B3936-90065.pdf and note the appendices , particularly D, Designing Applications to run on Multiple Systems, especially page 331.
Also see page 82 on gethostbyname and how hte Network manager works.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Geoff Wild
Honored Contributor

Re: Service Guard and gethostby name()

I'm not too sure exactly what you mean by getting the information about the floating ip....

You can do something like this to find out which node a package is running on:

cmviewcl |grep yourpackage |awk '{print $5}'


For floating ip, if you are trying to determine which host it is running on...how about:


echo quit |telnet floatingipdnsname 25 | grep 220 |awk '{print $2}'

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.