3 IBPATH=${IBPATH:-@IBSCRIPTPATH@}
6 echo Usage: `basename $0` "[-h] [-N | -nocolor] [<topology-file>" \
7 "| -C ca_name -P ca_port -t(imeout) timeout_ms]"
11 function user_abort() {
16 trap user_abort SIGINT
33 -P | -C | -t | -timeout)
42 ca_info="$ca_info $1 $2"
49 if [ "$topofile" ]; then
58 if [ "$topofile" ]; then
59 netcmd="cat $topofile"
61 netcmd="$IBPATH/ibnetdiscover $ca_info"
68 function clear_all_errors(lid, port)
70 if (system("'$IBPATH'/perfquery'"$ca_info"' '$gflags' -R -a " lid " " port " 0x0fff"))
74 function clear_errors(lid, port)
76 if (system("'$IBPATH'/perfquery'"$ca_info"' '$gflags' -R " lid " " port " 0x0fff"))
80 /^Ca/ || /^Switch/ || /^Rt/ {
82 ntype=$1; nodeguid=substr($3, 4, 16); ports=$2
83 if (ntype != "Switch")
86 lid = substr($0, index($0, "port 0 lid ") + 11)
87 lid = substr(lid, 1, index(lid, " ") - 1)
88 clear_all_errors(lid, 255)
93 sub("\\(.*\\)", "", port)
94 gsub("[\\[\\]]", "", port)
95 if (ntype != "Switch") {
96 lid = substr($0, index($0, " lid ") + 5)
97 lid = substr(lid, 1, index(lid, " ") - 1)
98 clear_errors(lid, port)
102 /^ib/ {print $0; next}
103 /ibpanic:/ {print $0}
105 /iberror:/ {print $0}
108 printf "\n## Summary: %d nodes cleared %d errors\n", nnodes, nodeerr