A small collection of shell utilities to parse and report InfiniBand (IB) / Mellanox diagnostics generated by ibdiagnet and to query local system IB information.
This repository contains scripts used to extract host and firmware information, look up GUIDs in ibdiagnet outputs, find duplicate node entries, and detect firmware/driver mismatches.
- Ensure you have the required dependencies installed (see Requirements below).
- Clone or download this repository to a management host or the host you are auditing.
- Make the scripts executable and (optionally) move them into your PATH.
- Put
IB_INFO.shon a common storage location or run it on each host to collect local system and Mellanox card information. ex:clush -a /shared/path/to/IB_INFO.sh >> ib_info_output.csv - Collect
ibdiagnetoutput files (usually under/var/tmp/ibdiagnet2/) from a host with access to the IB fabric if needed. - Run:
ib_fw_warn.sh - Run:
find_dups.sh - Run:
find_ib_fw_mofed_mismatch.shon a host with access toibdiagnetoutput files (usually under/var/tmp/ibdiagnet2/).
IB_INFO.sh— Collects local system information about InfiniBand interfaces and Mellanox cards and emits one CSV line per unique card: Hostname, Serial, Model, OS, Kernel, Card Model, Driver Type, Driver Version, Firmware Version.ib_fw_warn.sh— Parses anibdiagnet2.db_csvfile and extracts the WARNINGS_FW_CHECK section, replacing GUIDs with node names (from the NODES section). Writesfw_check_output.csvby default.find_dups.sh— Scans anibdiagnet2.db_csvfile for duplicate node entries and producesoutput.csv,duplicates.csv, andduplicate_counts.csv.find_ib_fw_mofed_mismatch.sh— Finds hosts reported with firmware mismatches relative to what the switch MOFED expects, using ibdiagnet output.
These scripts are POSIX-ish shell scripts written for bash and expect a sysadmin environment with the following utilities available (most are standard on RHEL/CentOS variants used with Mellanox):
- bash
- hostname, ip, awk, sed, grep, sort, cut, xargs
- dmidecode (to get chassis/serial/model)
- lspci (to find Mellanox cards)
- ethtool (to query firmware/driver for interfaces)
- lsb_release or /etc/os-release (for OS detection)
- rpm and ofed_info (to detect installed IB driver stacks)
- ibdiagnet (for scripts that parse its output; some scripts call ibdiagnet)
Most commands must be run as root or with sufficient privileges (for example dmidecode).
If a required tool is missing, the script will usually print an error and exit.
-
Clone or copy the repository to a management host or the host you are auditing:
git clone
-
Make the scripts executable and (optionally) move them into your PATH:
chmod +x IB_INFO.sh ib_fw_warn.sh find_dups.sh find_ib_fw_mofed_mismatch.sh sudo mv IB_INFO.sh ib_fw_warn.sh find_dups.sh find_ib_fw_mofed_mismatch.sh /usr/local/sbin/
-
Ensure
ibdiagnetoutput files are available under/var/tmp/ibdiagnet2/when running the scripts that parse ibdiagnet CSV output, or use the script flags (where available) to point to the correct files.
Below are short examples of how to run each script. Use -h or --help for more details.
Purpose: gather local system and Mellanox card details and emit CSV lines for inventory.
Example:
sudo ./IB_INFO.shOutput: CSV lines like
Hostname,Serial Number,Model,OS,Kernel,Mellanox Card Model,Driver Type,Driver Version,Firmware Version
Notes:
- Requires an active InfiniBand interface (script looks for
ib*links that are UP). - Requires
dmidecode,lspci,ethtoolandofed_info/rpmto be present to collect all fields.
Purpose: parse ibdiagnet2.db_csv, extract the WARNINGS_FW_CHECK section and replace GUIDs
with node names from the NODES section; writes fw_check_output.csv by default.
Example (default paths):
./ib_fw_warn.shExample (with custom files):
./ib_fw_warn.sh -f /path/to/ibdiagnet2.db_csv -l /path/to/ibdiagnet2.db_csv -o /tmp/fw_check_output.csvOutput: CSV column_2,column_6 where column_2 is the node name and column_6 is the summary.
Purpose: find duplicate node entries inside an ibdiagnet2.db_csv file and build three CSV files
with unique hostnames, duplicates, and duplicate counts.
Example:
./find_dups.sh -f /var/tmp/ibdiagnet2/ibdiagnet2.db_csvOutputs:
output.csv— unique hostnames and vendor card IDsduplicates.csv— duplicate hostnames and their unique IDsduplicate_counts.csv— hostname, duplicate count, and unique IDs
Purpose: identify hosts with firmware versions that don't match the switch MOFED expectations
using ibdiagnet output.
Example:
./find_ib_fw_mofed_mismatch.shBy default the script prints hostnames with mismatched firmware. Use -o <file> to write
results to a file.
sed '/^START_NODES$/,/^END_NODES$/!d;//d' ibdiagnet2.db_csv | awk -F, '{print $1}' | sed 's/\"//g' | sort -u
- Permission errors: run scripts with
sudoor as root when they calldmidecode,ethtool,lspcior when reading/var/tmp/ibdiagnet2output files. - Missing commands: install the missing packages (for example
ethtool,pciutils,dmidecode). - No Mellanox devices found: verify the host actually has Mellanox adapters and that the IB
link is up (
ip link) — some scripts bail out if noibinterface is present.
Small improvements and fixes are welcome. Suggested workflow:
- Open an issue describing the problem or enhancement.
- Send a PR with a focused change and a short description of why it helps.
If you add new scripts, include a short usage example and update this README.
No license is provided in this repository. If you intend to share or publish these scripts, please add a LICENSE file (for example MIT or Apache 2.0) to make redistribution terms explicit.
If you need help adapting the scripts to your environment, open an issue or contact the repository owner.