AK599382

Monitor_AK599382 (UnitMonitor)

Exchange Server Page File Size is Less than Physical Memory Size Plus 10 MB

Knowledge Base article:

External

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

Element properties:

TargetMicrosoft.KnowledgeServices.Exchange.2010.Server
Parent MonitorSystem.Health.ConfigurationState
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.KnowledgeServices.Library.PowerShellMonitorEx
RemotableTrue
AccessibilityPublic
Alert Message
Exchange Server Page File Size is Less than Physical Memory Size Plus 10 MB
<Details>
<Content>This paging file size recommendation accounts for the amount of memory needed to collect information if the operating system fails. By default, if the operating system fails, it will copy everything in memory to a .dmp file. That file can be examined later to determine the cause of the failure. To be able to copy everything that is stored in memory, you must have a paging file size that can hold everything in memory, plus some additional space to gather the data.

To address this warning, increase the paging file size to equal the amount of RAM in the server plus 10 MB.

See the TechNet article for more information.</Content>
<CollectedInformation />
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.0.0;

Source Code:

<UnitMonitor ID="Monitor_AK599382" Comment="SupportTopic=TBD;VersionNumber=1.0.0.0;" Accessibility="Public" Enabled="true" Target="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.Server" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="KnowledgeServicesLibrary!Microsoft.KnowledgeServices.Library.PowerShellMonitorEx" ConfirmDelivery="true">
<Category>Alert</Category>
<AlertSettings AlertMessage="MonitorMessagebe733c3c0af64e2ba723e61e72288167">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AK599382.ps1</ScriptName>
<Parameters>
<Parameter>
<Name>ServerName</Name>
<Value>$Target/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.Server"]/Name$</Value>
</Parameter>
</Parameters>
<ScriptBody><Script>


param($ServerName)

$ErrorActionPreference = "Stop"

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

# Set up the output
$global:scriptoutput = new-object psobject
$scriptoutput | add-member NoteProperty "HasIssue" $false
#-----------------------------------------------------
# MAIN CODE SECTION
#-----------------------------------------------------

# Environment

$scriptenv = new-object psobject
$scriptenv | add-member NoteProperty "ErrorFlag" $null
$scriptenv | add-member NoteProperty "IsPageFileSettingCorrect" $null

# Helper functions
# function to check is the Pagefile setting correct
Function Check-IsPageFileSettingCorrect() {
$IsPageFileSettingCorrect = $false

$ComputersystemInfo = Get-WmiObject -ComputerName $scriptargs.ServerName -Class Win32_ComputerSystem -ErrorAction SilentlyContinue
$PageFilesInfo = [Array](Get-WmiObject -ComputerName $scriptargs.ServerName -Class Win32_PageFile -ErrorAction SilentlyContinue)

$CorrectPagefileSize = [Math]::Floor(($ComputersystemInfo.TotalPhysicalMemory + 1024 * 1024 * 10) / 1024 / 1024)

if($ComputersystemInfo.AutomaticManagedPagefile -eq $false){
foreach($PageFileInfo in $PageFilesInfo){
# If the both the minimum and maximum of the pagefile are set to grater than the value of physical memory plus 10MB
If($PageFileInfo.InitialSize -ge $CorrectPagefileSize -and $PageFileInfo.MaximumSize -ge $CorrectPagefileSize){
$IsPageFileSettingCorrect = $true
break
}
}
}
$IsPageFileSettingCorrect
}

# Main function
Function AdvisorRule($scriptargs, $scriptoutput) {
# All parameters should be populated outside of the main function.
# The main function should only include the detection logic so that it can be easyly reused by the Atlanta authoring tool.

trap [Exception] {
$scriptenv.ErrorFlag = $true
continue
}

# Initialize parameters
$scriptenv.ErrorFlag = $false
$scriptenv.IsPageFileSettingCorrect = $false

$scriptoutput.HasIssue = $false

# Set parameter values
$scriptenv.IsPageFileSettingCorrect = Check-IsPageFileSettingCorrect

# Detection Logic
#If there is no page file has minimum and maximum set to grater than the value of physical memory plus 10MB
If($scriptenv.IsPageFileSettingCorrect -ne $true){
If($scriptenv.ErrorFlag -ne $true){
#Raise Alert
$scriptoutput.HasIssue = $true
}
}
}
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)
}

$bag

</Script></ScriptBody>
<SnapIns>
<SnapIn>Microsoft.Exchange.Management.PowerShell.E2010</SnapIn>
</SnapIns>
<TimeoutSeconds>300</TimeoutSeconds>
<Schedule>86379</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>