vendredi 7 mars 2014

Grep values from nethog and netperf


Vote count:

0




I need to monitor the network activities of a process and the bandwidth of the connection. So I decided to use nethog and netperf combine with grep and awk to write the values to a file.


nethog command: nethogs -t eth0 | grep firefox | awk '{ print $3 }' (I want to take the upload/download speed). The 1st problem is that command doesn't print anything.


netperf command: netperf -H 192.168.1.10 and the output is:



Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec

524288 524288 262144 10.00 **718.62**


I want to print the value on the bottom right but have no idea how to. That's the 2nd problem


Can you guys help me out? Any ideas will be appreciated!



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire