A9000/R Event Data Source Module

IBM.Storage.A9000R.EventDataSourceModuleType (DataSourceModuleType)

A9000/R Event Data Source.

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
Scheduler DataSource System.Scheduler Default
EventScript ProbeAction System.CommandExecuterProbePropertyBagBase Default
Filter ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
IntervalSecondsint$Config/IntervalSeconds$Interval Seconds
TimeoutSecondsint$Config/TimeoutSeconds$Timeout Seconds

Source Code:

<DataSourceModuleType ID="IBM.Storage.A9000R.EventDataSourceModuleType" Accessibility="Public" Batching="false">
<Configuration>
<xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element minOccurs="1" name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element minOccurs="1" name="InstancePropertyValue" type="xsd:string"/>
<xsd:element minOccurs="1" name="SCOMSeverity" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval>$Config/IntervalSeconds$</Interval>
</SimpleReccuringSchedule>
<ExcludeDates/>
</Scheduler>
</DataSource>
<ProbeAction ID="EventScript" TypeID="System!System.CommandExecuterProbePropertyBagBase">
<ApplicationName>%SystemDrive%\Program Files\IBM\Storage\Host\IBMStorageSCOM\xpyv\python.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>.\a9000reventprovider.py</CommandLine>
<SecureInput/>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>a9000reventprovider.py</Name>
<Contents><Script>
import os
import sys
import glob

sys_drive = os.getenv("SystemDrive")
_main_part = "/Program Files/IBM/Storage/Host/IBMStorageSCOM"
_root_path = "%s/%s" % (sys_drive, _main_part)
for egg_path in glob.glob("%s/lib/*.egg" % _root_path):
sys.path.insert(0, egg_path)

import pywintypes, pythoncom, win32com.client
script_name = "IBM::a9000reventprovider.py"
EVENTID_INFOR = 600
EVENTID_ERROR = 700
SEVERITY_INFOR = 4
SEVERITY_ERROR = 1
scom_script_api = win32com.client.Dispatch("MOM.ScriptAPI")
scom_script_api.LogScriptEvent( script_name, EVENTID_INFOR, SEVERITY_INFOR, "A9000R event collecting begin. " )

try:
import scom_lib
from scom_lib import *
from scom_lib.A9000REventCollector import *

host_url = r"$Target/Host/Property[Type='IBM.Storage.A9000R.Configuration']/HostURL$"
eventCollector = A9000REventCollector(root_path = _root_path, scomapi = scom_script_api)
eventCollector.collect(host_url)

scom_script_api.LogScriptEvent( script_name, EVENTID_INFOR, SEVERITY_INFOR, "A9000/R event collecting end. " )
except Exception, e:
import traceback
exc_type, exc_value, exc_traceback = sys.exc_info()
error_stack = ''.join(traceback.format_exception(exc_type, exc_value, exc_traceback))
scom_script_api.LogScriptEvent(script_name, EVENTID_ERROR, SEVERITY_ERROR, "A9000/R event collecting error: %s\n %s" % (e, error_stack))
error_log = open('%s/log/a9000r_event_error.log' % _root_path, 'a')
traceback.print_exc(file=error_log)
error_log.close()

</Script></Contents>
<Unicode>false</Unicode>
</File>
</Files>
<OutputType>System.PropertyBagData</OutputType>
</ProbeAction>
<ConditionDetection ID="Filter" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='device_id']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/InstancePropertyValue$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='scom_severity']</XPathQuery>
</ValueExpression>
<Operator>Less</Operator>
<ValueExpression>
<Value Type="String">$Config/SCOMSeverity$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="Filter">
<Node ID="EventScript">
<Node ID="Scheduler"/>
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>