diff --git a/README.md b/README.md index fc678bb..ff2151d 100644 --- a/README.md +++ b/README.md @@ -41,17 +41,24 @@ temperatures, and monitor the switches more closely. ### Preparation -`ibswinfo` operates on virtual devices created by MST, the Mellanox Software -Tools service. Once MFT has been installed, you can start the `mst` service -and populate entries in `/dev/mst` with: +`ibswinfo` can address switches by using the virtual devices created by MST, +the Mellanox Software Tools service, or by LID. -``` -# mst start -# mst ib add -``` +* to use the MST virtual devices, you can start the `mst` service and populate + entries in `/dev/mst` with: + + ``` + # mst start + # mst ib add + ``` + + Check that `/dev/mst` contains entries for your unmanaged switches (they + should look like `/dev/mst/SW_*`), and you can run `ibswinfo` like this: + `./ibswinfo.sh -d /dev/mst/SW` -Check that `/dev/mst` contains entries for your unmanaged switches (they should -look like `/dev/mst/SW_*`). +* to address switches by LID, starting the `mst` service is not required. You + can get currently assigned LIDs with `ibswitches`, and run `ibswinfo` + directly like this: `./ibswinfo.sh -d lid-16` ## Supported hardware @@ -82,11 +89,10 @@ we'll complete the list._ ## Usage ``` -# ./ibswinfo/ibswinfo.sh -h Usage: ibswinfo.sh -d [-T] [-o ] - -d MST device name. - Run "mst status" to get the devices list + -d MST device path ("mst status" shows devices list) + or LID (eg. "-d lid-44") -o Only display inventory|vitals|status information -T get QSFP modules temperature diff --git a/ibswinfo.sh b/ibswinfo.sh index 8e74e21..77a7c6a 100755 --- a/ibswinfo.sh +++ b/ibswinfo.sh @@ -112,8 +112,8 @@ usage() { cat << EOU Usage: ${0##*/} -d [-T] [-o <$outputs>] - -d MST device name. - Run "mst status" to get the devices list + -d MST device path ("mst status" shows devices list) + or LID (eg. "-d lid-44") -o Only display $outputs information -T get QSFP modules temperature @@ -180,10 +180,11 @@ req="4.14.0" # device [[ $dev == "" ]] && err "missing device argument" -[[ ${dev:0:8} == '/dev/mst' ]] && dev=${dev/\/dev\/mst\//} -[[ ${dev:0:3} == "SW_" ]] || err "$dev doesn't look like a switch device name" -[[ -r /dev/mst/$dev ]] || err "$dev not found in /dev/mst, is mst started?" - +[[ ${dev:0:4} != "lid-" ]] && { + [[ ${dev:0:8} == '/dev/mst' ]] && dev=${dev/\/dev\/mst\//} + [[ ${dev:0:3} == "SW_" ]] || err "$dev doesn't look like a switch device name" + [[ -r /dev/mst/$dev ]] || err "$dev not found in /dev/mst, is mst started?" +} ## -- data --------------------------------------------------------------------