0

I’ve created a Powershell Script Based Monitor using Silect MP Author so that I will be able to schedule their runtime (e.g. Every Day – Sun – Thu). Problem is, That I also need the availability to adjust the interval time (e.g. Every 30 Seconds). And for some reason, this is not a valid option to combine in the MP Author Wizard. You can only choose from the 3 following options: 1. None 2. Daily 3. Periodic Does somebody know what is the Interval Time configured if the Daily option is been chosen? Furthermore, While examining the XML file MP Author has created, I can see that when choosing the Daily options, the following elements have been created:

    </Configuration>
  <OverrideableParameters>
    <OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int" />
    <OverrideableParameter ID="DaysOfWeekMask" Selector="$Config/DaysOfWeekMask$" ParameterType="int" />
    <OverrideableParameter ID="StartTime" Selector="$Config/StartTime$" ParameterType="string" />
    <OverrideableParameter ID="EndTime" Selector="$Config/EndTime$" ParameterType="string" />
  </OverrideableParameters>
  <ModuleImplementation Isolation="Any">
    <Composite>
      <MemberModules>
        <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
          <Scheduler>
            <WeeklySchedule>
              <Windows>
                <Daily>
                  <Start>$Config/StartTime$</Start>
                  <End>$Config/EndTime$</End>
                  <DaysOfWeekMask>$Config/DaysOfWeekMask$</DaysOfWeekMask>
                </Daily>
              </Windows>
            </WeeklySchedule>
            <ExcludeDates />
          </Scheduler>
        </DataSource>

Can I just add New Element (For and tags):

<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:integer" name="IntervalSeconds" />
    <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:integer" name="DaysOfWeekMask" />

<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int" />

And a New line in the Tag for the IntervalSeconds Value?:

As Hard Coded Value

<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int" />

Or as a Varibel?

<SimpleReccuringSchedule>
              <Interval Unit="Seconds">$Config/IntervalSeconds$</Interval>
            </SimpleReccuringSchedule>
4

1 回答 1

1

According to MS documentation, PublicSchedulerType, there is no configurable parameter to set interval in your scenario. SimpleReccuringSchedule is mutually exclusive to WeeklySchedule, as per the schema definition. On the top of that, MS doesn't provide an example, where Start and End parameters are different, they recommend to use it for a single fire.

You certainly, can add a new parameter and make it overridable, but you have no place to use it, so this won't make any difference.

To deal with this issue, you can:

  1. Use SimpleReccuringSchedule schedule, or SimpleScheduler as a base. Configure your interval here.
  2. Add System.SchedulerFilter condition detection module to your data source to allow the base scheduler only at configured windows.
于 2018-12-30T21:26:41.747 回答