Skip to content

Instantly share code, notes, and snippets.

@jnikolak
Last active October 21, 2017 12:14
Show Gist options
  • Save jnikolak/660ef7ae10bb3cdd53afbebc9c786c0c to your computer and use it in GitHub Desktop.
Save jnikolak/660ef7ae10bb3cdd53afbebc9c786c0c to your computer and use it in GitHub Desktop.
ring buffer script
#!/bin/bash
declare -a arr
# List all interfaces and assign it to the Variable DEV, then get the current ring buffer settings for each interface
# Create its own seperate file, so we can manipulate the output
# assign each of the output into an array
for DEV in $(ip a l | grep mtu | awk '{print $2}' | awk -F ":" '{print $1}'| egrep -v "^lo|virbr*|bond*|*team")
do
ethtool -g $DEV 2>/dev/null > eth_$DEV
egrep "RX:" eth_$DEV
# arr=($(ethtool -g $DEV | awk -F" " '{print $2,$5}'))
# echo ${arr[*]};
done
# https://stackoverflow.com/questions/17403498/iterate-over-two-arrays-simultaneously-in-bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment