Function DebugMsg(TextMsg)
Dim strText
Dim systemDrive
Dim tempFilePath
Dim wshShell
Dim CurrentDateTime
Dim NumArgs
Dim severity
Dim sevDesc
Set objShell = CreateObject("Wscript.Shell")
Const PROGRAM_FILES = &H26&
strSystemDrive = objShell.ExpandEnvironmentStrings("%SystemDrive%")
strtestFilePath = strSystemDrive & "\Program Files (x86)\"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(strtestFilePath) Then
win64 = false
test = "32bit"
Else
win64 = true
test = "64bit"
End If
if win64 then
strRegistryKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Hewlett-Packard\HP Storage Management Pack for System Center\InstallPath"
else
strRegistryKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Hewlett-Packard\HP Storage Management Pack for System Center\InstallPath"
end if
Set WSHShell = CreateObject("WScript.Shell")
strInstallDir = WSHShell.RegRead( strRegistryKey )
'strText = "DebugMsg: " + TextMsg
CurrentDate = Now
strText = "DebugMsg: " & FormatDateTime(CurrentDate, 0) & ":" & TextMsg
'strText = test & ":" & strInstallDir
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
set wshshell = CreateObject("WScript.Shell")
systemDrive = wshshell.ExpandEnvironmentStrings("%SystemDrive%")
tempFilePath = strInstallDir + "\HPEStoreOnce.log"
Set objTextFile = objFSO.OpenTextFile(tempFilePath, 8, True)
objTextFile.WriteLine(strText)
objTextFile.Close
End Function
Function HexOIDToAscii(var_hex, format)
Dim k, v
HexOIDToAscii = ""
For k = 1 To Len(var_hex) Step 2
v = CInt("&H" & Mid(var_hex, k, 2))
If ((v>31) And (v<128)) Then
HexOIDToAscii = HexOIDToAscii & (chr(v))
Else
If (format) Then
Select Case v
Case 8
HexOIDToAscii= HexOIDToAscii & vbTab
Case 10
HexOIDToAscii = HexOIDToAscii & vbCrLf
Case 13
Case Else
HexOIDToAscii = HexOIDToAscii & "."
End Select
Else
HexOIDToAscii = HexOIDToAscii & "."
End If
End If
Next
HexOIDToAscii = mid(HexOIDToAscii,2,len(HexOIDToAscii))
End Function
Function HexStrToAscii(var_hex, format)
Dim k, v
HexStrToAscii = ""
For k = 1 To Len(var_hex) Step 2
v = CInt("&H" & Mid(var_hex, k, 2))
If ((v>31) And (v<128)) Then
HexStrToAscii = HexStrToAscii & (chr(v))
Else
If (format) Then
Select Case v
Case 8
HexStrToAscii = HexStrToAscii & vbTab
Case 10
HexStrToAscii = HexStrToAscii & vbCrLf
Case 13
Case Else
HexStrToAscii = HexStrToAscii & "."
End Select
Else
HexStrToAscii = HexStrToAscii & "."
End If
End If
Next
End Function
intT2 = intT2 + 1
If(Instr(strT2,"key:")) Then
tmpArr3(intT4) = ""
Else
tmpArr3(intT4) = strT2
End If
intT4 = intT4 + 1
End If
Next
intT1 = Ubound(tmpArr2)
For intT2 = 0 to intT1
if(tmpArr2(intT2) = "") then
t = 0
else
DebugMsg(tmpArr2(intT2))
if(tmpArr2(intT2) = "hpHttpMgDeviceSysObjID") then
strV = HexOIDToAscii(tmpArr3(intT2),true)
if( strV = "1.3.6.1.4.1.11.10.3.1.3.27") then
flag = 1
else
flag = 0
end if
end if
end if
Next
if(flag) then
For intT2 = 0 to intT1
if(tmpArr2(intT2) = "") then
t = 0
else
if(instr(tmpArr2(intT2),"hpHttpMg")) then
str = tmpArr2(intT2)
strV = tmpArr3(intT2)
intT5 = Instr(str,"hpHttpMg")
tmpArr2(intT2) = Mid(str, intT5 + 8)
if(tmpArr2(intT2) = "DeviceSysObjID") then
tmpArr3(intT2) = HexOIDToAscii(strV,true)
elseif(tmpArr2(intT2) = "DeviceIndex") then
tmpArr3(intT2) = strV
else
tmpArr3(intT2)= HexStrToAscii(strV,true)
end if
end if
If(Trim(tmpArr3(intT2)) <> "" And tmpArr3(intT2) <> "null" And Not IsNull(tmpArr3(intT2))) Then
desc = desc & vbLf & tmpArr2(intT2) & ": " & tmpArr3(intT2)
Call oBag.AddValue(tmpArr2(intT2), tmpArr3(intT2))
end if
end if
Next
severity = EVENT_TYPE_INFORMATION
DebugMsg(desc)
if(severity = EVENT_TYPE_WARNING) then
Call oAPI.LogScriptEvent("", 104, severity, desc)
end if
if(severity = EVENT_TYPE_ERROR) then
Call oAPI.LogScriptEvent("", 104, severity, desc)
end if
Call oBag.AddValue("EventLevel", severity)
Call oAPI.AddItem(oBag)
set oBag = nothing
Call oAPI.ReturnItems()
end if </Script></ScriptBody>
<TimeoutSeconds>60</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="HPStoreOncePropertyBagProbe_OK">
<Node ID="HPStoreOnceNotify_OK"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>