About

The handle_failed_lunpaths.sh is a small script to show and/or remove failed LUN paths on HP-UX using the scsimgr tool.

Code

Download the script from following GitHub repository: https://github.com/patvdv/hpux_scripts

Dependencies/Requirements

  • HP-UX 11 v3
  • Agile device paths
  • Korn shell

Usage

# handle_failed_lunpaths.sh --help

**** handle_failed_lunpaths.sh ****
**** (c) KUDOS BVBA - UNIX (Patrick Van der Veken) ****

Show or removes failed LUNpaths. Only works on HP-UX 11.31 with agile DSFs.

Syntax: handle_failed_lunpaths.sh [--help] | [--version] |
		[--no-log] ( [--remove] [--skip_cra] ) [--disk=<diskXY> ]


Parameters:

--disk          : operate only on the given disk/lun, otherwise operate on all disks/luns
--no-log        : do not log any messages to the script log file.
--remove        : do the actual removal of the failed paths (default: show only)
--skip-cra      : perform 'scsimgr disable' actions with CRA (Critical Resource Analysis)
--version       : show the script version/release/fix

Privileges

The script may and should only be executed by the root super-user.

Examples

Preview only

# ./handle_failed_lunpaths.sh

INFO: *** start of handle_failed_lunpaths.sh [] ***
INFO: logging takes places in /var/adm/handle_failed_lunpaths.sh.log
INFO: operating on ALL disks/luns
INFO: PREVIEW only: showing failed paths without removal
INFO: lunpath:106:47/0/2/2/0/0/0.0x50000973f00ba508.0x400f000000000000:fibre_channel:FAILED:ACTIVE
INFO: lunpath:397:47/0/1/2/0/0/0.0x50000973f00ba500.0x400f000000000000:fibre_channel:FAILED:ACTIVE
INFO: lunpath:107:47/0/2/2/0/0/0.0x50000973f00ba508.0x4010000000000000:fibre_channel:FAILED:ACTIVE
INFO: lunpath:398:47/0/1/2/0/0/0.0x50000973f00ba500.0x4010000000000000:fibre_channel:FAILED:ACTIVE
INFO: lunpath:108:47/0/2/2/0/0/0.0x50000973f00ba508.0x4011000000000000:fibre_channel:FAILED:ACTIVE
INFO: lunpath:399:47/0/1/2/0/0/0.0x50000973f00ba500.0x4011000000000000:fibre_channel:FAILED:ACTIVE
INFO: lunpath:109:47/0/2/2/0/0/0.0x50000973f00ba508.0x4012000000000000:fibre_channel:FAILED:ACTIVE
<snip>

With removal

# ./handle_failed_lunpaths.sh --remove --skip_cra

INFO: *** start of handle_failed_lunpaths.sh [--remove --skip_cra] ***
INFO: logging takes places in /var/adm/handle_failed_lunpaths.sh.log
INFO: operating on ALL disks/luns
INFO: lunpath:106:47/0/2/2/0/0/0.0x50000973f00ba508.0x400f000000000000:fibre_channel:FAILED:ACTIVE
INFO: disabled 47/0/2/2/0/0/0.0x50000973f00ba508.0x400f000000000000
INFO: removed 47/0/2/2/0/0/0.0x50000973f00ba508.0x400f000000000000
INFO: lunpath:397:47/0/1/2/0/0/0.0x50000973f00ba500.0x400f000000000000:fibre_channel:FAILED:ACTIVE
INFO: disabled 47/0/1/2/0/0/0.0x50000973f00ba500.0x400f000000000000
INFO: removed 47/0/1/2/0/0/0.0x50000973f00ba500.0x400f000000000000
INFO: lunpath:107:47/0/2/2/0/0/0.0x50000973f00ba508.0x4010000000000000:fibre_channel:FAILED:ACTIVE
INFO: disabled 47/0/2/2/0/0/0.0x50000973f00ba508.0x4010000000000000
INFO: removed 47/0/2/2/0/0/0.0x50000973f00ba508.0x4010000000000000
INFO: lunpath:398:47/0/1/2/0/0/0.0x50000973f00ba500.0x4010000000000000:fibre_channel:FAILED:ACTIVE
INFO: disabled 47/0/1/2/0/0/0.0x50000973f00ba500.0x4010000000000000
INFO: removed 47/0/1/2/0/0/0.0x50000973f00ba500.0x4010000000000000
INFO: lunpath:108:47/0/2/2/0/0/0.0x50000973f00ba508.0x4011000000000000:fibre_channel:FAILED:ACTIVE
INFO: disabled 47/0/2/2/0/0/0.0x50000973f00ba508.0x4011000000000000
INFO: removed 47/0/2/2/0/0/0.0x50000973f00ba508.0x4011000000000000
<snip>

Leave a comment