What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How do I monitor the Archive Bit of a file?

Votes:

0

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?

files prtg wmi

Created on Oct 19, 2010 3:08:17 PM



Best Answer

Accepted 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%

Created on Oct 20, 2010 9:27:20 AM



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.

Created on Oct 19, 2010 3:59:06 PM by  Torsten Lindner [Paessler Support]



Accepted 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%

Created on Oct 20, 2010 9:27:20 AM



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

Created on Oct 22, 2010 9:19:12 PM



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.

Created on Oct 25, 2010 12:52:03 PM by  Torsten Lindner [Paessler Support]



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?

Created on Oct 26, 2010 5:41:17 PM



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.

Created on Oct 26, 2010 6:11:31 PM by  Torsten Lindner [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.