How about Advanced instead of just Simple (System.SimpleScheduler)

Monitoring configurations that require being active on a specific schedule can be dealt in various ways.

One possibility is to take care of the scheduling while implementing the Monitor Type, inserting System.SchedulerFilter condition detection modules in the regular detections for monitor states. Depending on what workflows you are configuring, this might be the right and only approach.

But sometimes, if you can control your starting point (data source), you would be better off (read efficient) having the scheduling implemented right there, at beginning. To explain a bit better, with an example: instead of performing a check with a script at a certain interval and then drop the findings because outside of the schedule, the propose is to execute the script according to the active schedule and not waste resources for nothing, when results do not matter anyhow.

The System.Library Management Pack does not have such Datasource module, but it does provide the right building blocks to create one.
Use the following module to initiate a workflow at a regular interval, on a schedule of your choice.

<DataSourceModuleType ID="System.AdvancedScheduler" Accessibility="Public" Batching="false">
	  <xsd:element name="IntervalSeconds" type="xsd:int"/>
	  <xsd:element name="SyncTime" type="xsd:string"/>
	  <xsd:element name="Schedule" type="PublicSchedulerType" />
	  <OverrideableParameter ID="IntervalSeconds" ParameterType="int" Selector="$Config/IntervalSeconds$"/>
	  <OverrideableParameter ID="SyncTime" ParameterType="string" Selector="$Config/SyncTime$"/>
	<ModuleImplementation Isolation="Any">
		  <DataSource TypeID="System!System.SimpleScheduler" ID="DS1">
		  <ConditionDetection ID="OnScheduleCD" TypeID="System!System.SchedulerFilter">
		  <Node ID="OnScheduleCD">
			<Node ID="DS1"/>

And here is an example of usage: the rule below will log an event in Application log every 5 minutes on Mon and Tue between 8-9pm and Fri between 10-11pm. Not exactly useful other than getting you started in the right direction.

<Rule ID="Testing.System.AdvancedScheduler" Enabled="true" Target="SystemCenter!Microsoft.SystemCenter.RootManagementServer" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
	  <DataSource ID="Scheduler" TypeID="System.AdvancedScheduler">
	  <WriteAction ID="ExecuteCommand" TypeID="System!System.CommandExecuter">
		<CommandLine>/T Information /ID 1 /L Application /D "Testing System.AdvancedScheduler"</CommandLine>
		<Files />

2 responses to “How about Advanced instead of just Simple (System.SimpleScheduler)

  1. Igor Kuznetsov September 23, 2016 at 5:17 am

    God damn, thank you a lot for

    I think a lot how to pass config to scheduler filter …its so easy..just use PublicSchedulerType…


  2. jaspervd86 July 6, 2017 at 1:03 pm

    Hey just wanted to say this helped me as well, thanks for the post!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: