Using HP Insight Software from a Highly Available Central Management Server with Microsoft Cluster Service

26
HA-VSE_common.vbs
The HA-VSE_common.vbs script file contains global data and common functions used by the cluster
resources creation script, HA-VSE_script.wsf.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' HA-VSE_common.vbs
'
' Contains global data and common functions.
'
' © Copyright 2008 Hewlett-Packard Development Company, L.P.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Public objCluster, arrCluRes(), iWarn
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Common warning routine. Keeps track if a prereq is missing
'
Public Function WarnMsg( strWarn )
WScript.Echo "WARNING - " & strWarn
iWarn = iWarn + 1
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Common error catching and reporting routine
'
Public Function ErrorCheck( strTask, strDesc )
'On Error Resume Next
'Wscript.Echo "Error Checking " & offset & " " & strTask & " " & strDesc ' DEBUG
If Err.Number <> 0 Then
Wscript.Echo "Error# " _
& Err.Number & ": " _
& strTask & " - " & strDesc
iWarn = iWarn + 1
Wscript.Echo
End If
Err.Clear
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Array manipulation
'
Public Function invertHash( ByRef hash, ByRef inverted )
On Error Resume Next
Dim key
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()
'