VMMServerBITS

Monitor_VMMServerBITS (UnitMonitor)

VMM Server BITS Configuration

Knowledge Base article:

External

http://go.microsoft.com/fwlink/?LinkId=316312

Element properties:

TargetMicrosoft.KnowledgeServices.VMM.2012.VMMServer
Parent MonitorSystem.Health.ConfigurationState
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.KnowledgeServices.Library.PowerShellMonitorEx
RemotableTrue
AccessibilityPublic
Alert Message
VMM is configured to use Background Intelligent Transfer Service (BITS) to transfer data between servers. Another program is using the same port as BITS.
<Details>
<Content>VMM uses BITS to transfer data between the VMM management server, the library server(s) and the virtualization hosts. If there is a service or program on the specified server that is using the same HTTPS port, the data transfers may be extremely slow or fail altogether. To resolve this issue, remove the other program, reconfigure the other program to use a different port, or configure VMM to use another port for BITS transfers. See the troubleshooting article for information on how to change the port for BITS transfers in VMM.</Content>
<CollectedInformation>
<Info>
<Name>Details</Name>
<Value>{0}</Value>
</Info>
</CollectedInformation>
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.0.0;

Source Code:

<UnitMonitor ID="Monitor_VMMServerBITS" Comment="SupportTopic=TBD;VersionNumber=1.0.0.0;" Accessibility="Public" Enabled="true" Target="MicrosoftKnowledgeServicesVMM2012Library!Microsoft.KnowledgeServices.VMM.2012.VMMServer" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="KnowledgeServicesLibrary!Microsoft.KnowledgeServices.Library.PowerShellMonitorEx" ConfirmDelivery="true">
<Category>Alert</Category>
<AlertSettings AlertMessage="MonitorMessage3c8c91c1d9ce4d08a0752b258e325def">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='Details']$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>VMMServerBITS.ps1</ScriptName>
<Parameters>
<Parameter>
<Name>BITSTcpPort</Name>
<Value>$Target/Property[Type="MicrosoftKnowledgeServicesVMM2012Library!Microsoft.KnowledgeServices.VMM.2012.VMMServer"]/BITSTcpPort$</Value>
</Parameter>
</Parameters>
<ScriptBody><Script>


param($BITSTcpPort)

$ErrorActionPreference = "Stop"

# Set up the arguments
$scriptargs = new-object psobject
$scriptargs | add-member NoteProperty "BITSTcpPort" $BITSTcpPort

# Set up the output
$global:scriptoutput = new-object psobject
$scriptoutput | add-member NoteProperty "HasIssue" $false
$scriptoutput | add-member NoteProperty "Details" ""
function AdvisorRule($scriptargs, $scriptoutput)
{
# Here is how you can access your script argument:
# For example: $scriptargs.Argument
# For the list of arguments that are supplied to this script, please refer
# to your rule in the Atlanta Authoring Tool

# Here is how you can add a configuration point value.
# $scriptoutput.ConfigPointA = &lt;value&gt;
# Be sure to add all of the ones that you specified.

$scriptoutput.HasIssue = $false;

try
{
$bitsTcpPort = $scriptargs.BITSTcpPort
$settingsFormat = "{0}\s+TCP\s+Enable" -f $bitsTcpPort

$settings = @(netsh firewall show portopening);
$matches = $settings -match $settingsFormat;
$badlist = @();
foreach ($match in $matches)
{
if (!($match -match "\s+Virtual Machine Manager Server" -or $match -match "\s+HTTPS"))
{
#Format the match string to get only the program name
# it starts like this
#443 TCP Enable Inbound Virtual Machine Manager Server
# and we only want Virtual Machine Manager Server, for example
$bad = $match;
while ($bad.Contains(" "))
{
$bad = $bad.Replace(" ", " ");
}
$badconcat = "";
$badsplit = $bad.Split(" ");
for ($i = 4; $i -lt $badsplit.Length; $i++)
{
$badconcat += $badsplit[$i] + " ";
}

$badconcat.TrimEnd(" ");
if (!$badlist.Contains($badconcat))
{
$badlist += $badconcat;
}

$scriptoutput.HasIssue = $true;
}
}
if ($scriptoutput.HasIssue)
{
$scriptoutput.Details = "BITS is configured to use port {0}, another program was found to be using the same port - " -f $bitsTcpPort
foreach ($bad in $badlist)
{
$scriptoutput.Details += $bad + ", ";
}
$scriptoutput.Details = $scriptoutput.Details.TrimEnd(", ");
}
}
catch [Exception]
{
$scriptoutput.HasIssue = $true;
$scriptoutput.Details = "Exception attempting to access BITS";
}
}

AdvisorRule $scriptargs $scriptoutput

# set the output
$mom = new-object -comobject "MOM.ScriptAPI"
$bag = $mom.CreatePropertyBag()

if ($scriptoutput.HasIssue -ne $null)
{
$bag.AddValue("HasIssue", $scriptoutput.HasIssue)
}

if ($scriptoutput.Details -ne $null)
{
$bag.AddValue("Details", $scriptoutput.Details)
}

$bag

</Script></ScriptBody>
<SnapIns/>
<TimeoutSeconds>300</TimeoutSeconds>
<Schedule>16230</Schedule>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='HasIssue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<Not>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='HasIssue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Not>
</SuccessExpression>
</Configuration>
</UnitMonitor>