Salut
Voila je ne savais pas quoi faire dont j’ai codé !
Le script
#!/bin/bash
echo "" >> NetStat.log
date +"%m-%d-%Y-%T" >> NetStat.log
ping -c 3 -i 2 testdebit.info >> NetStat.log
iperf -c iperf.testdebit.info -i 2 -t 20 -r >> NetStat.log
wget http://1.testdebit.info/fichiers/1Mo.dat -O /dev/null 2>&1 | tail -2 >> NetStat.log
L’output
05-26-2015-15:01:28
PING testdebit.info (46.227.16.8) 56(84) bytes of data.
64 bytes from lafibre.info (46.227.16.8): icmp_seq=1 ttl=54 time=327 ms
64 bytes from lafibre.info (46.227.16.8): icmp_seq=2 ttl=54 time=350 ms
64 bytes from lafibre.info (46.227.16.8): icmp_seq=3 ttl=54 time=387 ms
--- testdebit.info ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 327.449/355.059/387.313/24.659 ms
------------------------------------------------------------
Client connecting to iperf.testdebit.info, TCP port 5001
TCP window size: 45.0 KByte (default)
------------------------------------------------------------
[ 4] local 10.255.255.104 port 53275 connected with 89.84.127.54 port 5001
[ ID] Interval Transfer Bandwidth
[ 4] 0.0- 2.0 sec 256 KBytes 1.05 Mbits/sec
[ 4] 2.0- 4.0 sec 384 KBytes 1.57 Mbits/sec
[ 4] 4.0- 6.0 sec 896 KBytes 3.67 Mbits/sec
[ 4] 6.0- 8.0 sec 1.25 MBytes 5.24 Mbits/sec
[ 4] 8.0-10.0 sec 1.75 MBytes 7.34 Mbits/sec
[ 4] 10.0-12.0 sec 1.88 MBytes 7.86 Mbits/sec
[ 4] 12.0-14.0 sec 2.75 MBytes 11.5 Mbits/sec
[ 4] 14.0-16.0 sec 1.75 MBytes 7.34 Mbits/sec
[ 4] 16.0-18.0 sec 1.75 MBytes 7.34 Mbits/sec
[ 4] 18.0-20.0 sec 1.62 MBytes 6.82 Mbits/sec
[ 4] 0.0-20.2 sec 14.4 MBytes 5.97 Mbits/sec
2015-05-26 15:04:55 (54,1 KB/s) — « /dev/null » sauvegardé [10000000/10000000]
Cependant, J’ai une erreure lors de l’execution :
machin@truc/home/user# ./NetStat.sh
bind failed: Address already in use
Si vous avez des idées/optimisation ou conseil (“C’est de la merde ske tu fait !”)
ps:Premier scripte en Bash que je fais , soyez cool