SUMMARY: monitoring usage of a file

Date: Fri Nov 17 2000 - 01:53:23 CST


Sorry for the late submission...

Original Question:

1)I would like to monitor a file and keep track of WHO execute it and WHEN
it is being executed. Can I do it in Solaris without any 3rd party tools?
If not, what 3rd party tools should I use? How do I do so?

2) In addition, is it possible for me to send an alert to a remote server
that the file is being used (with the identity of the user and the time)?
Do I set this up in the syslog.conf file? If yes, what's the source and
facility levels I should specify?

1) Yes, most suggested the use of a wrapper script over the file that I
wish to monitor. Best answer came from Jay Lessert (see below). Others
suggested the audit facility, sudo and LSOF (to check if the file is
2) Yes, I set this up in the syslog.conf file. Again, the best answer comes
from Jay Lessert (keep it up, Jay!)

Lastly, thanks to: Jay Lessert, David Foster, Andrew Brenann, Erin Jones,
David Evans, Peter Gutmann, Keith McCabe, Gary Jenson, Jeff Lightner, Marco
Shaw, Doug Winter, JCJ6.

Thanks gurus!!!

>From Jay Lessert:
1) Only by using a wrapper script. Suppose you want to monitor something

    # mv /usr/bin/renice /usr/bin/renice.exe
    # cat > /usr/bin/renice
    # put monitoring stuff here
    exec $0.exe $@
    # chmod 755 /usr/bin/renice

The "monitoring stuff" can be anything you want. You can send e-mail if

2) You can do something like:

    # cat > /usr/bin/renice
    # monitoring stuff
    logger -p $0
    exec $0.exe $@
    # chmod 755 /usr/bin/renice

Your client syslog.conf looks like: @serverhost

and the server's syslog.conf looks like: /var/log/file_access.log

U BEFORE POSTING please READ the FAQ located at
. and the list POLICY statement located at
A To submit questions/summaries to this list send your email message to:
A To unsubscribe from this list please send an email message to:
E and in the BODY type:
R unsubscribe sun-managers
S Or
. unsubscribe sun-managers original@subscription.address
L To view an archive of this list please visit:

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