Operating System - HP-UX
1836544 Members
3057 Online
110102 Solutions
New Discussion

Re: How I can know the files opens ?? (nfile)

 
SOLVED
Go to solution
Carme Torca
Super Advisor

How I can know the files opens ?? (nfile)

Hi,

Is there any way to know what files are openned??, for example I can do:

# sar -v 1 5

HP-UX hp9sap01 B.11.00 U 9000/800 10/14/03

17:50:12 text-sz ov proc-sz ov inod-sz ov file-sz ov
17:50:13 N/A N/A 400/4224 0 3945/24576 0 17627/24586 0
17:50:14 N/A N/A 402/4224 0 3957/24576 0 17632/24586 0
17:50:15 N/A N/A 409/4224 0 3967/24576 0 17646/24586 0
17:50:16 N/A N/A 410/4224 0 3976/24576 0 17656/24586 0
17:50:17 N/A N/A 401/4224 0 3978/24576 0 17630/24586 0


but is there any way to know what files are openned last of the 17680 files opened??? or what process is spend all this opened files??

Thanks!!!
Carmen.
Users are not too bad ;-)
11 REPLIES 11
Steven E. Protter
Exalted Contributor

Re: How I can know the files opens ?? (nfile)

fuser -cu /filesystem will get you the process id's but you need a third party tool like lsof to get more details on what the filenames are.

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

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
Brian Bergstrand
Honored Contributor

Re: How I can know the files opens ?? (nfile)

If you want to know the names of the files open and what processes have those open, you need lsof.

I belive this available on the ports archive.
Massimo Bianchi
Honored Contributor

Re: How I can know the files opens ?? (nfile)

nfile can be monitored with glance, if i remember well.

If you want to know which process what files holds, the use lsof as suggested.

Massimo
Mark Grant
Honored Contributor

Re: How I can know the files opens ?? (nfile)

SEP, as usual, offers you sound advice. I refer to the part of your question asking if you can tell which was the last file opened. I think I can safely say that you just can't do that, particularly as files are being opened and closed all the time on a running system.
Never preceed any demonstration with anything more predictive than "watch this"
Carme Torca
Super Advisor

Re: How I can know the files opens ?? (nfile)

HI,


I have try to down lsof from this page but its only for 32 bits and I have a system HP-UX 11.00 64 bits.... Is there other wayt to down it for 64 bits??

Thanks!!
Carmen.
Users are not too bad ;-)
Brian Bergstrand
Honored Contributor

Re: How I can know the files opens ?? (nfile)

32 bit programs will work fine on 64bit OS's, just not the other way around. Go ahead and use it.
Rodney Hills
Honored Contributor

Re: How I can know the files opens ?? (nfile)

Attached is a "shar" file with the 64-bit version of lsof.

Enjoy

-- Rod Hills
There be dragons...
Rodney Hills
Honored Contributor

Re: How I can know the files opens ?? (nfile)

For the most part, Brian is correct, but "lsof" is one of those kernel dependant
programs that has to be compiled to the target system

-- Rod Hills
There be dragons...
Carme Torca
Super Advisor

Re: How I can know the files opens ?? (nfile)

Hi,

I have unshar the file, and it shows error:
(my server its 11.00 no 11.11)

f# /usr/local/bin/lsof
lsof: WARNING: compiled for HP-UX release B.11.11; this is B.11.00.
lsof: FATAL: pst_status_size should be: 1176; is 920
lsof: FATAL: pst_vminfo_size should be: 1240; is 1096
lsof: FATAL: pst_static doesn't contain pst_filedetails_size
lsof: FATAL: pst_static doesn't contain pst_socket_size
lsof: FATAL: pst_static doesn't contain pst_stream_size
lsof: FATAL: pst_static doesn't contain pst_mpathnode_size
lsof: FATAL: pst_static doesn't contain pst_fileinfo2_size

and the other link... I don't know how installed it?, maybe I have to compile it?

Thanks!!
Carmen.
Users are not too bad ;-)
Rodney Hills
Honored Contributor
Solution

Re: How I can know the files opens ?? (nfile)

Go to the porting and archive center. Do a search on "lsof" and that version is 64-bit hpux11.00

http://hpux.cs.utah.edu/

HTH

-- Rod Hills
There be dragons...
Rodney Hills
Honored Contributor

Re: How I can know the files opens ?? (nfile)

Or try

http://the-other.wiretapped.net/security/host-security/lsof/binaries/hpux/B.11.00/vxfs/64/9000_800/

I'm note sure about the porting and archive (if it's 32 or 64 bit). But I think the above link is 64 bit.

HTH

-- Rod Hills
There be dragons...