HPEnterpriseStorageHPMSA.msaEventResolvedTrapV1NotificationType_Notification (DataSourceModuleType)

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
HPMSANotify_INFO DataSource Microsoft.Windows.WmiEventProvider.EventProvider Default
HPMSAPropertyBagProbe_INFO ProbeAction Microsoft.Windows.ScriptPropertyBagProbe Default

Overrideable Parameters:

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

Source Code:

<DataSourceModuleType ID="HPEnterpriseStorageHPMSA.msaEventResolvedTrapV1NotificationType_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="HPMSANotify_INFO" TypeID="Windows!Microsoft.Windows.WmiEventProvider.EventProvider">
<NameSpace>root\snmp\localhost</NameSpace>
<Query>SELECT * FROM SNMP_MSA2000TRAPS_MIB_msaEventResolvedTrapV1NotificationType_Notification</Query>
<PollInterval>180</PollInterval>
</DataSource>
<ProbeAction ID="HPMSAPropertyBagProbe_INFO" TypeID="Windows!Microsoft.Windows.ScriptPropertyBagProbe">
<ScriptName>Sbtespb.vbs</ScriptName>
<Arguments>"key:CLASS" "$Data/EventData/DataItem/Property[@Name='__CLASS']$" "key:AgentAddress" "$Data/EventData/DataItem/Property[@Name='AgentAddress']$" "key:connUnitEventDescr" "$Data/EventData/DataItem/Property[@Name='connUnitEventDescr']$" "key:connUnitEventId" "$Data/EventData/DataItem/Property[@Name='connUnitEventId']$" "key:connUnitEventType" "$Data/EventData/DataItem/Property[@Name='connUnitEventType']$"</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 + "\HPEMSA.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)
'Remove the for loop - Check with Manju
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),"connUnit")) then
str = tmpArr2(intT2)
strV = tmpArr3(intT2)
intT5 = Instr(str,"connUnit")
tmpArr2(intT2) = Mid(str, intT5 + 8)
'Remove 6 lines below - Check with the team
if(tmpArr2(intT2) = "DeviceSysObjID") then
tmpArr3(intT2) = HexOIDToAscii(strV,true)
DebugMsg("Begin_ latest Warning 9")
'elseif(tmpArr2(intT2) = "EventDescr") then
' DebugMsg("Begin_ latest Warning 10*1" &amp; strV)
' DebugMsg("Begin_ latest Warning 10*2" &amp; tmpArr2(intT2))
' tmpArr3(intT2)= HexStrToAscii(strV,true)
' DebugMsg("Begin_ latest Warning 10*3" &amp; strV)
'tmpArr3(intT2) = strV
else
tmpArr3(intT2) = strV
DebugMsg("Begin_ latest Warning 11" &amp; strV)
'tmpArr3(intT2)= HexStrToAscii(strV,true)

'elseif(tmpArr2(intT2) = "DeviceIndex") then
' tmpArr3(intT2) = strV
'else
' tmpArr3(intT2)= HexStrToAscii(strV,true)
end if
end if
desc = desc &amp; vbLf &amp; tmpArr2(intT2) &amp; ": " &amp; tmpArr3(intT2)
Call oBag.AddValue(tmpArr2(intT2), tmpArr3(intT2))
end if
Next

severity = EVENT_TYPE_INFORMATION


DebugMsg(desc)
if(severity = EVENT_TYPE_WARNING) then
Call oAPI.LogScriptEvent("", 108, severity, desc)
end if

if(severity = EVENT_TYPE_ERROR) then
Call oAPI.LogScriptEvent("", 108, 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="HPMSAPropertyBagProbe_INFO">
<Node ID="HPMSANotify_INFO"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>