We have a server that does a weekly full backup and then daily incremental backups. The backups work normally, but we have a mystery incremental backup that once a week jumps from approximately 3GB to 120GB (almost the same size as a full backup). At some point between the previous small backup and the current large backup, the archive bit is getting set on the files. What I would like to do is get an alert when the archive bit is getting set on a file so that I can try to track down what is making the change. Does PRTG have a way to monitor the archive bit so that I can get an alert?
How do I monitor the Archive Bit of a file?
Votes:
0
Best Answer
Votes:
0
This can be done with a Custom Sensor batch file.
Create a new batch file in the Custom Sensors\EXE folder of your PRTG installation and call it ArchiveBit.bat. Next paste the following code in the batch file:
@echo off dir /b /aa %1% if errorlevel 1 goto notfound if errorlevel 0 goto found :notfound echo 0:File not found goto end :found echo 1:File found goto end :end
Enter the name of the file to check in the parameter section of this Custom Sensor. If your file has the archive bit set, the sensor wll return "0" else it wil return "1".
To reverse this behaviour and have the sensor find a file that has the archive bit NOT set, replace the line
dir /b /aa %1%
With
dir /b /a-a %1%
6 Replies
Votes:
0
Hello,
I'm afraid monitoring the Archive bit is not possible with PRTGs default sensors. Maybe with a custom script sensor.
Best Regards.
Votes:
0
This can be done with a Custom Sensor batch file.
Create a new batch file in the Custom Sensors\EXE folder of your PRTG installation and call it ArchiveBit.bat. Next paste the following code in the batch file:
@echo off dir /b /aa %1% if errorlevel 1 goto notfound if errorlevel 0 goto found :notfound echo 0:File not found goto end :found echo 1:File found goto end :end
Enter the name of the file to check in the parameter section of this Custom Sensor. If your file has the archive bit set, the sensor wll return "0" else it wil return "1".
To reverse this behaviour and have the sensor find a file that has the archive bit NOT set, replace the line
dir /b /aa %1%
With
dir /b /a-a %1%
Votes:
0
I have finally had a chance to get back to this project. I have set up the script on the PRTG server and did a test run from the command line which was successful. I then set it up in the PRTG interface. However, the result is always "File Not Found." I checked the settings and everything looks correct. I have "Use Windows credentials of parent device" selected. Those credentials are the same credentials I used when I logged into the server itself and ran it successfully from the command line. The parameter I put into the parameters field is:
10.0.4.37\f$\inetpub\ads\Archivespot.flv
Is there something that I am missing regarding the configuration?
Thanks
Votes:
0
Dear Kevin,
the user-account under which the PRTG Probe runs might play a role here. Maybe this account is not allowed to access the share or similar.
Best Regards.
Votes:
0
I have checked the account that is being used and I do not believe that is the issue. In the parent device I unselected "Inherit Credentials for Windows Systems" and purposely put in bad information. When I did that, PRTG showed an error of "Access is denied". When I put correct information in, I would receive the message File Not Found which is what is being returned from the script. So, every time the script is run through PRTG, it returns an errorlevel of 1 but when I run the script from the command line it returns the correct errorlevel. Thoughts?
Votes:
0
There is a difference between you executing such a script under your user-account on the command line, and PRTG running as a service under another account. A service does not have to have the same permissions, especially if running under another user account.
Add comment