Hi Fadil,
not quite sure why the folder does nto get monitored and as it seems the picture didn't get attached.
My advice to you would be to simpy use PowerShell and the PowerShell MP of Cookdown to configure a PowerShell based monitor for that.
You need a script like that:
#Warning (or error) threshold regarding the file age
[int]$Minutes = "-5"
[string]$FolderName = "C:\FolderName"
#Prepare dates
$CurrentDate = Get-Date
$ErrorDate = $CurrentDate.AddMinutes($Minutes)
#Clear Errors
$Error.Clear()
#Prepare API and Property Bag Objects
$ScomAPI = New-Object -ComObject "MOM.ScriptAPI"
$PropertyBag = $ScomAPI.CreatePropertyBag()
#Get the files from the folder
$MonitoredFiles = Get-ChildItem -Path $FolderName -Recurse
#Define an array to store the objects
[array]$Summary = @()
foreach ($File in $MonitoredFiles) {
#Get the Last Modified Date
$FileDate = (Get-Item $Filer.FullName).LastWriteTime
if ($FileDate -lt $ErrorDate) {
$Summary += $File.FullName
}
}
if ($Summary) {
#The file has a LastModified Date, which is older then 24h when the variable $Summary exists
#Create and fill the case specific Property Bags
[string]$SummaryInfo = $Summary -join ";"
$PropertyBag.AddValue("State","Error")
$PropertyBag.AddValue("Files",$SummaryInfo)
} else {
#The file has a LastMofied Date, which is newer then 24h
$PropertyBag.AddValue("State","Healthy")
}
#Send the whole output to SCOM
$PropertyBag
#Used for testing
#$ScomAPI.Return($PropertyBag)
You can take this script, make sure it delivers the right data and create a PowerShell based monitor with it. I described hpow this can be done here:
Monitoring Active Directory User Account Expiration using SCOM and PowerShell (Step by Step Guide)
https://www.pohn.ch/monitor-active-directory-user-account-expiration-using-scom-and-powershell-step-by-step-guide/
In the blogs post I intetgrated another Powershell script, but the approach is the same.
You can also watch the video here:
PowerShell MP Example
https://youtu.be/--wOzKU52JE
I hope I could help out!
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Stoyan Chalakov