1838982 Members
5175 Online
110132 Solutions
New Discussion

Identifying active node

 
SOLVED
Go to solution
dictum9
Super Advisor

Identifying active node


What's the easiest way to identify if a node is the active node of the cluster?

I am trying cmviewcl but it gives lots of output, do I have to parse it?
6 REPLIES 6
Yarek
Regular Advisor
Solution

Re: Identifying active node

Hi,

cmviewcl -n
Steven E. Protter
Exalted Contributor

Re: Identifying active node

Shalom,

Depending on the application, both nodes can be active at the same time. Packages can run on whichever node they are configured to run on or on the failover node if the proper command issued.

cmviewcl -v

Will give you run state and node of all packages, active, running or failed.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Denver Osborn
Honored Contributor

Re: Identifying active node

This will show which package is running on which node...

cmviewcl -l package |awk '{print $5, $1}'


-denver
Denver Osborn
Honored Contributor

Re: Identifying active node

d'oh. hit submit before reading. that output won't show the state.

anyhow, use "cmviewcl -l package" if you want to know which package is RUNNING on which node. :)

-denver
Geoff Wild
Honored Contributor

Re: Identifying active node

Yes, you have to parse it.

I usually do:

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


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.
Carsten Krege
Honored Contributor

Re: Identifying active node

In SG A.11.17 (supported with HPUX 11iv2 and upcoming 11iv3) a new option to cmviewcl has been added to allow command line parsing.

The cmviewcl man page says:


-f format Select the output format to display. The format
parameter may be one of the following values:

table This option displays a human readable
tabular output format. This is the
default output format if no -f is
specified on the command line.

line This option displays a machine parsable
output format. Data items are displayed,
one per line, in a way that makes them
easy to manipulate with tools such as
grep(1) and awk(1). This option also
shows additional information not
available in the table output format.
Some of these are detailed under
Specialized Line Output. Please refer to
cmviewcl(5) for further details.



Here is an example:

# cmviewcl -f line -l package | grep -e status
package:PKG3|status=up
package:PKG1|status=up

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG