Re: How to know who use NFS.

2007-09-25 Thread Martin Alejandro Paredes Sanchez
El Lun 24 Sep 2007, Albert Shih escribió:
  Le 23/09/2007 à 00:27:15-0700, Martin Alejandro Paredes Sanchez a écrit
 I've two servers :

   Server A (NFS) --- NFS -- Server B

 On server A there one service is NFS, and server B is it's client.

 On server B I've lot of users, some users make very huge transfert throught
 NFS (what I don't want), huge = ~ 10-100 Go in one time (big file).

 I want to known who did this, because I've lot of users it's not easy to
 known when I'm using top/ps to known who did this (sometime it's the output
 of some scientifique software).

 The solution you give me can tell me the name of server B, but this thing I
 known it ;-), what I want to known is WHO on server B.


Ok, that change the problem, but I think tcpdump is still usefull, only if the 
the problem is caused when a user copy one huge file in one time, this 
because I assume 1 socket is created for each file copied (I am not an expert 
in NFS)

In computer B run this command (piped) as root

tcpdump -c 100 -nq dst port nfs and dst host serverB
nawk 'BEGIN {FS=[ .]}{print $8}'
nawk '{packets[$1]++} END{for (ip in packets){print packets[ip], ip}}'
sort -rn

In the last line will appear socket number that generate more packets, 
something like this:

59891

To know who has that socket, run

# sockstat -4c | grep :59891
USER COMMANDPID   FD PROTO  LOCAL ADDRESS FOREIGN ADDRESS
martin   kdeinit1173  9  tcp4   192.168.45.25:59891   192.168.45.43:2049

The first column is the user, lets see what is doing

# ps -wxU martin


 Do you think I need to use dark side of the forceI known it's not more
 powerful, but it's more easy ;-)


You mean windows (for the easy), NN.

If the problem is caused, because the user is copying a folder

