Nice and easy way to check if all paths are consistent and available

POSTED ON 21/06/2012 BY CHRISTOPHE

mpio : nice and easy way to check if all paths are consistent and available

Sometimes on a server which had some fiber channel difficulties,  I always check if there are some missing or failed paths by issuing this command (sometimes the numbers are not equal, and we have to reconfigure missing paths) :

root@lpar:/root# lspath | awk '{print $1,$NF}' |sort |uniq -c
18 Enabled fscsi0
6 Enabled fscsi1
12 Failed fscsi1
If there are some failed paths, maybe you should try to re-enable them (quick and painless, can’t do no harm)  with this one-liner :

root@lpar:/root# lspath|grep Failed | awk '{print "chpath -l "$2" -s enable -p "$3}'|ksh
paths Changed
paths Changed
paths Changed
paths Changed
paths Changed
paths Changed
paths Changed
paths Changed
paths Changed
paths Changed
paths Changed
paths Changed
root@lpar:/root# lspath | awk '{print $1" " $NF}' |sort |uniq -c
 18 Enabled fscsi0
 18 Enabled fscsi1
And voilà, the failed paths are back online :)

You can also delete some paths before re-discovering them if you have some « missing » or « defined » paths :

lspath -F "name:connection:parent:path_status:status" | egrep "Defined|Missing" | awk -F : '{print "rmpath -l "$1" -p "$3" -w "$2" -d"}' | ksh

Source: http://nixys.fr/blog/?p=176

Comentarios