HPEnterpriseStorageXP9000MP.raideventUseracute_Notification (DataSourceModuleType)

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
HPXP9000_raideventUseracute DataSource Microsoft.Windows.WmiEventProvider.EventProvider Default
HPXP9000_raideventUseracute_PropertyBagProbe ProbeAction Microsoft.Windows.ScriptPropertyBagProbe Default

Overrideable Parameters:

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

Source Code:

<DataSourceModuleType ID="HPEnterpriseStorageXP9000MP.raideventUseracute_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="HPXP9000_raideventUseracute" TypeID="Windows!Microsoft.Windows.WmiEventProvider.EventProvider">
<NameSpace>root\snmp\localhost</NameSpace>
<Query>SELECT * FROM SNMP_USPMIB_raideventUseracuteV1NotificationType_Notification</Query>
<PollInterval>180</PollInterval>
</DataSource>
<ProbeAction ID="HPXP9000_raideventUseracute_PropertyBagProbe" TypeID="Windows!Microsoft.Windows.ScriptPropertyBagProbe">
<ScriptName>XP9000raideventUseracute.vbs</ScriptName>
<Arguments>"key:CLASS" "$Data/EventData/DataItem/Property[@Name='__CLASS']$" "key:Agent Address" "$Data/EventData/DataItem/Property[@Name='AgentAddress']$" "key:EventTrapREFCODE" "$Data/EventData/DataItem/Property[@Name='eventTrapREFCODE']$" "key:EventTrapDescription" "$Data/EventData/DataItem/Property[@Name='eventTrapDescription']$" "key:eventTrapSerialNumber" "$Data/EventData/DataItem/Property[@Name='eventTrapSerialNumber']$" "key:EventTrapNickname" "$Data/EventData/DataItem/Property[@Name='eventTrapNickname']$" "key:EventTrapPartsID" "$Data/EventData/DataItem/Property[@Name='eventTrapPartsID']$" "key:EventTrapDate" "$Data/EventData/DataItem/Property[@Name='eventTrapDate']$" "key:EventTrapTime" "$Data/EventData/DataItem/Property[@Name='eventTrapTime']$"</Arguments>
<ScriptBody><Script>
Dim oAPI
Dim tmpArr1(50)
Dim tmpArr2(25)
Dim tmpArr3(25)
Dim intT1, intT2, intT3, strT1, intT4, strT2
Dim intT5, intT6

Const XP12000 = "1.3.6.1.4.1.11.10.2.1.13.5"
Const CVXP = "1.3.6.1.4.1.11.10.2.1.14"
Const XP1024SVP = "RAID450"
Const XP12000SVP = "RAID500"
Const XP24000SVP = "RAID600"
Const P9500 = "RAID700"

Dim RSIMFILE

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 )

CurrentDate = Now
strText = "DebugMsg: " &amp; FormatDateTime(CurrentDate, 0) &amp; ":" &amp; TextMsg

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
set wshshell = CreateObject("WScript.Shell")

systemDrive = wshshell.ExpandEnvironmentStrings("%SystemDrive%")
tempFilePath = strInstallDir + "\HPEXP9000.log"
Set objTextFile = objFSO.OpenTextFile(tempFilePath, 8, True)
objTextFile.WriteLine(strText)
objTextFile.Close
End Function

Function XPType(deviceOid)

XPType = null

Select Case deviceOid
Case CVXP XPType = "CVXP"
DebugMsg("XPType Entry1")
Case XP1024SVP XPType = "XP1024"
RSIMFILE = "XP128RSimFile.txt"
DebugMsg("XPType Entry5")
Case XP12000SVP XPType = "XP12000"
RSIMFILE = "XP2048RSimFile.txt"
Case XP24000SVP XPType = "XP24000"
DebugMsg("XPType Entry7")
Case P9500 XPType = "P9500"
DebugMsg("XPType Entry8")
End Select
DebugMsg("XPType Entry..." &amp; deviceoid &amp; XPType &amp; RSIMFILE)

End Function

Function RefcodeToDescMapping(Refcode)

Const ForReading = 1, ForWriting = 2
dim fso, MyFile
dim lines()
dim errorstring
Dim oRe
dim i

dim found, k, j
dim pattern
'Refcode = "BF1211"
pattern = Refcode

'RSIMFILE = "XP2048RSimFile.txt"

'dim found
found = 0

i = 0

Dim systemDrive
Dim testFilePath
Dim tempFilePath
Dim programFilesPath
Dim wshShell


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 )


tempFilePath = strInstallDir &amp; "\\RefCodeToErrorMsg.conf"


Set MyFile = fso.OpenTextFile(tempFilePath, ForReading, True)



while not MyFile.atEndOfStream
redim preserve lines(i)
lines(ubound(lines)) = Myfile.readline
'wscript.echo lines(i)
'wscript.echo "next"
i = i+1
wend


Myfile.close


Set oRe = CreateObject("VBScript.RegExp")
oRe.Global = True
oRe.Multiline = True




tempFilePath = strInstallDir
Set MyFile = fso.OpenTextFile(tempFilePath &amp; RSIMFILE, ForReading, True)
pattern = "Refcode=" &amp; Refcode
dim singleline()

i=0


while not MyFile.atEndOfStream
redim preserve singleline(i)
singleline(ubound(singleline)) = Myfile.readline
i = i+1
wend

for k = len(pattern) to 10 step -1
for j = 0 to i-1 step 1

oRe.pattern = pattern
if oRe.Test(singleline(j)) then


errorstring = split(singleline(j+2), "=", 2)

RefcodeToDescMapping = trim(errorstring(1))
'wscript.echo RefcodeToDescMapping

exit function
end if
next


pattern = left(pattern, k-1)
next

RefcodeToDescMapping = ""

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)
Call oBag.AddValue("EventSource", "HPE XP 9000")
For intT2 = 0 to intT1
if(tmpArr2(intT2) = "") then
t = 0
else
desc = desc &amp; vbLf &amp; tmpArr2(intT2) &amp; ": " &amp; tmpArr3(intT2)
Call oBag.AddValue(tmpArr2(intT2), tmpArr3(intT2))
end if
Next

severity = EVENT_TYPE_ERROR
if(severity = EVENT_TYPE_ERROR) then
Call oAPI.LogScriptEvent("", 116, severity, desc)
end if

Call oBag.AddValue("EventLevel", severity)



Call oAPI.AddItem(oBag)
set oBag = nothing
Call oAPI.ReturnItems()



</Script></ScriptBody>
<TimeoutSeconds>60</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="HPXP9000_raideventUseracute_PropertyBagProbe">
<Node ID="HPXP9000_raideventUseracute"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>