Posted January 6, 20178 yr Hi, I would like to have a folder monitor, basically I have a folder (or several folders) that I need to monitor that the files in the folder and receive alerts for the following. - filesĀ are older thanĀ X days - over X number of files in the folder Ā Please advise if this is possible currently of if this will require development, if this can be accomplished with a script then some pointers would be useful, ideally this would run at the same rate as other aspects of the system, but it could also be a daily/hourly check as I understand it could consume time processing! Ā
January 10, 20178 yr Staff Hi, try to run these scripts: Check if folder contines files older than 10 days. $fullPath = "path to the folder" $days = 10 # files older than 10 days $files = @(get-childitem $fullpath -include *.* -recurse | where {($_.LastWriteTime -lt (Get-Date).AddDays(-$days)) -and ($_.psIsContainer -eq $false)}) if($files.length -gt 0){exit 1} else{exit 0} Check if folder contains more than 5 files $fullPath = "path to the folder" $count = 5 # check if folder containes more than 5 files $files = @(get-childitem $fullpath) if($files.Count -gt $count){exit 1} else{exit 0} Ā
January 14, 20178 yr Author Thanks Chris, the script works fine, I can add some output to them, but it seems they require running manually? Is there a way to have scripts run at the same interval as other test, at the very least I would need to check hourly? it would be great if this could be added in a similar format to the SSL so that multiple folders could be added with Alert times from 1 minute, happy to discus this offline. I could do an automation script but there is not an option less than daily. Many Thanks
January 16, 20178 yr Administrators We'd love to have a folder monitoring feature in Pulseway. I've added a todo for it, this could be used to detect cryptolocker, see if backups aren't rotated and much more. -Paul
March 14, 20196 yr Any updates on this, also very interested as we have a few systems where monitoring the number of files or size ofĀ a queue folder would be very helpfull. As buildup means they are not being processed.
Create an account or sign in to comment