HPEnterpriseStorageHPStoreOnce.hpHttpMgUnknownHealthTrap_Notification (DataSourceModuleType)

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
HPStoreOnceNotify_UNKNOWN DataSource Microsoft.Windows.WmiEventProvider.EventProvider Default
HPStoreOncePropertyBagProbe_UNKNOWN ProbeAction Microsoft.Windows.ScriptPropertyBagProbe Default

Overrideable Parameters:

IDParameterTypeSelector
IntervalSecondsint$Config/IntervalSeconds$
SyncTimestring$Config/SyncTime$

Source Code:

<DataSourceModuleType ID="HPEnterpriseStorageHPStoreOnce.hpHttpMgUnknownHealthTrap_Notification" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element minOccurs="1" name="SyncTime" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="HPStoreOnceNotify_UNKNOWN" TypeID="Windows!Microsoft.Windows.WmiEventProvider.EventProvider">
<NameSpace>root\snmp\localhost</NameSpace>
<Query>SELECT * FROM SNMP_SEMI_MIB_hpHttpMgUnknownHealthTrap_Notification</Query>
<PollInterval>180</PollInterval>
</DataSource>
<ProbeAction ID="HPStoreOncePropertyBagProbe_UNKNOWN" TypeID="Windows!Microsoft.Windows.ScriptPropertyBagProbe">
<ScriptName>Sbtespb.vbs</ScriptName>
<Arguments>"key:CLASS" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='__CLASS']$" "key:AgentAddress" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='AgentAddress']$" "key:hpHttpMgDeviceIndex" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='hpHttpMgDeviceIndex']$" "key:hpHttpMgDeviceManagementURL" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='hpHttpMgDeviceManagementURL']$" "key:hpHttpMgDeviceManagementURLLabel" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='hpHttpMgDeviceManagementURLLabel']$" "key:hpHttpMgDeviceSpecificEventCode" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='hpHttpMgDeviceSpecificEventCode']$" "key:hpHttpMgDeviceSpecificFRU" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='hpHttpMgDeviceSpecificFRU']$" "key:hpHttpMgDeviceSysObjID" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='hpHttpMgDeviceSysObjID']$" "key:TIME_CREATED" "$Data[Default='6E756C6C']/EventData/DataItem/Property[@Name='TIME_CREATED']$"</Arguments>
<ScriptBody><Script>
Dim oAPI
Dim tmpArr1(50)
Dim tmpArr2(25)
Dim tmpArr3(25)
Dim intT1, intT2, intT3, strT1, intT4, strT2
Dim intT5, intT6

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 = &amp;H26&amp;
strSystemDrive = objShell.ExpandEnvironmentStrings("%SystemDrive%")
strtestFilePath = strSystemDrive &amp; "\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: " &amp; FormatDateTime(CurrentDate, 0) &amp; ":" &amp; TextMsg
'strText = test &amp; ":" &amp; 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("&amp;H" &amp; Mid(var_hex, k, 2))
If ((v&gt;31) And (v&lt;128)) Then
HexOIDToAscii = HexOIDToAscii &amp; (chr(v))
Else
If (format) Then
Select Case v
Case 8
HexOIDToAscii= HexOIDToAscii &amp; vbTab
Case 10
HexOIDToAscii = HexOIDToAscii &amp; vbCrLf
Case 13
Case Else
HexOIDToAscii = HexOIDToAscii &amp; "."
End Select
Else
HexOIDToAscii = HexOIDToAscii &amp; "."
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("&amp;H" &amp; Mid(var_hex, k, 2))


If ((v&gt;31) And (v&lt;128)) Then
HexStrToAscii = HexStrToAscii &amp; (chr(v))
Else
If (format) Then
Select Case v
Case 8
HexStrToAscii = HexStrToAscii &amp; vbTab
Case 10
HexStrToAscii = HexStrToAscii &amp; vbCrLf
Case 13
Case Else
HexStrToAscii = HexStrToAscii &amp; "."
End Select
Else
HexStrToAscii = HexStrToAscii &amp; "."
End If
End If
Next
End Function

Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Set oArgs = WScript.Arguments
DebugMsg("Begin")
intT1 = oArgs.Count
intT1 = intT1 - 1


For intT2 = 0 To intT1
tmpArr1(intT2) = oArgs(intT2)
Next

intT2 = 0
intT4 = 0

For intT3 = 0 To intT1

strT1 = tmpArr1(intT3)
strT2 = tmpArr1(intT3 + 1)
If(Instr(strT1,"key:")) Then
intT5 = Instr(strT1,"key:")
strT = Mid(strT1,intT5 + 4)
tmpArr2(intT2) = strT

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)) &lt;&gt; "" And tmpArr3(intT2) &lt;&gt; "null" And Not IsNull(tmpArr3(intT2))) Then
desc = desc &amp; vbLf &amp; tmpArr2(intT2) &amp; ": " &amp; tmpArr3(intT2)
Call oBag.AddValue(tmpArr2(intT2), tmpArr3(intT2))
end if

end if
Next

severity = EVENT_TYPE_ERROR


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_UNKNOWN">
<Node ID="HPStoreOnceNotify_UNKNOWN"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>