File Watchdog
1. About Filewatchdog (fwd)
- fwd is a command-line server-side tool, that allows monitoring server ressources, namly certain files, file-types or complete directories.
- Configure fwd using an XML config file
- Every time one of the ressources is modified, the modification is written into a logfile, or some adminstrator is notified by an email.
- Filewatchdog is "open-source", so you can modify the sources to adapt fwd for your needs. In case of significant changes, please notify me.
|
Use Filewatchdog as is. I can give no guarantee that fwd will work properly or do what you expect. Use it at your own risk. Take a look into the sources if you are unsure about the functionality in detail.
|
2. Install Filewatchdog
Requirements
A Java Development Kit or Java Runtime Environement Version 1.2 or newer is required.
Install
Download either the "binaries-only" release, or the complete release containing binaries, documentation (javadoc) and sources:
Unpack the zip file into an arbitrary directory.
3. Configuration
In the main directory of fwd you find a config.xml file. Open this and modify the configuration file to fit your needs. The meaning of the parameters is:
| Parameter | Meaning |
| CONFIG | Contains basic configuration settings. |
| | PollIntervalSec | Polling Interval in seconds: Every PollIntervalSec seconds the ressources are checked if some files are changed. Don´t use too small values, as this can harm server performance! Recommended are values bigger than 60 seconds. Probably an interval of a few minutes will be sufficient too. fwd needs nearly no system ressources in "wait state". Moreover don`t forget that eventually every time fwd polls, an email may be sent if ressources change often: this could cause a mail avalanche! |
| Report | Not used at the moment. Please leave unchanged. |
| Mail | Settings for email notification function |
| | host | Mail SMPTP host: Javamail needs this smpt host to send emails. E.g. |
| from | From Address, not really important, but will be displayed as "from" address to person who receives notification emails. |
| to | Address of person who wants to be notified when modifications occured. |
| subject | Subject of emails sent. |
| contentstart | Text to be put into email content before the notification text appears. |
| contentend | Text to be put into email content after the notification text appears. |
| Log | |
| | filename | Filename of Logfile, where all changes are logged. |
| WATCHES | This is the main section, where the ressources to be watched are defined. |
| | Watch | type="file" | File type watch: watches one file on server. Every modification is notified. |
| name | Name of this watch; informal: this name is used as "header" in notification email or log. |
| filename | Filename to be watched. |
| less | value 0 - ... If the watched file is detected to be modified: the last less lines are sent with the email notification to the administrator. Warning: Set this value to 0 when binary files are watched! |
| Watch | type="directory" | Directory type watch: Certain or all files in a directory are observed. Every time one of the files with a certain extension is modified, added or deleted, a notification is created. |
| name | Name of this watch; informal: this name is used as "header" in notification email or log. |
| filename | Directory in which files with certain extension should be observed. |
| extension | Enter the extension to observe certain file-types. To observe all files in a directory (a complete directory) use *. You can use more than one extension tag. |
4. Start Filewatchdog
Windows
On Windows Systems: start the go.bat batch file as long as you use the "config.xml" configuration file. If you want to use another config file, or start multiple instances of fwd with different config settings, please modify the batch file.
Other systems/Manual Startup
On other systems modify the batch file or start fwd manually:
|
java -classpath mail.jar;activation.jar;FileWatchDog.jar filewatchdog.FileWatchdog config.xml
|
You can easily write different configuration settings into different configuration files.Simply add the desired configuration file as application parameter. Please leave the first two lines (including the !DOCTYPE line) in the config file to guarantee that the syntax of the config file is checked by the parser.
5. Stop Filewatchdog
Fwd will no stop automatically when it is started. To stop it use Ctrl-c on windows systems, the kill command on Unix systems, or any other task management-"kill"-function of the OS you are using.
6. Contact
If you should have requests or comments considering Filewatchdog, please send me an Email. If you should add some significant functionality into the tool, please let me know, so that I can add these functions into fwd.
If you should detect bugs, contact me too!
|