Checking for active/passive node of cluster

(imported topic written by MartinZ91)

Hey everyone,

Did someone already create a relevance which decides if the BESclient computer is the active/passive member of a cluster?

We want to deploy patches also to cluster environments. It is (our) good practice to install the patches on the passive node first, then fail over the cluster and install it on the now passive node.

We would need this not just for Windows, but for AIX, Solaris und Linux’s.

I know, that MS Clusters can be administered from the command line with the “cluster [/list]” command. The Unix’es could determine the active/passive state by looking to mounted file systems of some quorum disk. If I create tasks with such commands and store the results in a (client-local) text file, there is the risk, that relevance checking this text file later on and patching accordingly will see a incorrect cluster state, because in the time gap between the task execution and the relevance evaluation there has been a cluster fail over.

I would appriciate tipps from the community, before I run into develloping those task/relevance.

Thank You in advance, Martin

1 Like

(imported comment written by BenKus)

Anyone know of a way to get this info in WMI?

(imported comment written by MartinZ91)

Hi Ben

I did further research on this issue and found some WMI-classes which could be used, but I didn’t succeed in getting those to give correct results.

I found maybe another way (just for the windows platform) to handle this issue: There is a registry-key HKLM\Cluster which provides names for all resources running as cluster group(s). There is always a key with a value “Cluster IP Address” which shows the virtual cluster IP address. Now I wrote some relevance to find out, if this IP address is active “network IP interface” on the computer. If it is, that should mean that this node is the active node.

I’m testing this now.

The issue for the non-windows OS is still open, I’ll try to find parameters which can tell me the difference between active and passive node, any help appriciated.

(imported comment written by SystemAdmin)

This seems to be a fairly decent reference for the WMI classes: http://msdn2.microsoft.com/en-us/library/aa372876.aspx

I’d be interested in grabbing this sort of information as well. Right now, we’re doing it through vbscript over the network, but I’d love to pull it from within BigFix.

For HP-UX and Linux, we’re using service guard. On those systems we have BigFix running a shell script and then harvesting the data through retrieved properties. But we’re not pulling active/passive determination.

Jim

(imported comment written by BenKus)

I don’t have a cluster to test with, but can you try running QnA on a cluster computer and tell me what this returns:

selects “* from MSCluster_Cluster” of wmi “root\mscluster”

Ben

(imported comment written by SystemAdmin)

I tried that out as a start on my cluster nodes, but I’m getting the ‘singular expression refers to nonexistent object’ error. This is a Windows 2000 cluster, running the 6.x client.

(imported comment written by Shlomi91)

Hi,

also interested in that…

i ran the query on one of our win 2003 cluster (windows 2003 R2 x64) and got this:

q: selects "* from MSCluster_Cluster" of wmi "root\mscluster"
A: AdminExtensions
A: Caption
A: CreationClassName
A: Dedicated
A: DefaultNetworkRole=2
A: Description=
A: EnableEventLogReplication=1
A: GroupAdminExtensions
A: IdentifyingDescriptions
A: InstallDate
A: MaintenanceFile=Q:\MSCS\
A: MaxNumberOfNodes=8
A: Name=HFAFSR
A: NameFormat
A: NetworkAdminExtensions
A: NetworkInterfaceAdminExtensions
A: NetworkPriorities
A: NodeAdminExtensions
A: OtherIdentifyingInfo
A: PrimaryOwnerContact
A: PrimaryOwnerName
A: QuorumLogFileSize=4194304
A: ResourceAdminExtensions
A: ResourceTypeAdminExtensions
A: Roles
A: Security=%01?\%00x%00%00%00%14%00%02H%03%00`%18%03%00?%00%00? %00?%00`%14%03%00a%00%00?%12%00`%14%03%00a%00%00?%14%00?%00%00?%15%00???????%00?%00%00?%15%00???????%00
A: Security_Descriptor=%01?\%00x%00%00%00%14%00%02H%03%00`%18%03%00?%00%00? %00?%00`%14%03%00a%00%00?%12%00`%14%03%00a%00%00?%14%00?%00%00?%15%00???????%00?%00%00?%15%00???????%00
A: Status
I: plural wmi select

Hope this helps…

Shlomi

(imported comment written by BenKus)

Thanks Shlomi…

