3 IBPATH=${IBPATH:-@IBSCRIPTPATH@}
6 echo Usage: `basename $0` "[-h] [-v] [-N | -nocolor] [-G]" \
7 "[-C ca_name] [-P ca_port] [-t(imeout) timeout_ms] <lid|guid> <port>"
12 if [ "$bw" = "yes" ]; then
13 if [ "$verbose" = "yes" ]; then
18 if [ "$verbose" = "yes" ]; then
19 echo -e "\\033[1;032m" $1 "\\033[0;39m"
24 if [ "$bw" = "yes" ]; then
28 echo -e "\\033[1;031m" $1 "\\033[0;39m"
47 -P | -C | -t | -timeout)
56 ca_info="$ca_info $1 $2"
75 if [ "$guid_addr" ]; then
76 if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
77 echo -n "guid $1 address resolution: "
84 if ! temp=`$IBPATH/ibaddr $ca_info -L $1 | awk '/failed/{exit -1} {print $1}'`; then
85 echo -n "lid $1 address resolution: "
92 text="`eval $IBPATH/smpquery $ca_info portinfo $lid $portnum`"
94 if echo "$text" | awk -v mono=$bw -F '[.:]*' '
100 printf "\033[1;034m" s
105 # Only check LinkWidthActive if LinkWidthSupported is not 1X
106 /^LinkWidthSupported/{ if ($2 != "1X") { next } }
107 /^LinkWidthActive/{ if ($2 == "1X") warn = warn "#warn: Link configured as 1X lid '$lid' port '$portnum'\n"}
109 /^ib/ {print $0; next}
110 /ibpanic:/ {print $0}
112 /iberror:/ {print $0}
124 }' 2>&1 && test $rv -eq 0 ; then
125 if [ "$verbose" = "yes" ]; then
126 echo -n "Port check lid $lid port $portnum: "
131 echo -n "Port check lid $lid port $portnum: "