I want to monitore a folder for older files (if exists files older than 2 hours than error).
i can use the folder sensor, but it will allway say that there are older files because it monitors hidden system files.
is it possible to exclude these files?
is there another sensor for my issue?
Article Comments
One of my older scripts might help you here - look at this post: https://helpdesk.paessler.com/en/support/solutions/articles/79665-sql-database-backup-monitoring
I know I know - it is SQL - but the upper VBS script might be exactly what you want.. report back on certain file types and their age - you then would set channel limits for oldest and set the upper limit to 2 hours and done...
You might need to adjust this one line in the script:
iFileDateDiff = Datediff("d",objFile.DateLastModified,Now)
The above by default will give you a difference in DAYS - you want to have hours - so do this:
iFileDateDiff = Datediff("h",objFile.DateLastModified,Now)
Rename the channels in the results as well and you should be good..
Of course - the whole script might not be optimal for you - but I am not clear of what exactly you want to accomplish or monitor - so this is currently the best I can come up with :-)
Regards
Florian Rossmark
www.it-admins.com
Jan, 2019 - Permalink
Thanks.
I didn't expect it to be that complicated.
I will have a look at it in a quiet way.
Jan, 2019 - Permalink
One of my older scripts might help you here - look at this post: https://helpdesk.paessler.com/en/support/solutions/articles/79665-sql-database-backup-monitoring
I know I know - it is SQL - but the upper VBS script might be exactly what you want.. report back on certain file types and their age - you then would set channel limits for oldest and set the upper limit to 2 hours and done...
You might need to adjust this one line in the script:
The above by default will give you a difference in DAYS - you want to have hours - so do this:
Rename the channels in the results as well and you should be good..
Of course - the whole script might not be optimal for you - but I am not clear of what exactly you want to accomplish or monitor - so this is currently the best I can come up with :-)
Regards
Florian Rossmark
www.it-admins.com
Jan, 2019 - Permalink