cp  ~/MySmallFiles/*  /serverB/dest/

maybe, each file will create a different socket, because of that, you will 
need to translate each socket to a user before counting the packets, I think 
that is a job for perl, phyton or something like that.

maps
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to know who use NFS.

2007-09-24 Thread Albert Shih
 Le 23/09/2007 à 00:27:15-0700, Martin Alejandro Paredes Sanchez a écrit
 El Vie 21 Sep 2007, Albert Shih escribió:
   Le 21/09/2007 à 13:59:35-0500, Dan Nelson a écrit
   In the last episode (Sep 21), Le Cocq Michel said:
Albert Shih a écrit :
 How can I known at un precise moment who charge my NFS server (I'm
 root in both side : client and server).

With some info student it also happen some times in here, and the way i 
find is to launch a tcpdum or ethereal on the server and look at which
ip appear the more often
   
   I think ethereal/wireshark is your best bet too.  At least with it you 
   can filter on the userid making an NFS request (it's rpc.auth.uid).
   Unfortunately it doesn't look like there's a summary or analysis option
   for NFS, so you'll have to count packets maually...
  
  But my problem is the NFS traffic is heavy in standard time, and wireshark 
  or tcpdump give my lot of lot of data.
 

Thanks 
 
 Use the force luke
 
I like this ;-) 

 You only need 100 packets (you may decide to increase) that are directed to 
 your server, to the NFS daemon.
 
 tcpdump -c 100 -nq dst port nfs and dst host $HOST
 
 You don't need to interpret this info, you need to know who is originating 
 the 
 traffic, lets extract the ip that are originating the traffic
 
 nawk 'BEGIN {FS=[ .]; OFS=.} {print $4,$5,$6,$7}'
 
 But, who generate more traffic?
 Lets count how many packets are originating each one of those ip
 
 nawk '{packets[$1]++} END{for (ip in packets){print packets[ip], ip}}'
 
 And order it
 
 sort -rn
 
 Use pipes to connect all the commands, if this situation is very common, 
 create a shell.

Thanks again.

 
 HTH

I think so.


Regards.


--
Albert SHIH
Observatoire de Paris Meudon
SIO batiment 15
Heure local/Local time:
Lun 24 sep 2007 12:01:11 CEST
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to know who use NFS.

2007-09-24 Thread Albert Shih
 Le 23/09/2007 à 00:27:15-0700, Martin Alejandro Paredes Sanchez a écrit
 
 Use the force luke
 
 You only need 100 packets (you may decide to increase) that are directed to 
 your server, to the NFS daemon.
 
 tcpdump -c 100 -nq dst port nfs and dst host $HOST
 
 You don't need to interpret this info, you need to know who is originating 
 the 
 traffic, lets extract the ip that are originating the traffic
 
 nawk 'BEGIN {FS=[ .]; OFS=.} {print $4,$5,$6,$7}'
 
 But, who generate more traffic?
 Lets count how many packets are originating each one of those ip
 
 nawk '{packets[$1]++} END{for (ip in packets){print packets[ip], ip}}'
 
 And order it
 
 sort -rn

OK, but that's not I'm exactly I search.

I ask again my question because It's seem my poor english make my question
not clear.

I've two servers :

Server A (NFS) --- NFS -- Server B

On server A there one service is NFS, and server B is it's client.

On server B I've lot of users, some users make very huge transfert throught
NFS (what I don't want), huge = ~ 10-100 Go in one time (big file).

I want to known who did this, because I've lot of users it's not easy to
known when I'm using top/ps to known who did this (sometime it's the output
of some scientifique software). 

The solution you give me can tell me the name of server B, but this thing I
known it ;-), what I want to known is WHO on server B.

Do you think I need to use dark side of the forceI known it's not more 
powerful,
but it's more easy ;-)

Regads.

JAS
--
Albert SHIH
Observatoire de Paris Meudon
SIO batiment 15
Heure local/Local time:
Lun 24 sep 2007 15:12:56 CEST
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to know who use NFS.

2007-09-23 Thread Martin Alejandro Paredes Sanchez
El Vie 21 Sep 2007, Albert Shih escribió:
  Le 21/09/2007 à 13:59:35-0500, Dan Nelson a écrit
  In the last episode (Sep 21), Le Cocq Michel said:
   Albert Shih a écrit :
How can I known at un precise moment who charge my NFS server (I'm
root in both side : client and server).
   
   With some info student it also happen some times in here, and the way i 
   find is to launch a tcpdum or ethereal on the server and look at which
   ip appear the more often
  
  I think ethereal/wireshark is your best bet too.  At least with it you 
  can filter on the userid making an NFS request (it's rpc.auth.uid).
  Unfortunately it doesn't look like there's a summary or analysis option
  for NFS, so you'll have to count packets maually...
 
 But my problem is the NFS traffic is heavy in standard time, and wireshark 
 or tcpdump give my lot of lot of data.


Use the force luke

You only need 100 packets (you may decide to increase) that are directed to 
your server, to the NFS daemon.

tcpdump -c 100 -nq dst port nfs and dst host $HOST

You don't need to interpret this info, you need to know who is originating the 
traffic, lets extract the ip that are originating the traffic

nawk 'BEGIN {FS=[ .]; OFS=.} {print $4,$5,$6,$7}'

But, who generate more traffic?
Lets count how many packets are originating each one of those ip

nawk '{packets[$1]++} END{for (ip in packets){print packets[ip], ip}}'

And order it

sort -rn

Use pipes to connect all the commands, if this situation is very common, 
create a shell.

HTH
maps
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to know who use NFS.

2007-09-21 Thread Le Cocq Michel
With some info student it also happen some times in here, and the way i
find is to launch a tcpdum or ethereal on the server and look at which
ip appear the more often

Michel

Albert Shih a écrit :
 Hi all

 Sometime I've a user (or some users but not lot of users) make a very huge
 transfert through NFS. I don't want that.

 How can I known at un precise moment who charge my NFS server (I'm root in
 both side : client and server).

 Regards.

 --
 Albert SHIH
 Observatoire de Paris Meudon
 SIO batiment 15
 Heure local/Local time:
 Jeu 20 sep 2007 19:23:03 CEST
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
   

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to know who use NFS.

2007-09-21 Thread Dan Nelson
In the last episode (Sep 21), Le Cocq Michel said:
 Albert Shih a écrit :
  Sometime I've a user (or some users but not lot of users) make a
  very huge transfert through NFS. I don't want that.
 
  How can I known at un precise moment who charge my NFS server (I'm
  root in both side : client and server).

 With some info student it also happen some times in here, and the way i
 find is to launch a tcpdum or ethereal on the server and look at which
 ip appear the more often

I think ethereal/wireshark is your best bet too.  At least with it you
can filter on the userid making an NFS request (it's rpc.auth.uid). 
Unfortunately it doesn't look like there's a summary or analysis option
for NFS, so you'll have to count packets maually...

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to know who use NFS.

2007-09-21 Thread Albert Shih
 Le 21/09/2007 à 13:59:35-0500, Dan Nelson a écrit
 In the last episode (Sep 21), Le Cocq Michel said:
  Albert Shih a écrit :
   Sometime I've a user (or some users but not lot of users) make a
   very huge transfert through NFS. I don't want that.
  
   How can I known at un precise moment who charge my NFS server (I'm
   root in both side : client and server).
 
  With some info student it also happen some times in here, and the way i
  find is to launch a tcpdum or ethereal on the server and look at which
  ip appear the more often
 
 I think ethereal/wireshark is your best bet too.  At least with it you
 can filter on the userid making an NFS request (it's rpc.auth.uid). 
 Unfortunately it doesn't look like there's a summary or analysis option
 for NFS, so you'll have to count packets maually...

Thanks for that.

But my problem is the NFS traffic is heavy in standard time, and wireshark
or tcpdump give my lot of lot of data. 

But I'm going to try again.

Regards.

--
Albert SHIH
Observatoire de Paris Meudon
SIO batiment 15
Heure local/Local time:
Ven 21 sep 2007 22:16:34 CEST
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


How to know who use NFS.

2007-09-20 Thread Albert Shih
Hi all

Sometime I've a user (or some users but not lot of users) make a very huge
transfert through NFS. I don't want that.

How can I known at un precise moment who charge my NFS server (I'm root in
both side : client and server).

Regards.

--
Albert SHIH
Observatoire de Paris Meudon
SIO batiment 15
Heure local/Local time:
Jeu 20 sep 2007 19:23:03 CEST
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]