SUMMARY: How to monitor (by a daemon) activities on a file or folder

From: yuming@cusun.ims.att.com
Date: Wed Jan 27 1999 - 09:19:29 CST


The Original Question:
how to monitor activities on a file or folder of a given path?
(Under Solaris) For a file or folder on a given path, is it possible to set up a daemon to monitor activities on the file or folder? Say, a file is modified,or a new file is created, ... If so, how?

Each of the following can be a solution:

1. Install Tripwire from Purdue University. The initial run creates a
database of file "signatures", subsequent runs can update the database or
report against it. It's available from
http://www.cert.org/ftp/tools/tripwire/
http://www.mindspring.com/~dwarfie
http://www.visualcomputing.com/

2. Install lsof from
ftp://vic.cc.purdue.edu/pub/tools/unix/lsof

3. Install Security products from Axcent or Platinum/Memco.
AutoSecure 3.1.1 is for Solaris 2.5.1 and Autosecure 4.0 is for Solaris 2.6
from Platinum. The AutoSecure product has a watchdog daemon to monitor any file.
Better is the access rules to stop root or anyone from modifying files that
you wish to stay untouched. (Seems this is not a freeware)

4. By following script and a "daemon maker"
   while true
   do
     if [[ -f /a/file ]] or something like that
     then
       mailx
     fi
     sleep 10
   done

   Use submit to submit above shell script. submit make it a daemon.
   submit can be obtained from the URL in my signature.
unix programs: niftp (non-interactive recursive ftp), hide (hide command args),
submit (replace nohup), etc from ftp://ftp.mindspring.com/users/mwang/unix-prog

5. (building your own code) C & Perl reference book:
Advanced Unix Programming, by Marc J Rochkind, Prentice Hall Software
Series, 1985, ISBN 0-13-011800-1
An oldie, but it contains all you need to know. Alternatively, read the
Rochkind book and write it in Perl.

Thanks to
Michael Wang <mwang@tech.cicg.ml.com>
Colin Melville <Colin_Melville@mastercard.com>
Chad Price <cprice@molbio.unmc.edu>
Alan orndorff <dwarf333@yahoo.com>
sandesh <sandesh@bom5.vsnl.net.in>
Nick Hindley" <N.A.Hindley@itsd.lbhf.gov.uk>
Horatio Jones <horatio@earthling.net>
Dennis Martens <MARTENSD@health.qld.gov.au>

Yuming Huang



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:14 CDT