diff options
Diffstat (limited to 'analyze.sh')
-rwxr-xr-x | analyze.sh | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2,9 +2,11 @@ sleep=1 -stats1=($(ethtool -S ens11 | grep -P "rx\d?_(packets|bytes)" | awk '{ print $2 }')) +int=$(ip addr show | grep "192\.168\.2\." | awk '{ print $NF }') + +stats1=($(ethtool -S $int | grep -P "rx\d?_(packets|bytes)" | awk '{ print $2 }')) sleep $sleep -stats2=($(ethtool -S ens11 | grep -P "rx\d?_(packets|bytes)" | awk '{ print $2 }')) +stats2=($(ethtool -S $int | grep -P "rx\d?_(packets|bytes)" | awk '{ print $2 }')) for i in "${!stats1[@]}"; do diff=$(bc <<< "(${stats2[$i]} - ${stats1[$i]}) / $sleep") |