Operating System - HP-UX
1821250 Members
3061 Online
109632 Solutions
New Discussion юеВ

Re: monitoring file access

 
SOLVED
Go to solution
Marco Salvi
Advisor

monitoring file access

Anyone know how to monitoring what process access a file?
I tried with fuser but it doesn't fit my need.
I need some utility that create a list of the all process that have accessed a specific file.

11 REPLIES 11
Victor BERRIDGE
Honored Contributor

Re: monitoring file access

Hi,
What about lsof then, if you dont have it you will have to go to your prefered porting archive center and download the product...


All the best
Victor
Mahesh Kumar Malik
Honored Contributor

Re: monitoring file access

Hi Marco"

"lsof" a contributory utility may be of help to you. Please visit following link for download

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.76/

Regards
Mahesh
Steven E. Protter
Exalted Contributor
Solution

Re: monitoring file access

finding this out is a multi step operation.

fuser -cu /filesystem

can show open processes on a filesystem.

lsof can provide data on processes and is pretty useful.

But all processes that have accessed a specific file? Maybe if the system was trusted, you could set up auditing reports to do that for you.

HIDS/9000 comes to mind, but I'm not sure either is the right tool for this job.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vibhor Kumar Agarwal
Esteemed Contributor

Re: monitoring file access

A file doesn't have any indication of what processed accessed it in the past.

You can get the no. of processed accessing it at a particular snapshot.

Or simply run a script via cron which appends that to a log.
Vibhor Kumar Agarwal
RAC_1
Honored Contributor

Re: monitoring file access

lsof will give details about open files hold by a process. Once process is completed, you won't get any details.

Get lsof from following.

http://hpux.connect.org.uk
There is no substitute to HARDWORK
Jannik
Honored Contributor

Re: monitoring file access

the lsof is the best choise:
http://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/binaries/hpux/
use this download it works!
jaton
Alessandro Pilati
Esteemed Contributor

Re: monitoring file access

Marco,
here you can download directly the binaries of lsof:

http://www.mirrors.wiretapped.net/security/host-security/lsof/binaries/hpux/

Ciao,
Alessandro
if you don't try, you'll never know if you are able to
Alessandro Pilati
Esteemed Contributor

Re: monitoring file access

Here you have a lot of Faq and answers about lsof:
http://www.mirrors.wiretapped.net/security/host-security/lsof/FAQ

Regards,
Alessandro
if you don't try, you'll never know if you are able to
Marco Salvi
Advisor

Re: monitoring file access

Thanks a lot for the answers, anyway lsof doesn't help me.
lsof can't report when a file is opened by the vi editor, so all the processes that have a behaviour similar to vi are not be catched by lsof.
Srimalik
Valued Contributor

Re: monitoring file access

I am not sure if this will be acceptable to u but anyways:

you can try HIDS( Host intrusion detection system).
create rules on the filename.
abandon all hope, ye who enter here..
Srimalik
Valued Contributor

Re: monitoring file access

oops this thread is 2 yrs old.
abandon all hope, ye who enter here..