Virtual host driver detected that can cause stability problems for SQL Server
http://go.microsoft.com/fwlink/?LinkId=226066
Target | Microsoft.KnowledgeServices.Windows.OperatingSystem | ||
Parent Monitor | System.Health.ConfigurationState | ||
Category | Alert | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.KnowledgeServices.Library.PowerShellMonitorEx | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default | ||
Comment | SupportTopic=TBD;VersionNumber=1.0.0.0; |
<UnitMonitor ID="Monitor_AK224774" Comment="SupportTopic=TBD;VersionNumber=1.0.0.0;" Accessibility="Public" Enabled="true" Target="MicrosoftKnowledgeServicesWindowsLibrary!Microsoft.KnowledgeServices.Windows.OperatingSystem" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="KnowledgeServicesLibrary!Microsoft.KnowledgeServices.Library.PowerShellMonitorEx" ConfirmDelivery="true">
<Category>Alert</Category>
<AlertSettings AlertMessage="MonitorMessage249e2a8208a141aaaca167406ea54201">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='DriverName']$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='DriverCurrentVersion']$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='DriverRequiredVersion']$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AK224774.ps1</ScriptName>
<Parameters/>
<ScriptBody>
$ErrorActionPreference = "Stop"
# Set up the arguments
$scriptargs = new-object psobject
# Set up the output
$global:scriptoutput = new-object psobject
$scriptoutput | add-member NoteProperty "HasIssue" $false
$scriptoutput | add-member NoteProperty "DriverName" ""
$scriptoutput | add-member NoteProperty "DriverCurrentVersion" ""
$scriptoutput | add-member NoteProperty "DriverRequiredVersion" ""
#-------------------------------------------------------------------------------------------
# MAIN CODE SECTION
#-------------------------------------------------------------------------------------------
$scriptenv = new-object psobject
$scriptenv | add-member NoteProperty "RuntimeError" $false
$scriptenv | add-member NoteProperty "FileFullName_XGVHBA" ""
$scriptenv | add-member NoteProperty "FileVer_XGVHBA" "0.0.0.0"
$scriptenv | add-member NoteProperty "IsExistsFile_XGVHBA" $false
$scriptenv | add-member NoteProperty "IsExistsSQLServerEnv" $false
function IsExistsSQLServer()
{
$sqlInstances = Get-WmiObject -Query "Select Name from Win32_Service where PathName like `'%sqlservr.exe%`'"
if($sqlInstances -ne $null)
{
$sqlInstanceCount = ([array]$sqlInstances).Count
if($sqlInstanceCount -gt 0)
{
$scriptenv.IsExistsSQLServerEnv = $true
}
}
}
function GetXGVHBAInfo()
{
$scriptenv.FileFullName_XGVHBA = Join-Path $Env:SystemRoot "System32\drivers\XGVHBA.SYS"
if(Test-Path $scriptenv.FileFullName_XGVHBA)
{
$scriptenv.IsExistsFile_XGVHBA = $true
$scriptenv.FileVer_XGVHBA = [Diagnostics.FileVersionInfo]::GetVersionInfo($scriptenv.FileFullName_XGVHBA).FileVersion
}
}
# Main function
function AdvisorRule($scriptargs, $scriptoutput)
{
trap [Exception] {
$scriptenv.RuntimeError = $true
continue;
}
# All parameters should be populated outside of the main function.
# The mian function should only include the detection logic so that it can be easyly reused by the Atlanta authoring tool.
# Initialize parameters
$scriptoutput.HasIssue = $false
$scriptoutput.DriverName = ""
$scriptoutput.DriverCurrentVersion = ""
$scriptoutput.DriverRequiredVersion = ""
# Set parameter values
IsExistsSQLServer
# Detection Logic
if($scriptenv.IsExistsSQLServerEnv -eq $true)
{
GetXGVHBAInfo
if($scriptenv.IsExistsFile_XGVHBA -eq $true)
{
if([version]$scriptenv.FileVer_XGVHBA -ge [version]"2.6.0.0" -and [version]$scriptenv.FileVer_XGVHBA -lt [version]"2.7.3.0")
{
if($scriptenv.RuntimeError -eq $false)
{
$scriptoutput.HasIssue = $true
$scriptoutput.DriverName = $scriptenv.FileFullName_XGVHBA
$scriptoutput.DriverCurrentVersion = $scriptenv.FileVer_XGVHBA
$scriptoutput.DriverRequiredVersion = "2.7.3.0"
}
}
}
}
}
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.DriverName -ne $null)
{
$bag.AddValue("DriverName", $scriptoutput.DriverName)
}
if ($scriptoutput.DriverCurrentVersion -ne $null)
{
$bag.AddValue("DriverCurrentVersion", $scriptoutput.DriverCurrentVersion)
}
if ($scriptoutput.DriverRequiredVersion -ne $null)
{
$bag.AddValue("DriverRequiredVersion", $scriptoutput.DriverRequiredVersion)
}
$bag
</ScriptBody>
<SnapIns/>
<TimeoutSeconds>300</TimeoutSeconds>
<Schedule>86393</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>