Ticket #820: if_.in.diff

File if_.in.diff, 1.3 kB (added by ja, 2 years ago)

Patch for if_.in

  • munin-1.4.4/plugins/node.d.sunos/if_.in

    old new  
    4242 
    4343. $MUNIN_LIBDIR/plugins/plugin.sh 
    4444 
     45SOLVERSION=`uname -r | awk -F. '{print $2}` 
    4546INTERFACE=${0##*/if_} 
    4647 
    4748if [ "$1" = "autoconf" ]; then 
     
    5657 
    5758if [ "$1" = "suggest" ]; then 
    5859        if [ -x /usr/bin/kstat ]; then 
    59                 kstat -m link -p -s '/^rbytes$/' | awk -F: '{ print $3 }' 
     60                if [ $SOLVERSION -le 10 ]; then 
     61                        kstat -p -s '/^rbytes$/' | awk -F: '{ print $3 }' 
     62                elif [ $SOLVERSION -eq 11 ]; then 
     63                        kstat -m link -p -s '/^rbytes$/' | awk -F: '{ print $3 }' 
     64                fi 
    6065                exit 0 
    6166        else 
    6267                exit 1 
     
    8792        exit 0 
    8893fi; 
    8994 
    90 kstat -p -n $INTERFACE -m link -s '/^[ro]bytes$/' | awk -F: ' 
    91 
    92         split($4, four, "\t") 
    93         print four[1] ".value", four[2] 
    94 }' 
     95if [ $SOLVERSION -le 10 ]       # Solaris 10 and earlier 
     96then 
     97        kstat -p -n $INTERFACE -s '/^[ro]bytes$/' | awk -F: ' 
     98        { 
     99                split($4, four, "\t") 
     100                print four[1] ".value", four[2] 
     101        }' 
     102elif [ $SOLVERSION -eq 11 ]     # OpenSolaris 
     103then 
     104        kstat -p -n $INTERFACE -m link -s '/^[ro]bytes$/' | awk -F: ' 
     105        { 
     106                split($4, four, "\t") 
     107                print four[1] ".value", four[2] 
     108        }' 
     109fi