3 IBPATH=${IBPATH:-@IBSCRIPTPATH@}
6 echo Usage: `basename $0` "[-h] [-b] [-v] [-N | -nocolor]" \
7 "[<topology-file> \| -C ca_name -P ca_port -t(imeout) timeout_ms]"
11 function user_abort() {
16 trap user_abort SIGINT
44 -P | -C | -t | -timeout)
53 ca_info="$ca_info $1 $2"
60 if [ "$topofile" ]; then
69 if [ "$topofile" ]; then
70 netcmd="cat $topofile"
72 netcmd="$IBPATH/ibnetdiscover $ca_info"
81 function check_node(lid, port)
83 if (system("'$IBPATH'/ibchecknode '"$ca_info"' '$gflags' '$verbose' " lid)) {
85 print "\n# " ntype ": nodeguid 0x" nodeguid " failed"
88 return system("'$IBPATH'/ibcheckerrs '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
91 /^Ca/ || /^Switch/ || /^Rt/ {
93 ntype=$1; nodeguid=substr($3, 4, 16); ports=$2
95 print "\n# Checking " ntype ": nodeguid 0x" nodeguid
98 if (ntype != "Switch")
101 lid = substr($0, index($0, "port 0 lid ") + 11)
102 lid = substr(lid, 1, index(lid, " ") - 1)
103 err = check_node(lid, 255)
108 sub("\\(.*\\)", "", port)
109 gsub("[\\[\\]]", "", port)
110 if (ntype != "Switch") {
111 lid = substr($0, index($0, " lid ") + 5)
112 lid = substr(lid, 1, index(lid, " ") - 1)
113 check_node(lid, port)
115 system("'$IBPATH'/ibdatacounts '"$ca_info"' '$gflags' '$verbose' '$brief' " lid " " port);
118 /^ib/ {print $0; next}
119 /ibpanic:/ {print $0}
121 /iberror:/ {print $0}
124 printf "\n## Summary: %d nodes checked, %d bad nodes found\n", nnodes, ne
125 printf "## %d ports checked\n", nports