3 IBPATH=${IBPATH:-@IBSCRIPTPATH@}
6 echo Usage: `basename $0` "[-h] [-b] [-v] [-G] [-T <threshold_file>]" \
7 "[-s(how_thresholds)] [-N \| -nocolor] [-C ca_name] [-P ca_port]" \
8 "[-t(imeout) timeout_ms] <lid|guid> [<port>]"
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"
32 function show_thresholds() {
33 echo "SymbolErrors=$SymbolErrors"
34 echo "LinkRecovers=$LinkRecovers"
35 echo "LinkDowned=$LinkDowned"
36 echo "RcvErrors=$RcvErrors"
37 echo "RcvRemotePhysErrors=$RcvRemotePhysErrors"
38 echo "RcvSwRelayErrors=$RcvSwRelayErrors"
39 echo "XmtDiscards=$XmtDiscards"
40 echo "XmtConstraintErrors=$XmtConstraintErrors"
41 echo "RcvConstraintErrors=$RcvConstraintErrors"
42 echo "LinkIntegrityErrors=$LinkIntegrityErrors"
43 echo "ExcBufOverrunErrors=$ExcBufOverrunErrors"
44 echo "VL15Dropped=$VL15Dropped"
47 function get_thresholds() {
56 RcvRemotePhysErrors=100
59 XmtConstraintErrors=100
60 RcvConstraintErrors=100
61 LinkIntegrityErrors=10
62 ExcBufOverrunErrors=10
89 echo "Can't use threshold file '$2'"
99 -P | -C | -t | -timeout)
105 if [ x$2 = x ] ; then
108 ca_info="$ca_info $1 $2"
121 #default is all ports
124 if [ $# -lt 1 ]; then
132 if [ "$portnum" = "255" ]; then
138 if [ "$guid_addr" ]; then
139 if ! lid=`$IBPATH/ibaddr $ca_info -G -L $1 | awk '/failed/{exit -1} {print $3}'`; then
140 echo -n "guid $1 address resolution: "
147 if ! temp=`$IBPATH/ibaddr $ca_info -L $1 | awk '/failed/{exit -1} {print $1}'`; then
148 echo -n "lid $1 address resolution: "
154 nodename=`$IBPATH/smpquery $ca_info nodedesc $lid | sed -e "s/^Node Description:\.*\(.*\)/\1/"`
156 text="`eval $IBPATH/perfquery $ca_info $lid $portnum`"
158 if echo "$text" | awk -v mono=$bw -v brief=$brief -F '[.:]*' '
161 if (brief == "yes") {
167 printf "\033[1;034m" s
173 th["SymbolErrors"] = '$SymbolErrors'
174 th["LinkRecovers"] = '$LinkRecovers'
175 th["LinkDowned"] = '$LinkDowned'
176 th["RcvErrors"] = '$RcvErrors'
177 th["RcvRemotePhysErrors"] = '$RcvRemotePhysErrors'
178 th["RcvSwRelayErrors"] = '$RcvSwRelayErrors'
179 th["XmtDiscards"] = '$XmtDiscards'
180 th["XmtConstraintErrors"] = '$XmtConstraintErrors'
181 th["RcvConstraintErrors"] = '$RcvConstraintErrors'
182 th["LinkIntegrityErrors"] = '$LinkIntegrityErrors'
183 th["ExcBufOverrunErrors"] = '$ExcBufOverrunErrors'
184 th["VL15Dropped"] = '$VL15Dropped'
187 /^CounterSelect/ {next}
189 /AllPortSelect/ {next}
191 /^ib/ {print $0; next}
192 /ibpanic:/ {print $0}
194 /iberror:/ {print $0}
196 /^PortSelect/ { if ($2 != '$portnum') {err = err "error: lid '$lid' port " $2 " does not match query ('$portnum')\n"; exit -1}}
198 $1 ~ "(Xmt|Rcv)(Pkts|Data)" { next }
200 { if (th[$1] > 0 && $2 >= th[$1])
201 warn = warn "#warn: counter " $1 " = " $2 " \t(threshold " th[$1] ") lid '$lid' port '$portnum'\n"
213 }' 2>&1 && test $rv -eq 0 ; then
214 if [ "$verbose" = "yes" ]; then
215 echo -n "Error check on lid $lid ($nodename) port $portname: "
220 echo -n "Error check on lid $lid ($nodename) port $portname: "