how to create datasouce/rule with Windows!Microsoft.Windows.EventPro vider-- help me!!!!!
hi here i create datasouce for one rule like below; <DataSourceModuleType ID="Monitoring.DataSourceTypes.Rule.PerformanceProvider" Accessibility="Public" Batching="false"> <Configuration> <IncludeSchemaTypes> <SchemaType>Windows!Microsoft.Windows.PowerShellSchema</SchemaType> </IncludeSchemaTypes> <xsd:element minOccurs="1" name="MeasureName" type="xsd:string" /> </Configuration> <ModuleImplementation Isolation="Any"> <Composite> <MemberModules> <DataSource ID="DS" TypeID="Monitoring.DataSourceTypes.Rule.EventDrivenWMIProvider"> <ComputerName>.</ComputerName> <LogName>Application</LogName> <Expression> <SimpleExpression> <ValueExpression> <XPathQuery Type="UnsignedInteger">EventNumber</XPathQuery> </ValueExpression> <Operator>Equal</Operator> <ValueExpression> <Value Type="UnsignedInteger">888</Value> </ValueExpression> </SimpleExpression> </Expression> <ScriptName>eGmesurecollectionScript.ps1</ScriptName> <ScriptBody><![CDATA[ param($ManagerID,$MeasureName,$TestID) . . . . . .. . . . . . . . . $api = new-object -comObject 'MOM.ScriptAPI' $bag = $api.CreatePropertyBag() $bag.AddValue('ObjectName', $sObjectName) $bag.AddValue('CounterName', $sCounterName) $bag.AddValue('InstanceName', $sInstanceName) $bag.AddValue('Value', $sValue) $bag ]]></ScriptBody> <Parameters> <Parameter> <Name>ManagerID</Name> <Value>$Target/Property[Type="eG.Monitoring.Test"]/ManagerID$</Value> </Parameter> <Parameter> <Name>MeasureName</Name> <Value>$Config/MeasureName$</Value> </Parameter> <Parameter> <Name>TestID</Name> <Value>$Target/Property[Type="Monitoring.Test"]/TestID$</Value> </Parameter> </Parameters> <TimeoutSeconds>60</TimeoutSeconds> </DataSource> <ConditionDetection ID="CD" TypeID="Performance!System.Performance.DataGenericMapper"> <ObjectName>$Data/Property[@Name='ObjectName']$</ObjectName> <CounterName>$Data/Property[@Name='CounterName']$</CounterName> <InstanceName>$Data/Property[@Name='InstanceName']$</InstanceName> <Value>$Data/Property[@Name='Value']$</Value> </ConditionDetection> </MemberModules> <Composition> <Node ID="CD"> <Node ID="DS" /> </Node> </Composition> </Composite> </ModuleImplementation> <OutputType>Performance!System.Performance.Data</OutputType> </DataSourceModuleType> <DataSourceModuleType ID="Monitoring.DataSourceTypes.Rule.EventDrivenWMIProvider" Accessibility="Internal" Batching="false"> <Configuration> <IncludeSchemaTypes> <SchemaType>Windows!Microsoft.Windows.PowerShellSchema</SchemaType> </IncludeSchemaTypes> <xsd:element minOccurs="1" name="ComputerName" type="xsd:string" /> <xsd:element minOccurs="1" name="LogName" type="xsd:string" /> <xsd:element minOccurs="1" name="Expression" type="ExpressionType" /> <xsd:element minOccurs="1" name="ScriptName" type="NonNullString" /> <xsd:element minOccurs="1" name="ScriptBody" type="NonNullString" /> <xsd:element minOccurs="1" name="Parameters" type="NamedParametersType" /> <xsd:element minOccurs="1" name="TimeoutSeconds" type="xsd:integer" /> </Configuration> <ModuleImplementation Isolation="Any"> <Composite> <MemberModules> <DataSource ID="EventProvider" TypeID="Windows!Microsoft.Windows.EventProvider"> <ComputerName>$Config/ComputerName$</ComputerName> <LogName>$Config/LogName$</LogName> <Expression>$Config/Expression$</Expression> </DataSource> <ProbeAction ID="PSScript" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe"> <ScriptName>$Config/ScriptName$</ScriptName> <ScriptBody>$Config/ScriptBody$</ScriptBody> <Parameters>$Config/Parameters$</Parameters> <TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds> </ProbeAction> </MemberModules> <Composition> <Node ID="PSScript"> <Node ID="EventProvider" /> </Node> </Composition> </Composite> </ModuleImplementation> <OutputType>System!System.PropertyBagData</OutputType> </DataSourceModuleType> in this above datasouce using by the rule like following <Rule ID="Monitoring.Rule.NETWORK.NetworkInterfaceTest.Out_N_unicast" Enabled="true" Target="Monitoring.Tests.NETWORK.NetworkInterfaceTest" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100"> <Category>PerformanceCollection</Category> <DataSources> <DataSource ID="DS" TypeID="Monitoring.DataSourceTypes.Rule.PerformanceProvider"> <MeasureName>Out_N_unicast</MeasureName> </DataSource> </DataSources> <WriteActions> <WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData" /> <WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData" /> </WriteActions> </Rule> and also create event like below(from cmd) EVENTCREATE /T ERROR /ID 888 /L APPLICATION /D "My custom error event for the application log" event is created sucessfully in application log. but this rule is not executed/fired. here that script was not executed. if i used System!System.Scheduler, instead of/in place of Windows!Microsoft.Windows.EventProvider that time rule fired. so i thnk may error occure in Microsoft.Windows.EventProvider. help me to solve this. i want to excute this rule after create event with id 888. after fire this rule under Windows!Microsoft.Windows.EventProvider, and it going to execute script and ouput as popertybag. then based on property bag this Performance!System.Performance.DataGenericMapper produce the perfomance values. stp 1: evnt create and based on that Windows!Microsoft.Windows.EventProvider fire and execute script and prduce propertybag ouput. stp 2: based properybag, this System.Performance.DataGenericMapper is going to produce perfomance value. so when i create event id 888, that time that scrpit want to excute and output as propertybag. After that propertybag data passed as perfomance value. what is the issue on this code? help me with sample code regards satheesh
November 24th, 2011 7:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics