Hello, guys!
I need to monitor the change of lots of different files in a folder, all of them following a name pattern, like SX*.dtc. I need to get notifications everytime some files with this name (except one), is changed.
How can I do that?
Article Comments
Hi peresbr
Maybe you can try with a custom batch sensor like this:
forfiles /d -10 /P c:\Data /M SX*.dtc IF %ERRORLEVEL% EQU 1 EXIT 1 IF %ERRORLEVEL% EQU 2 EXIT 2 :: ErrorLevel 1 if no Files found older than 10 days :: ErrorLevel 0 if Files are found older than 10 days
It checks for files with searchmask SX*.dtc in the folder c:\data. If there IS a file older than 10days it exits with 1 else Exit with 2.
regards Thomas
Dec, 2015 - Permalink
Dear Thomas
Thank you for your input. Please allow me to comment that this bat is not yet a full PRTG Exe/Script sensor.
- It should begin with @echo off to disable unwanted console output
- The sensor must create an output on the console. for example:
echo 0:No files found older than 10 days
or
echo 1:Files older than 10 days present
The part before the colon is the actual data recorded as historic data, the part after the colon is the current status message.
Dec, 2015 - Permalink
This is unfortunately not possible, since sensors like File/Folder/File Content Sensors do not support applying wildcards or a combination of wildcards and exclusions.
Kind regards.
Dec, 2015 - Permalink