Version 5

    HBA Port Status (Linux)


    This checks for port state changes for HBA's on Linux. There is a specific command, array_info, that I parse and output the results.


    This is an example of what i get when i run the array_info command.

    /sys/class/scsi_host/host1: wwnn=0x2000d00d00d00 wwpn=0x2000d00d00d00 state=Online

    /sys/class/scsi_host/host2: wwnn=0x211d11d11d11d wwpn=0x211d11d11d11d state=Online

    /sys/class/scsi_host/host3: wwnn=0x222d22d222fa2 wwpn=0x222d22d222fa2 state=Linkdown

    /sys/class/scsi_host/host4: wwnn=0x233d33d333fa3 wwpn=0x233d33d333fa3 state=Linkdown


    I save the output in a temp file located /tmp/previous_array_info.txt. Each time it runs it compares the values from the previous poll to determine change.


    If everything is OK i output this:

    2017-03-09 16_07_36-Edit Application Template - HBA Port Status (Linux).png


    If a single port has an issue i output this:

    2017-03-09 16_06_41-Edit Application Template - HBA Port Status (Linux).png


    If multiple ports are affected I output this:

    2017-03-09 16_05_40-Edit Application Template - HBA Port Status (Linux).png