diff --git a/Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg b/Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg index fdf3a29..46aeefc 100644 --- a/Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg +++ b/Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg @@ -21,8 +21,8 @@ Health!System.Health.AvailabilityState Public FileAgeMonitor - Atea Windows File Age Monitor - This monitor will look for files in a folder, recursively if configured such, and alert if one of more files are found. + File Age Monitor + This monitor will look for files in a folder, recursively if configured so, and alert if one of more files are found. Atea.Windows.File.FileAgeFolder true AvailabilityHealth @@ -32,7 +32,7 @@ Error Normal MatchMonitorHealth - File Age Monitor has found bad files + Files with bad timestamp found $Data/Context/Property[@Name="Summary"]$ false diff --git a/Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg.mpx b/Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg.mpx index 02ecc72..62145de 100644 Binary files a/Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg.mpx and b/Atea.Windows.File.Monitoring/HealthModel/Monitors/FileAge.mptg.mpx differ diff --git a/Atea.Windows.File.Monitoring/Scripts/FileAgePB.ps1 b/Atea.Windows.File.Monitoring/Scripts/FileAgePB.ps1 index 26d1017..8f2a703 100644 --- a/Atea.Windows.File.Monitoring/Scripts/FileAgePB.ps1 +++ b/Atea.Windows.File.Monitoring/Scripts/FileAgePB.ps1 @@ -20,7 +20,7 @@ if (![System.Diagnostics.EventLog]::SourceExists($EventLogSourceName)) { if (Test-Path -Path $RegistryPath) { # Yes, we can read from $RegistryPath $SubKeys = Get-ChildItem $RegistryPath - + if ($SubKeys -ne $null) { # Found configuration keys, processing folders ForEach ($SubKey in $SubKeys) { @@ -43,7 +43,7 @@ if (Test-Path -Path $RegistryPath) { ">=" {$Operator = "-ge"} default {$Operator = "-gt"} } - + $summaryMessage = "File Age Monitor on '$FriendlyName', looking for '$FilePattern' where $FileAgeAttribute $Operator $AgeInMinutes in $FolderPath" if ($Recursive.Trim() -eq "false") @@ -59,7 +59,7 @@ if (Test-Path -Path $RegistryPath) { $Files = @(Invoke-Command -ScriptBlock $ScriptBlock) if ($Files.Count -gt 0) { $summaryMessage += "Found $($Files.Count) matching files:`n" - $summaryMessage += "File Name`tFile Path`t`tAge (minutes)`tTimeStamp`n" + #$summaryMessage += "File Name`tFile Path`t`tAge (minutes)`tTimeStamp`n" ForEach ($File in $Files) { $FileName = $File.Name @@ -70,7 +70,7 @@ if (Test-Path -Path $RegistryPath) { "LastAccessTime" {$FileDateTime = $File.LastAccessTime} } $FileAgeMinutes = [math]::Round(((Get-Date) - $FileDateTime).TotalMinutes,0) - $summaryMessage += "$FileName`t$FileFullName`t$FileAgeMinutes`t$($FileDateTime -f "o")`n" + $summaryMessage += "$FileName`n`tMinutes since $($FileAgeAttribute): $FileAgeMinutes`n`tTimestamp: $($FileDateTime -f "o")`n`tFile Path: $FileFullName`n`n" } #We have old files, and a message. Build the property bag $propertyBag = $omApi.CreatePropertyBag() diff --git a/Atea.Windows.File.Monitoring/TypeLibrary/MonitorTypes/FileAgeMonitoryType.mpx b/Atea.Windows.File.Monitoring/TypeLibrary/MonitorTypes/FileAgeMonitoryType.mpx index 814fc77..b96c05b 100644 --- a/Atea.Windows.File.Monitoring/TypeLibrary/MonitorTypes/FileAgeMonitoryType.mpx +++ b/Atea.Windows.File.Monitoring/TypeLibrary/MonitorTypes/FileAgeMonitoryType.mpx @@ -29,11 +29,11 @@ - $Data/Property[@Name='FileCount']$ + Property[@Name='FileCount'] NotEqual - 0 + 0 @@ -42,11 +42,11 @@ - $Data/Property[@Name='FileCount']$ + Property[@Name='FileCount'] Equal - 0 + 0 diff --git a/Atea.Windows.Service.Monitoring/Scripts/Get-RunningServices.ps1 b/Atea.Windows.Service.Monitoring/Scripts/Get-RunningServices.ps1 index 8cb1f0b..7f49c7b 100644 --- a/Atea.Windows.Service.Monitoring/Scripts/Get-RunningServices.ps1 +++ b/Atea.Windows.Service.Monitoring/Scripts/Get-RunningServices.ps1 @@ -1 +1 @@ -gwmi -query "select * from Win32_Service where State='Running'" | ft Name,DisplayName -AutoSize +Get-WMIObject -query "select * from Win32_Service where State='Running'" | Format-Table Name,DisplayName -AutoSize diff --git a/Released/Atea.Windows.File.Monitoring.mp b/Released/Atea.Windows.File.Monitoring.mp index 8039c9b..a2ee610 100644 Binary files a/Released/Atea.Windows.File.Monitoring.mp and b/Released/Atea.Windows.File.Monitoring.mp differ diff --git a/Released/Atea.Windows.Installer.msi b/Released/Atea.Windows.Installer.msi index 736c02e..ec60757 100644 Binary files a/Released/Atea.Windows.Installer.msi and b/Released/Atea.Windows.Installer.msi differ