xml - Add IntervalSeconds Element to Script Based Monitor via MP Author
问题描述
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>
解决方案
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:
- Use
SimpleReccuringSchedule
schedule, or SimpleScheduler as a base. Configure your interval here. - Add System.SchedulerFilter condition detection module to your data source to allow the base scheduler only at configured windows.
推荐阅读
- abap - CHANGEDOCUMENT_READ_HEADERS 为什么我无法读取条目的创建者?
- kubernetes - 如果 POD 有唯一的 IP 地址,POD 中每个容器的 IP 地址是什么?
- cucumber-junit - 步骤在黄瓜特征文件中没有匹配的胶水代码
- javascript - 如何通过 Ajax 请求正确使用和呈现云功能服务器数据?
- c# - 如何从列表中删除当前正在播放的索引项,但变量“i”现在是 1 而不是 0?
- twitter-bootstrap - 表响应仅在需要时显示滚动条
- typescript - TS:如何获取常量数组元素类型
- javascript - Mediawiki Hyperswitch:如果响应正文中的某个值等于变量,则返回
- javascript - 动态 Kendo UI Grid 可编辑日期时间列不使用值
- spring - 不支持GET方式,登录成功后显示,如何解决?