Script Tcpdump amb Gnuplot

per Jordi Farrero darrera modificació 2022-01-25T12:03:03+02:00

#!/bin/sh

while true;

do
tcpdump -i eth1 -w band.dmp &
sleep 30
killall tcpdump
tcpstat -r band.dmp -o %S\ %b\\n 30 >> band
tail -n 120 band > band.tmp
cat band.tmp > band
gnuplot band.gnuplot
done

-----------------------------------------

#!/bin/sh

while true;
do
tcpdump -i enp0s3 -w band.pcapng &
pid=$!
echo $pid
sleep 10
pkill $pid
sudo chmod 777 band.pcapng
tcpstat -r band.pcapng -o %S\ %b\\n 30 >> band
sleep 2
rm band.pcapng
sleep 5
#tail -n 120 band > band.tmp
#cat band.tmp > band
#gnuplot band.gnuplot
done