New program to process iftop log output (#6668)

* New program to process iftop log output

* fixes

* fix shellcheck

* address review comments

* more review comments
This commit is contained in:
Pankaj Garg
2019-10-31 18:22:57 -07:00
committed by GitHub
parent d2c66c40c6
commit 2e30926ac3
7 changed files with 213 additions and 5 deletions

View File

@ -8,9 +8,9 @@ set -e
cd "$(dirname "$0")"
sudo iftop -i "$(ifconfig | grep mtu | grep -iv loopback | grep -i running | awk 'BEGIN { FS = ":" } ; {print $1}')" -nNbBP -t \
| awk '{ if ($3 ~ "=>") { print $2, $7 } else if ($2 ~ "<=") { print $1, $6 }} ' \
| awk 'NR%2{printf "%s ",$0;next;}1' \
| awk '{ print $1, "<=>", $3, ":", $2, $4 }'
sudo=
if sudo true; then
sudo="sudo -n"
fi
exit 1
$sudo iftop -i "$(ifconfig | grep mtu | grep -iv loopback | grep -i running | awk 'BEGIN { FS = ":" } ; {print $1}')" -nNbBP -t