1856565 Members
24614 Online
104113 Solutions
New Discussion

Re: Checking MCSG

 
SOLVED
Go to solution
Vijaya Kumar_3
Respected Contributor

Checking MCSG

Hi all
I am new to MCSG and i need a help from you. I am writing a shell script and need to check whether MC Serviceguard is installed or not. Based on that i need to run some task.
anyone help me how can i check whether MCSG is installed and working in this machine.
I know i can check the installation with swlist | grep -i serviceguard but i need to know whether it is part of a running cluster.
Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
3 REPLIES 3
Dietmar Konermann
Honored Contributor

Re: Checking MCSG

If you need to check for a running cluster node then grep'ing the cmviewcl output could be a way to go. You could also check if the cluster damon 'cmcld' is present.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Sundar_7
Honored Contributor

Re: Checking MCSG

Hi,

# swlist ServiceGuard

will tell u if it has been installed or not

# ps -ef | grep /usr/lbin/cmcld | grep -v grep | grep -q cmcld
# if [[ $? -ne 0 ]]
then
echo "cluster not running"
else
echo "running"
fi

Thanks,

Sundar.
Learn What to do ,How to do and more importantly When to do ?
Michael Steele_2
Honored Contributor
Solution

Re: Checking MCSG

a.) Regarding "...check whether MC Serviceguard is installed or not..."

# swlist -l fileset -a state | grep -i serviceguard

b) Regarding "..and working in this machine..."

This will be a combo of things depending on what you want, for many SA's don't allow the SG cluster to start at boot up. If you do then:

- grep "AUTOSTART_CMCLD=1" /etc/rc.config.d/cmcluster

- Check syslog.log for 'vmunix' and 'cmcld' messages.

- ServiceGuard Manager, a free openview download from:

http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=B8325BA

- or do as others have suggested and parse the output of 'cmviewcl -v'.

# cmclview -v > /tmp/file
# grep -i -e enabled -e primary /tmp/file (* etc. *)
Support Fatherhood - Stop Family Law