Ticket #820: if_.in.diff
| File if_.in.diff, 1.3 kB (added by ja, 2 years ago) |
|---|
-
munin-1.4.4/plugins/node.d.sunos/if_.in
old new 42 42 43 43 . $MUNIN_LIBDIR/plugins/plugin.sh 44 44 45 SOLVERSION=`uname -r | awk -F. '{print $2}` 45 46 INTERFACE=${0##*/if_} 46 47 47 48 if [ "$1" = "autoconf" ]; then … … 56 57 57 58 if [ "$1" = "suggest" ]; then 58 59 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 60 65 exit 0 61 66 else 62 67 exit 1 … … 87 92 exit 0 88 93 fi; 89 94 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 }' 95 if [ $SOLVERSION -le 10 ] # Solaris 10 and earlier 96 then 97 kstat -p -n $INTERFACE -s '/^[ro]bytes$/' | awk -F: ' 98 { 99 split($4, four, "\t") 100 print four[1] ".value", four[2] 101 }' 102 elif [ $SOLVERSION -eq 11 ] # OpenSolaris 103 then 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 }' 109 fi
