Operating System - HP-UX
1834931 Members
2477 Online
110071 Solutions
New Discussion

Re: Naming convention for SG control file.

 
brian_31
Super Advisor

Naming convention for SG control file.

Hi Team:

We have 3 environments (testing&development, Integeration testing and production). We are looking for a naming convention for all the three environments so that any script which we develop(which references the package ip from SG) would be able to pick up the ip from the control file of that respective box. Does anyone have any suggestions?

Thanks
Brian.
4 REPLIES 4
Sanjay_6
Honored Contributor

Re: Naming convention for SG control file.

Hi,

We normally use the name of the package in the control file. So if the package name is database _test we use something like dbtstcntrl.sh for for the control file. the cluster name we follow as something like location_db_test or something like that. Naming conventions are more like something that you can be comfortable with.

Hope this helps.

Regds
George A Bodnar
Trusted Contributor

Re: Naming convention for SG control file.

Our standard is to create a sub-directory under /etc/cmcluster using the package name and then leave the file as control.sh. Basically something like this:

/etc/cmcluster/testdev/control.sh
/etc/cmcluster/prod/control.sh
etc.
Sridhar Bhaskarla
Honored Contributor

Re: Naming convention for SG control file.

If I understood your question correctly, you would want to name your package directories like

/etc/cmcluster/pkg-tnd for test&dev
/etc/cmcluster/pkg-int for integration test
/etc/cmcluster/pkg-prd for production.

Depending on the environment, you can get the IP from the corresponding control file. An example simple script is below.

get_myip

/start/

#!/usr/bin/ksh

if [ $# -ne 1 ]
then
echo "Usage: $0 tnd|dev|prd"
fi

ENV=$1

myIPs=$(grep "^IP" /etc/cmcluster/pkg-${ENV}|awk -F "=" '{printf $2 " ") END {print ""})

echo myIPs

/end/

If you run 'get_myip tnd' should give out the virtual IPs for test and dev.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Stephen Doud
Honored Contributor

Re: Naming convention for SG control file.

Hello Brian,

There is no naming convention for package names, or control files per ServiceGuard documentation.

Having said that, I too use George's solution - using the same name for the control script in each package directory. I do this so that maintenance is easy - I don't have to inspect the directory to learn the file name that I want to work with. No matter the cluster, I name my Cluster ASCII Configuration File to "CONF", I name my package ASCII configuration files "config", and my package control scripts are named "control.sh" beneath each uniquely named package directory. The simplifies maintenance for the administrator.

-s.