Dear all,
I was previously working on checking servers in a cluster (ping test) to see if the servers in the cluster are active. I also implemented the advanced actions so that we only receive a warning when more then 1 node in the cluster is down. This thanks to the great respons on my "clustered Ping tests" topic.
Now i want to have an other test to see which node is the active and passive node in the cluster.
I have a 2 node cluster and when deploying security patches i need to know which node is the active one so i can deploy the the passive one first and then switch to the other node and patch the other one.
Regards,
Gerhard
Test to see active node in a cluster
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
I think, you may try to use "Shell Script" test method and cluster.exe command line utility to retrieve necessary information (e.g. cluster.exe NODE [node-name] /status ). On the another hand, you may try "WMI" test method using "MSCluster_Node" class: http://msdn2.microsoft.com/en-us/library/aa371446.aspx
Regards,
Max
Regards,
Max
I use an "Active Script" test. This is run by the RMA, so the 'objCluster.Open' statement is blank (meaning it will be the local cluster)
const statusAlive = "Host is alive:"
const statusDead = "No answer:"
const statusUnknown = "Unknown:"
const statusNotResolved = "Unknown host:"
const statusOk = "Ok:"
const statusBad = "Bad:"
const statusBadContents = "Bad contents:"
FUNCTION PerformTest()
Dim objCluster
Dim strTestname
Set objCluster = CreateObject("MSCluster.Cluster")
objCluster.Open ""
strOwner = objCluster.ResourceGroups.Item("Cluster Group").OwnerNode.Name
Set objCluster = Nothing
PerformTest = statusAlive & strOwner
END FUNCTION
Then, in my action profile, I do "'%Reply%' <> '%LastReply%'" and alert based on that.
const statusAlive = "Host is alive:"
const statusDead = "No answer:"
const statusUnknown = "Unknown:"
const statusNotResolved = "Unknown host:"
const statusOk = "Ok:"
const statusBad = "Bad:"
const statusBadContents = "Bad contents:"
FUNCTION PerformTest()
Dim objCluster
Dim strTestname
Set objCluster = CreateObject("MSCluster.Cluster")
objCluster.Open ""
strOwner = objCluster.ResourceGroups.Item("Cluster Group").OwnerNode.Name
Set objCluster = Nothing
PerformTest = statusAlive & strOwner
END FUNCTION
Then, in my action profile, I do "'%Reply%' <> '%LastReply%'" and alert based on that.