用于 Lfx 工作流监视的 OleDb 探测
Microsoft.SystemCenter.ServiceManager.Monitoring.OledbProbe.LfxWorkflows (DataSourceModuleType)
此数据源模块连接到 Service Manager 数据库,用于 Lfx 工作流监视。
Element properties:
Member Modules:
Overrideable Parameters:
Source Code:
<DataSourceModuleType ID="Microsoft.SystemCenter.ServiceManager.Monitoring.OledbProbe.LfxWorkflows" Accessibility="Internal" RunAs="SM!Microsoft.SystemCenter.ServiceManager.DatabaseWriteActionAccount" Batching="false">
<Configuration>
<xsd:element name="IntervalSeconds" type="xsd:integer"/>
<xsd:element name="SyncTime" type="xsd:string"/>
<xsd:element name="ConnectionString" type="xsd:string"/>
<xsd:element name="Query" type="xsd:string"/>
<xsd:element name="GetValue" type="xsd:boolean"/>
<xsd:element name="IncludeOriginalItem" type="xsd:boolean"/>
<xsd:element name="OneRowPerItem" type="xsd:boolean"/>
</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="Scheduler" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
</DataSource>
<ProbeAction ID="SQLProbe" TypeID="System!System.OleDbProbe">
<ConnectionString>Provider=SQLOLEDB;Server=$Target/Property[Type='SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer']/SmDbHostName$;Database=$Target/Property[Type='SM!Microsoft.SystemCenter.ServiceManager.SmManagementServer']/SMDbName$;Integrated Security=SSPI</ConnectionString>
<Query>
declare @TableName sysname;
declare @StatusColumn sysname;
declare @StartTimeColumn sysname;
declare @Query varchar(max);
select @TableName = MT.ManagedTypeTableName,
@StatusColumn = MTP1.ColumnName,@StartTimeColumn = MTP2.ColumnName from ManagedType MT
inner join ManagedTypeProperty MTP1
on MT.ManagedTypeId = MTP1.ManagedTypeId
inner join ManagedTypeProperty MTP2
on MT.ManagedTypeId = MTP2.ManagedTypeId
where MT.TypeName = N'Microsoft.SystemCenter.LinkingFramework.SyncStatus'
and MTP1.ManagedTypePropertyName = N'Status'
and MTP2.ManagedTypePropertyName = N'LastRunStartTime'
SET @Query = N'select Etype.EnumTypeName, (DATEDIFF(MINUTE, BME.TimeAdded' +
', GETUTCDATE())),CONVERT(nvarchar(4000),BME.DisplayName) from dbo.EnumType Etype join ' + @TableName +
' SyncStatus on Etype.EnumTypeId = SyncStatus.' + @StatusColumn +
' join dbo.Relationship Rel on Rel.TargetEntityId = SyncStatus.BaseManagedEntityId join dbo.BaseManagedEntity BME '+
'on BME.BaseManagedEntityId = Rel.SourceEntityId'
EXEC (@Query)
</Query>
<GetValue>$Config/GetValue$</GetValue>
<IncludeOriginalItem>$Config/IncludeOriginalItem$</IncludeOriginalItem>
<OneRowPerItem>$Config/OneRowPerItem$</OneRowPerItem>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="SQLProbe">
<Node ID="Scheduler"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.OleDbData</OutputType>
</DataSourceModuleType>