Hi,
We have a file share with many subfolders inside it. Each subfolder has a file called "test.txt" while file name is the same, the file size different. We need to monitor all test.txt files and show an alert in prtg if any of the test.txt files is any of the subfolders grows larger than 10 KB.
This power shell below returns the results we need
Get-Childitem -path $path -Recurse -Filter $fileFilter | Sort-Object Length -Descending | Select-Object DirectoryName, name, @{Name="KBytes";Expression={ '{0:N0}' -f ($_.Length / 1KB) }}
in the following format
DirectoryName Name KBytes ------------- ---- ------ E:\Share\Dirt Files test.txt 5 E:\Share\Clean Files test.txt 0 E:\Share\Fake Files test.txt 0
If the result in the KBytes column on any of the lines is over 10 we need to show an alert for that line
It's our understanding that results need to be formatted for PRTG to understand but we can't find any good examples showing what to do in our situation.
Add comment