Check directory for deleted files

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
Gerhard
Posts: 26
Joined: Mon Oct 16, 2006 8:25 am

Check directory for deleted files

Post by Gerhard »

I am currently working on testing the functionality of one of our applications on a windows 2003 application server.

It seems that files are being removed from the read and execute directory and i want to configure a test to see if a file gets deleted. I have been working with the NT event log - security - succes audit - Deleted file, this works but for the entire system.

I want to have a test which gives a alert when a file gets deleted from a certain directory. I wan't able to find such a standard test, but maybe you know a option which i can use.

Regards Gerhard
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

I think you may use "Folder/File Availability" test method.
Quote from the manual:
http://www.ks-soft.net/hostmon.eng/tests.htm#fileexsts
===================
HostMonitor can check for a file that MUST exist each time a test is run, or can check for a file that MUST NOT exist each time a test is run. Select "Folder/File Availability" as the test type and enter the file or folder name. You can manually type in the complete path and filename that you wish to test, or click on the "Browse" and you will be presented a dialog for selecting a file.
If you need to check some files that are dynamically created and do not have static name (e.g. some logs that are created on daily basis and have different file name every day), you may enable "Translate macros" options. With this option enabled you may use special date macro variables and User Defined Variables in file name.
===================

Regards,
Max
Gerhard
Posts: 26
Joined: Mon Oct 16, 2006 8:25 am

Post by Gerhard »

Max,

Thanks for the quick reply, but i don't think this works for me. I have to check a directory with 172 files and every now and then one file gets deleted which can be a different file each time while the directoy keeps existing and the files can also grow in size.

I am currently looking for a script which counts the number of files in a director and creates a log file stating this number, then i can use text log to read the amount of files and if this amount changes it gives me a alert. However i am not a scripter and therefor prefer using standard tests. Any suggestions wil be very much appreciated even when it concerns the use of a script.

Regards Gerhard
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Probably, "Count Files" test method would suit your needs? http://www.ks-soft.net/hostmon.eng/mfra ... countfiles

Regards,
Max
Gerhard
Posts: 26
Joined: Mon Oct 16, 2006 8:25 am

Post by Gerhard »

Thanks Max, count files indeed did the trick. I configured the test to count all the files in a dir. and put that number into to test parameters and then checked reverse alert. However when a dir has 20 files and i put reverse alert on, it gives me back a bad result when there are exactly 20 files in the dir. When using reverse alert you have to configure the test to give a bad reslut when less then 19 files (one less then the actual amount of files).

Regards, Gerhard
Post Reply