SVC Event DataSource

IBM.Storage.SVC.EventDataSource (DataSourceModuleType)

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

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

Overrideable Parameters:

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

Source Code:

<DataSourceModuleType ID="IBM.Storage.SVC.EventDataSource" 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"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval Unit="Seconds">$Config/IntervalSeconds$</Interval>
</SimpleReccuringSchedule>
<ExcludeDates/>
</Scheduler>
</DataSource>
<ProbeAction ID="script" TypeID="System!System.CommandExecuterProbePropertyBagBase">
<ApplicationName>%SystemDrive%\Program Files\IBM\Storage\Host\IBMStorageSCOM\xpyv\python.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>.\SVCEvent.py</CommandLine>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>SVCEvent.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::SVCEvent.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, "SVC event collecting begin. " )

try:
import scom_lib
from scom_lib import svc_discovery_helper
from scom_lib.svc_event_collector import SVCEventCollector
from scom_lib.policy import MPPolicy
from scom_lib.util import DEV_TYPE_SVC

svc_discovery_helper._root_path_main_part = _main_part
svc_discovery_helper.set_logger('svc', appendix = '_event')
host_url = r"$Target/Host/Property[Type='IBM.Storage.SVC.Configuration']/HostURL$"
mp_policy = MPPolicy(r'%s/config/policy.xml' % _root_path, create_file = True)
eventCollector = SVCEventCollector(scom_script_api, host_url, DEV_TYPE_SVC, 'event', mp_policy)
eventCollector.collect_event()

scom_script_api.LogScriptEvent( script_name, EVENTID_INFOR, SEVERITY_INFOR, "SVC 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, "SVC event collecting error: %s\n %s" % (e, error_stack))
error_log = open('%s/log/svc_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>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='ClusterID']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/InstancePropertyValue$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="Filter">
<Node ID="script">
<Node ID="Scheduler"/>
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>