File Size Availability

Windows.Monitoring.FileSystem.FileSize.AvailabilityHealth (UnitMonitor)

Monitors the size of this file.
Checks if it's greater than the given size override.
The size of the file in the override is given in KB.
Monitor is disabled by default.

Knowledge Base article:

Summary

Monitors the size of a file.

Configuration

Use overrides to enable the monitor for a File or all Files. Use the Override to set the size threshold, the size is in KB.

Causes

The File has passed the Size threshold.

Additional

The monitor is disabled by default.

Element properties:

TargetWindows.Monitoring.FileSystem.File
Parent MonitorSystem.Health.AvailabilityState
CategoryStateCollection
EnabledFalse
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeWindows.Monitoring.FileSystem.FileSize.MonitorType
RemotableTrue
AccessibilityPublic
Alert Message
FileSize Over Treshold
The File {0} has exceeded the size treshold {1} Kb. Current Size is {2}
RunAsDefault

Source Code:

<UnitMonitor ID="Windows.Monitoring.FileSystem.FileSize.AvailabilityHealth" Accessibility="Public" Enabled="false" Target="Windows.Monitoring.FileSystem.File" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Windows.Monitoring.FileSystem.FileSize.MonitorType" ConfirmDelivery="true">
<Category>StateCollection</Category>
<AlertSettings AlertMessage="Windows.Monitoring.FileSystem.FileSize.AvailabilityHealth_AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="Windows.Monitoring.FileSystem.File"]/Name$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='FileSize']$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="Windows.Monitoring.FileSystem.File"]/Size$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="UIGeneratedOpStateIdd4a1a259e5f14bd4a9e6e8ce04def03b" MonitorTypeStateID="FileOk" HealthState="Success"/>
<OperationalState ID="UIGeneratedOpStateIde159bae21f3241789270ddf3f33024d9" MonitorTypeStateID="FileNotOk" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>3600</IntervalSeconds>
<SourceFile>"$Target/Property[Type="Windows.Monitoring.FileSystem.File"]/Path$"</SourceFile>
<FileSize>10</FileSize>
</Configuration>
</UnitMonitor>