3 IBPATH=${IBPATH:-@IBSCRIPTPATH@}
6 echo Usage: `basename $0` "[-h] [-b] [-v] [-G] [-N | -nocolor]" \
7 "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid>" \
13 if [ "$bw" = "yes" ]; then
14 if [ "$verbose" = "yes" ]; then
19 if [ "$verbose" = "yes" ]; then
20 echo -e "\\033[1;032m" $1 "\\033[0;39m"
25 if [ "$bw" = "yes" ]; then
29 echo -e "\\033[1;031m" $1 "\\033[0;39m"
54 -P | -C | -t | -timeout)
63 ca_info="$ca_info $1 $2"
87 if [ "$portnum" = "255" ]; then
93 if [ "$guid_addr" ]; then
94 if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
95 echo -n "guid $1 address resolution: "
102 if ! temp=`$IBPATH/ibaddr $ca_info -L $1 | awk '/failed/{exit -1} {print $1}'`; then
103 echo -n "lid $1 address resolution: "
109 nodename=`smpquery $ca_info nodedesc $lid | sed -e "s/^Node Description:\.*\(.*\)/\1/"`
111 text="`eval $IBPATH/perfquery $ca_info $lid $portnum`"
113 if echo "$text" | awk -v mono=$bw -v brief=$brief -F '[.:]*' '
116 if (brief == "yes") {
122 printf "\033[1;034m" s
127 # Only display Xmit/Rcv Pkts/Data
129 /^# Port counters/ {print}
131 /^CounterSelect/ {next}
133 /AllPortSelect/ {next}
135 /^ib/ {print $0; next}
136 /ibpanic:/ {print $0}
138 /iberror:/ {print $0}
140 /^PortSelect/ { if ($2 != '$portnum') {err = err "error: lid '$lid' port " $2 " does not match query ('$portnum')\n"; exit -1}}
142 $1 ~ "(Xmt|Rcv)(Pkts|Data)" { print $1 ":........................." $2 }
154 }' 2>&1 && test $rv -eq 0 ; then
155 if [ "$verbose" = "yes" ]; then
156 echo -n "Error on lid $lid ($nodename) port $portname: "
161 echo -n "Error on lid $lid ($nodename) port $portname: "