Operating System - HP-UX
1833648 Members
4691 Online
110062 Solutions
New Discussion

Package examples for MC/SG to test switching

 
SOLVED
Go to solution
SM_3
Super Advisor

Package examples for MC/SG to test switching

I'm using MC/SG in a test environment

Can anyone give me any ideas of Package examples I can set up.
I can't use Oracle or anything like that
just something simple
to test the switching
8 REPLIES 8
Sridhar Bhaskarla
Honored Contributor
Solution

Re: Package examples for MC/SG to test switching

Hi,

The following is a simple script that starts nothing stops nothing but monitors swagentd. If you kill swagentd process, it should failover to the other box. If you create a /tmp/lock file, then it won't monitor.

However, you will need to setup a service inorder to monitor the packages.

In the control file, add this

SERVICE_NAME[0]="test"
SERVICE_CMD[0]="/etc/cmcluster/test/test.sh monitor"
SERVICE_RESTART[0]=""

In the package config file, add this

SERVICE_NAME test
SERVICE_FAIL_FAST_ENABLED NO
SERVICE_HALT_TIMEOUT 300



Packaget script - test.sh

#!/usr/bin/ksh

monitor_processes()
{
echo "monitoring the processes"
while true
do
if [ -f /tmp/lock ]
then
echo "Lock is there. would not monitor the processes"
sleep 5
else
ps -ef|grep swagentd|grep -v grep > /dev/null 2>&1
if [ $? = 0 ]
then
sleep 5
else
echo "swagented process is not running"
exit
fi
fi
done
}



case $1 in

start)
echo "starting the dummy"
;;
halt)
echo "halting the dummy"
;;
monitor) echo "monitoring the dummy"
monitor_processes

;;
esac


If you don't want to compilcate, comment out the monitor portion aand do not add the services.

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

Re: Package examples for MC/SG to test switching

Hi (Again),

Forgot to add that you will need to add startup and shutdown commands in your control file as well.

Under customer defined run commands area add

/etc/cmcluster/test/test.sh start

Under customer defined halt commands add

/etc/cmcluster/test/test.sh halt

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
SM_3
Super Advisor

Re: Package examples for MC/SG to test switching

Cool
If you have any more info keep it coming...
Sridhar Bhaskarla
Honored Contributor

Re: Package examples for MC/SG to test switching

Hi,

I believe a chat session is much better than a thread if you are trying to play with ServiceGuard. There is no end to the messages and it may not be the purpose of this forums?.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
SM_3
Super Advisor

Re: Package examples for MC/SG to test switching

ok
SM_3
Super Advisor

Re: Package examples for MC/SG to test switching

Armin
Why MC/SG for SAP?
melvyn burnard
Honored Contributor

Re: Package examples for MC/SG to test switching

Few things here,
1) read the Managing MC/ServiceGuard manual at:
http://docs.hp.com/hpux/ha

2) get on the Customer Education course for Sg

3) to test lan failover, just create3 a simple package that does nothing else except put an IP address out there, and then do your test.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!