QND.Hyperv2012R2.VMName.ComputerName.Match.MT (UnitMonitorType)

Element properties:

RunAsDefault
AccessibilityPublic
Support Monitor RecalculateFalse

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.SimpleScheduler Default
Parse ProbeAction Microsoft.Windows.PowerShellPropertyBagProbe Default
FilterMatch ConditionDetection System.ExpressionFilter Default
FilterNotMatch ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelector
IntervalSecondsint$Config/IntervalSeconds$
SyncTimestring$Config/SyncTime$
TimeoutSecondsint$Config/TimeoutSeconds$

Source Code:

<UnitMonitorType ID="QND.Hyperv2012R2.VMName.ComputerName.Match.MT" Accessibility="Public">
<MonitorTypeStates>
<MonitorTypeState ID="NamesMatch" NoDetection="false"/>
<MonitorTypeState ID="NamesDoNotMatch" NoDetection="false"/>
</MonitorTypeStates>
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="0" name="SyncTime" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ComputerFQDN" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="VMName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="TimeoutSeconds" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
</DataSource>
<ProbeAction ID="Parse" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe">
<ScriptName>GetNetBIOSCOmputerName.vbs</ScriptName>
<ScriptBody><Script>param($vmName)

#MOM API
$oAPI = New-Object -ComObject "MOM.ScriptAPI"

$NBName = ($vmName.Split('.'))[0]
$oBag = $oAPI.CreatePropertyBag()
$oBag.AddValue('NetBIOSName', $NBName)
$obag</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>VMName</Name>
<Value>$Config/ComputerFQDN$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
<ConditionDetection ID="FilterMatch" TypeID="System!System.ExpressionFilter">
<Expression>
<Or>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='NetBIOSName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/VMName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Value Type="String">$Config/ComputerFQDN$</Value>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/VMName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Or>
</Expression>
</ConditionDetection>
<ConditionDetection ID="FilterNotMatch" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='NetBIOSName']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String">$Config/VMName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Value Type="String">$Config/ComputerFQDN$</Value>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String">$Config/VMName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="NamesMatch">
<Node ID="FilterMatch">
<Node ID="Parse">
<Node ID="DS"/>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="NamesDoNotMatch">
<Node ID="FilterNotMatch">
<Node ID="Parse">
<Node ID="DS"/>
</Node>
</Node>
</RegularDetection>
</RegularDetections>
</MonitorImplementation>
</UnitMonitorType>