Based on this info, I don’t see anything that obviously indicates “active” or “passive”… The closest seems to be “DefaultNetworkRole”, but I would guess that is not it…

When you have a computer that is part of a cluster, where do you look or what tool do you use to figure out if it is active or passive?

Ben

(imported comment written by Shlomi91)

Usually i use cluadmin, but im not really sure where this tool gets the information from… also, considering that a node can only be active per resource, you may need to refine your search (kind of "what is the active node for the “x” resource).

however, a wonderful tool to obtain WMI information is Microsoft’s WMICodeCreator… loads of information can be obtained that way - including MS NLB, hardware, etc.

Shlomi

(imported comment written by Steve91)

Hi

I believe “GroupComponent” & “PartComponent” from “MSCluster_NodeToActiveGroup” retrieves this info…but it does require some parsing as the results are as follows:

Q: selects “GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”

A: GroupComponent=MSCluster_Node.Name=“ENTAP71U”

A: GroupComponent=MSCluster_Node.Name=“ENTAP71U”

A: GroupComponent=MSCluster_Node.Name=“ENTAP71U”

Q: selects “PartComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”

A: PartComponent=MSCluster_ResourceGroup.Name=“ENTCL71U-INST23”

A: PartComponent=MSCluster_ResourceGroup.Name=“MSDTC”

A: PartComponent=MSCluster_ResourceGroup.Name=“Cluster Group”

Steve

(imported comment written by BenKus)

Hey Steve,

Looks interesting… can you tell me how you would interpret this data and what you would like to see from it?

Ben

(imported comment written by Steve91)

Sure

The GroupComponent “MSCluster_Node.Name” is the node of the cluster which the PartComponent “MSCluster.ResourceGroup.Name” is currently active on.

Ideally what we’d be looking at is:

Cluster Node - Resource Name

So:

ENTAP71U - ENTCL71U-INST23

ENTAP71U - MSDTC

ENTAP71U - Cluster Group

I’ll need to double-double check that Node.Name definitely displays the other node in the cluster if a resource group is moved over to it, i.e.

ENTAP72U - ENTCL71U-INST23

etc…

I’ll check on one of our UAT servers to confirm.

Cheers

Steve

(imported comment written by Steve91)

Yep

It does display the other node if a resource is on it:

Q: selects “GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP592U”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP592U”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP592U”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP592U”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP593U”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP592U”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP592U”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP592U”

A: GroupComponent=MSCluster_Node.Name=“ENTAAP592U”

Q: selects “PartComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”

A: PartComponent=MSCluster_ResourceGroup.Name=“Cluster Group”

A: PartComponent=MSCluster_ResourceGroup.Name=“SQL - ENTAAP597U”

A: PartComponent=MSCluster_ResourceGroup.Name=“SQL - ENTAAP614U”

A: PartComponent=MSCluster_ResourceGroup.Name=“SQL - ENTAAP599U”

A: PartComponent=MSCluster_ResourceGroup.Name=“MSDTC”

A: PartComponent=MSCluster_ResourceGroup.Name=“SQL - ENTAAP612U”

A: PartComponent=MSCluster_ResourceGroup.Name=“SQL - ENTAAP598U”

A: PartComponent=MSCluster_ResourceGroup.Name=“SQL - ENTAAP613U”

A: PartComponent=MSCluster_ResourceGroup.Name=“SQL - ENTAAP596U”

593U being the node in question here which has “MSDDTC” on it.

For easy reference here’s a dump of the “cluster group” command:

Listing status for all available resource groups:

Group Node Status


Cluster Group ENTAAP592U Online

SQL - ENTAAP597U ENTAAP592U Online

SQL - ENTAAP614U ENTAAP592U Online

SQL - ENTAAP599U ENTAAP592U Online

MSDTC ENTAAP593U Online

SQL - ENTAAP612U ENTAAP592U Partially Online

SQL - ENTAAP598U ENTAAP592U Online

SQL - ENTAAP613U ENTAAP592U Online

SQL - ENTAAP596U ENTAAP592U Online

Guess we want to retrieve the State too.

Q: selects “State from MSCluster_Node” of wmi “root\MSCluster”

A: State=0

A: State=0

StateUnknown

-1

Up

0

Down

1

Paused

2

Joining

3

Afraid my relevance isn’t up to parsing all these together in a usable format but I’ll have a go! :slight_smile:

Cheers

(imported comment written by BenKus)

This might get you part of the way there:

(string value of property “PartComponent” of it, string value of property “GroupComponent” of it ) of select objects “PartComponent, GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”

But I can’t bring in the “MSCluster_Node” status unless I know how to relate the two… Can you send me the results of

selects “* from MSCluster_Node” of wmi “root\MSCluster”

Ben

(imported comment written by Steve91)

Results of both queries here Ben:

Q: (string value of property “PartComponent” of it, string value of property “GroupComponent” of it ) of select objects “PartComponent, GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”

A: MSCluster_ResourceGroup.Name=“Cluster Group”, MSCluster_Node.Name=“ENTAAP592U”

A: MSCluster_ResourceGroup.Name=“SQL - ENTAAP597U”, MSCluster_Node.Name=“ENTAAP592U”

A: MSCluster_ResourceGroup.Name=“SQL - ENTAAP614U”, MSCluster_Node.Name=“ENTAAP592U”

A: MSCluster_ResourceGroup.Name=“SQL - ENTAAP599U”, MSCluster_Node.Name=“ENTAAP592U”

A: MSCluster_ResourceGroup.Name=“MSDTC”, MSCluster_Node.Name=“ENTAAP593U”

A: MSCluster_ResourceGroup.Name=“SQL - ENTAAP612U”, MSCluster_Node.Name=“ENTAAP592U”

A: MSCluster_ResourceGroup.Name=“SQL - ENTAAP598U”, MSCluster_Node.Name=“ENTAAP592U”

A: MSCluster_ResourceGroup.Name=“SQL - ENTAAP613U”, MSCluster_Node.Name=“ENTAAP592U”

A: MSCluster_ResourceGroup.Name=“SQL - ENTAAP596U”, MSCluster_Node.Name=“ENTAAP592U”

And…

Q: selects “* from MSCluster_Node” of wmi “root\MSCluster”

A: BuildNumber=3790

A: Caption

A: Characteristics=0

A: CreationClassName

A: CSDVersion

A: Dedicated

A: Description=

A: EnableEventLogReplication=1

A: Flags=0

A: IdentifyingDescriptions

A: InitialLoadInfo

A: InstallDate

A: LastLoadInfo

A: MajorVersion=5

A: MinorVersion=2

A: Name=ENTAAP592U

A: NameFormat

A: NodeHighestVersion=265934

A: NodeLowestVersion=198803

A: OtherIdentifyingInfo

A: PowerManagementCapabilities

A: PowerManagementSupported

A: PowerState

A: PrimaryOwnerContact

A: PrimaryOwnerName

A: ResetCapability

A: Roles

A: State=0

A: Status

A: BuildNumber=3790

A: Caption

A: Characteristics=0

A: CreationClassName

A: CSDVersion

A: Dedicated

A: Description=

A: EnableEventLogReplication=1

A: Flags=0

A: IdentifyingDescriptions

A: InitialLoadInfo

A: InstallDate

A: LastLoadInfo

A: MajorVersion=5

A: MinorVersion=2

A: Name=ENTAAP593U

A: NameFormat

A: NodeHighestVersion=265934

A: NodeLowestVersion=198803

A: OtherIdentifyingInfo

A: PowerManagementCapabilities

A: PowerManagementSupported

A: PowerState

A: PrimaryOwnerContact

A: PrimaryOwnerName

A: ResetCapability

A: Roles

A: State=0

A: Status

Cheers

Steve

(imported comment written by BenKus)

Hey Steve,

Well this is certainly a challenge because I can’t really test what I am building… but hopefully it will only be a few more iterations… As the next step, please ensure that this works. It should return: Group Name, Node Name:

Q: ((substring between “%22” of item 0 of it, substring between “%22” of item 1 of it) of (string value of property “PartComponent” of it, string value of property “GroupComponent” of it ) of select objects “PartComponent, GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”)

And then this should return: Node Name, State:

Q: (string value of property “Name” of it, ((if (it="-1") then “StateUnknown” else if (it=“0”) then “Up” else if (it=“1”) then “Down” else if (it=“2”) then “Paused” else if (it=“3”) then “Joining” else “relevance unknown”) of (string value of property “State” of it))) of select objects “Name, State from MSCluster_Node” of wmi “root\MSCluster”

I can combine these, but I have a question… It seems that the query you gave gives me “Node state”, but the “Cluster Group” command you showed earlier gives the “Group state”… Which one are you looking for (and if it is group, then we haven’t figured out how to look that up yet).

Ben

(imported comment written by Steve91)

Cheers Ben

1st query:

Q: ((substring between “%22” of item 0 of it, substring between “%22” of item 1 of it) of (string value of property “PartComponent” of it, string value of property “GroupComponent” of it ) of select objects “PartComponent, GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”)

A: Cluster Group, ENTAAP592U

A: SQL - ENTAAP597U, ENTAAP592U

A: SQL - ENTAAP614U, ENTAAP592U

A: SQL - ENTAAP599U, ENTAAP592U

A: MSDTC, ENTAAP593U

A: SQL - ENTAAP612U, ENTAAP592U

A: SQL - ENTAAP598U, ENTAAP592U

A: SQL - ENTAAP613U, ENTAAP592U

A: SQL - ENTAAP596U, ENTAAP592U

2nd Query:

Q: (string value of property “Name” of it, ((if (it="-1") then “StateUnknown” else if (it=“0”) then “Up” else if (it=“1”) then “Down” else if (it=“2”) then “Paused” else if (it=“3”) then “Joining” else “relevance unknown”) of (string value of property “State” of it))) of select objects “Name, State from MSCluster_Node” of wmi “root\MSCluster”

A: ENTAAP592U, Up

A: ENTAAP593U, Up

Ideally the most important thing to retrieve is the “Group/Reousrce State” as returned via the cluster group command.

If both could be returned then great but I’d be more concerned with the state of the resource.

Thanks

Steve

(imported comment written by BenKus)

Try this and see if it is what you were looking for:

Q: (item 0 of item 0 of it, item 1 of item 0 of it, item 1 of item 1 of it) of (((substring between “%22” of item 0 of it, substring between “%22” of item 1 of it) of (string value of property “PartComponent” of it, string value of property “GroupComponent” of it ) of select objects “PartComponent, GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”),((string value of property “Name” of it, ((if (it="-1") then “StateUnknown” else if (it=“0”) then “Up” else if (it=“1”) then “Down” else if (it=“2”) then “Paused” else if (it=“3”) then “Joining” else “relevance unknown”) of (string value of property “State” of it))) of select objects “Name, State from MSCluster_Node” of wmi “root\MSCluster”)) whose (item 1 of item 0 of it = item 0 of item 1 of it)

Ben

1 Like

(imported comment written by Steve91)

Perfect:

Q: (item 0 of item 0 of it, item 1 of item 0 of it, item 1 of item 1 of it) of (((substring between “%22” of item 0 of it, substring between “%22” of item 1 of it) of (string value of property “PartComponent” of it, string value of property “GroupComponent” of it ) of select objects “PartComponent, GroupComponent from MSCluster_NodeToActiveGroup” of wmi “root\MSCluster”),((string value of property “Name” of it, ((if (it="-1") then “StateUnknown” else if (it=“0”) then “Up” else if (it=“1”) then “Down” else if (it=“2”) then “Paused” else if (it=“3”) then “Joining” else “relevance unknown”) of (string value of property “State” of it))) of select objects “Name, State from MSCluster_Node” of wmi “root\MSCluster”)) whose (item 1 of item 0 of it = item 0 of item 1 of it)

A: Cluster Group, ENTAAP592U, Up

A: SQL - ENTAAP597U, ENTAAP592U, Up

A: SQL - ENTAAP614U, ENTAAP592U, Up

A: SQL - ENTAAP599U, ENTAAP592U, Up

A: MSDTC, ENTAAP593U, Up

A: SQL - ENTAAP612U, ENTAAP592U, Up

A: SQL - ENTAAP598U, ENTAAP592U, Up

A: SQL - ENTAAP613U, ENTAAP592U, Up

A: SQL - ENTAAP596U, ENTAAP592U, Up

Thanks for the time you’ve put into this Ben!!

Steve

(imported comment written by thesurg3on91)

Ben,

this is awesome, in the in Bigfix, it show , is there a way to have the list comma delimited so that i can move the column over and see the details?