I can't find the lsof command in ESX 4:
~ # lsof
-ash: lsof: not found
~ # which lsof
~ # echo $PATH
/bin:/sbin
~ #
On my 3.5 servers, its there. Is it supposed to be removed in ESX 4? If so, can we get it back? It's handy, that's for sure.
try running with root permissions
[root@phx03501 ~]# vmware -v VMware ESX 4.0.0 build-164009 [root@phx03501 ~]# lsof | more COMMAND PID USER FD TYPE DEVICE SIZE NODE NAM E init 1 root cwd DIR 8,40 4096 2 / init 1 root rtd DIR 8,40 4096 2 / init 1 root txt REG 8,40 43496 144005 /sb in/init init 1 root mem REG 8,40 134400 512275 /li b64/ld-2.5.so init 1 root mem REG 8,40 1699912 512276 /li b64/libc-2.5.so init 1 root mem REG 8,40 23360 512277 /li b64/libdl-2.5.so init 1 root mem REG 8,40 247528 512002 /li b64/libsepol.so.1 init 1 root mem REG 8,40 95464 512284 /li b64/libselinux.so.1 init 1 root 10u FIFO 0,15 2351 /de v/initctl ksoftirqd 2 root cwd DIR 8,40 4096 2 / ksoftirqd 2 root rtd DIR 8,40 4096 2 / ksoftirqd 2 root txt unknown /pr oc/2/exe events/0 3 root cwd DIR 8,40 4096 2 / --More--
I was root. Can you tell me what directory the lsof binary is supposed to be?
~ # vmware -v
VMware ESXi 4.0.0 build-193498
~ # id
uid=0(root) gid=0(root)
~ # lsof
-ash: lsof: not found
[root@phx03501 ~]# which lsof /usr/sbin/lsof [root@phx03501 ~]#
Any ideas are welcome on why its missing in our install (is it an option?), otherwise thanks for the letting us know it should be there.
Is this ESXi?
--Matt
VCP, vExpert, Unix Geek
good call Matt, I missed that one. lsof is not available in ESXi
http://kb.vmware.com/kb/1010993
Note: At the time of publication, there is no way to:
Show network connection (socket) details (for example, netstat)
Tell how many open files a process holds (for example, lsof)