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

38
' if we get here w/o Exiting: then the resource wasn't found
checkResource = False
End Function
Public Function verifySvc( svcName, hostName )
On Error Resume Next
Dim objLocator, objService
Dim objMySvc, colSvcs
WMIconnect hostname, objService
Set colSvcs = objService.ExecQuery("Select * from Win32_Service Where Name = '" &
svcName & "'")
'WScript.Echo "Err: " & Err.Number
&
Err.Description
If colSvcs.Count < 1 Then
WarnMsg "Missing required
serivce
'"
&_
svcName
&_
"' on node "
&
hostName
Else For Each objMySvc in colSvcs
If objMySvc.Name = svcName Then
WScript.Echo "OK! -
'"
&
_
objMySvc.DisplayName
&
_
"' in state '" & objMySvc.State &_
"'
on
node
" & hostName
End
If
Else
End
if
Next
Exit Function
Err.Raise(999)
Exit Function
'WScript.Echo "Exit verify Svc:" & objMySvc 'DEBUG
End Function
Public Function WMIconnect( hostName, objWMI )
On Error Resume Next
Dim objLocator, objService
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMI = objLocator.ConnectServer(hostName, "root\cimv2",,,,,128)
if Err.Number <>
0
then
' WScript.Echo "Err Connect: " & Err.Number & Err.Description
ErrorCheck "ConnectServer", Err.Description
exit function
end if
objWMI.Security_.ImpersonationLevel = 3
End Function
Public Function getdiskSig( driveLtr, disksig )
DIM hostname,
objWMIService,
WMIquery
DIM objPartitions, objPartition
DIM objDisks, objDisk
hostname
=
"."
WMIconnect hostname, objWMIService
WMIquery = "WIN32_LogicalDisk.DeviceID='" & driveLtr & "'"
Set objPartitions = objWMIService.AssociatorsOf (WMIquery,,"Win32_DiskPartition")
Errorcheck "objPartitions", Err.Description
If objPartitions.count > 1 Then
Err.Number = 999
Errorcheck "objPartitions", "More partitions retrieved than expected."
End If