Installing and upgrading to HP Insight Software 6.0 on Windows Server 2003 R2 MSCS for high availability

37
For Each key In hash.Keys
inverted.Add hash(key), key
Next
End Function
''''''''''''''''''''''''''''''''''''''''''''''
' Connect and define cluster object class
'
Public Sub cluConnect(cluHost, objCluster)
'
' Purpose: to connect to cluster on host and instantiate cluster object.
' If no host name, then "this host" where script is running
' is default.
'
Set objCluster = CreateObject("MSCluster.Cluster")
objCluster.Open cluHost
End Sub
Public Function cluDisconnect()
'
' Dereferences global objects. Used with cluConnect.
'
Set objCluster = Nothing
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub cluEnumNodes(cluster, nodes)
'
' Purpose: list all nodes configured in cluster definition.
' If no cluster name, then "this cluster" is default.
'
Dim objNode
ReDim
nodes(0)
Dim
n
n = 0
for each objNode in cluster.Nodes
nodes(n) = objNode.Name
n = n + 1
ReDim Preserve nodes(n)
next
End Sub
Public Function getClusterResources
'On Error Resume Next
Dim collCluResources, counter, res, obj, cluNumRes
Set collCluResources = objCluster.Resources
cluNumRes = collCluResources.Count
'Wscript.Echo "Found " & cluNumRes & " Resources" 'DEBUG
ReDim arrCluRes(cluNumRes)
For counter = 1 to cluNumRes
Set res = collCluResources.Item(counter)
arrCluRes(counter) = res.Name
'WScript.Echo "Resource: " & arrCluRes(counter) 'DEBUG
Next
End Function
Public Function checkResource( resName )
On Error Resume Next
Dim cluRes
For Each cluRes In arrCluRes
If resName = cluRes Then
'Wscript.Echo "Found " & resName & " in resource array" 'DEBUG
checkResource = True
Exit Function
Next
End If