Home > Hardware, Storage > resolved linux check qlogic/emulex hba firmware version and model name type howto

resolved linux check qlogic/emulex hba firmware version and model name type howto

March 28th, 2012

Here's a script to check linux hba model name, firmware version:

#!/bin/ksh
for SCSI in `ls -d /sys/class/scsi_host/host*`;
do
[ -e ${SCSI}/modelname ] && echo -n 'Model Name ' && cat ${SCSI}/modelname;
[ -e ${SCSI}/model_name ] && echo -n 'Model Name ' && cat ${SCSI}/model_name;
[ -e ${SCSI}/fwrev ] && echo -n 'Firmware Version ' && cat ${SCSI}/fwrev;
[ -e ${SCSI}/fw_version ] && echo -n 'Firmware Version ' && cat ${SCSI}/fw_version;
done

Also here's a script for you if you're checking bunches of servers:

#!/bin/ksh
USERNAME="root"
PASSWORD="yourpassword"
for i in `cat /home/doxer/servers_list_linux`
do
echo "">/root/.ssh/known_hosts
expect <<EOF
spawn ssh -l${USERNAME} -p22 $i "echo -n '====';hostname;cat /sys/class/scsi_host/host*/{modelname,model_name,fwrev,fw_version}"
set timeout 20
expect "*yes*"
send "yes\r"
expect "assword:"
send "${PASSWORD}\r"
expect eof
EOF
done

For solaris(solaris10), please refer to the following:

#!/bin/ksh
USERNAME="root"
PASSWORD="yourpassword"
for i in `cat servers_list_solaris`
do
echo "">/root/.ssh/known_hosts
expect <<EOF
spawn ssh -l${USERNAME} -p22 $i "hostname;echo 'result from prtdiag -v';/usr/sbin/prtdiag -v|grep PCI;echo 'result from cfgadm -la|grep fabric';/usr/sbin/cfgadm -la|grep fabric;echo 'result from fcinfo hba-port';/usr/sbin/fcinfo hba-port -l|egrep 'OS Device Name|HBA Port WWN|Manufacturer|Firmware';echo 'result from prtpicl -v -c scsi-fcp';/usr/sbin/prtpicl -v -c scsi-fcp|egrep 'version|name'"
set timeout 20
expect "*yes*"
send "yes\r"
expect "assword:"
send "${PASSWORD}\r"
expect eof
EOF
done

For solaris 9:

#!/bin/ksh
USERNAME="root"
PASSWORD="yourpassword"
for i in `cat servers_list_solaris`
do
echo "">/root/.ssh/known_hosts
expect <<EOF
spawn ssh -l${USERNAME} -p22 $i "hostname;echo 'result from prtdiag -v';/usr/sbin/prtdiag -v|grep PCI;echo 'result from cfgadm -la|grep fabric';/usr/sbin/cfgadm -la|grep fabric;echo 'result from prtpicl -v -c scsi-fcp';/usr/sbin/prtpicl -v -c scsi-fcp|egrep 'version|name'"
set timeout 20
expect "*yes*"
send "yes\r"
expect "assword:"
send "${PASSWORD}\r"
expect eof
EOF
done

And if you found the model is like 375-3102-xx or so, then you can just search it in google, you'll find this one is qlogic X6767A. If the result is like "driver-name   qlc", "version       ISP2312 Host Adapter fcode version 1.16 11/15/06", then you'll know it's HP ISP2312 and firmware version is 1.16.

Problem resolved?


  1. Arunabh
    April 11th, 2013 at 20:17 | #1

    Thanks a lot for the script. I’ve emulex HBA card installed in my server. Please refer the below details.

    # lspci|grep -i fibre
    0a:00.0 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
    0a:00.1 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
    0c:00.0 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)
    0c:00.1 Fibre Channel: Emulex Corporation Zephyr-X LightPulse Fibre Channel Host Adapter (rev 02)

    I’ve just pasted the script and ran it, it gives below errors on the screen. Please suggest on this.

    # sh hbainfo.sh
    hbainfo.sh: line 4: Model: command not found
    LPe11002-E
    hbainfo.sh: line 6: Firmware: command not found
    2.80A4 (Z2F2.80A4)
    hbainfo.sh: line 4: Model: command not found
    LPe11002-E
    hbainfo.sh: line 6: Firmware: command not found
    2.80A4 (Z2F2.80A4)
    hbainfo.sh: line 4: Model: command not found
    LPe11002-E
    hbainfo.sh: line 6: Firmware: command not found
    2.80A4 (Z2F2.80A4)
    hbainfo.sh: line 4: Model: command not found
    LPe11002-E
    hbainfo.sh: line 6: Firmware: command not found
    2.80A4 (Z2F2.80A4)

  1. No trackbacks yet.