source: packages/admin/muninlite/patches/100-fix-no-ethtool.patch @ 26973

Last change on this file since 26973 was 26973, checked in by cshore, 6 years ago

[naalstones] muninlite: Fixes: Error messages on server due to missing ethtool on node, recognition of tapX devices, recognition of openwrt bridges, and workaround for dashes in interface names (replace with an underscore on graph)

File size: 691 bytes
  • plugins/if_

    a b config_if() { 
    1515  echo "up.min 0" 
    1616  echo "up.negative down" 
    1717  echo "up.cdef up,8,*" 
    18   if ethtool $1 | grep -q Speed; then 
    19     MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\  -f2) * 1000000)) 
    20     echo "up.max $MAX" 
    21     echo "down.max $MAX" 
     18  if [ -n "$(which ethtool)" ]; then 
     19        if [ -x "$(which ethtool)" ]; then 
     20                if ethtool $1 | grep -q Speed; then 
     21                        MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\  -f2) * 1000000)) 
     22                        echo "up.max $MAX" 
     23                        echo "down.max $MAX" 
     24                fi 
     25        fi 
    2226  fi 
    2327} 
    2428fetch_if() { 
Note: See TracBrowser for help on using the repository browser.