Bug 1299651 - Add machine-readable/parseable output option to multipath command
Summary: Add machine-readable/parseable output option to multipath command
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: device-mapper-multipath
Version: 7.1
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Lin Li
Milan Navratil
URL:
Whiteboard:
Keywords:
Depends On: 1145442 1303770 1310185 1376206
Blocks: 1313485 1295577
TreeView+ depends on / blocked
 
Reported: 2016-01-18 21:55 UTC by Ben Marzinski
Modified: 2016-11-04 08:16 UTC (History)
13 users (show)

(edit)
*multipathd* now supports raw format mode in *multipathd* formatted output commands

The *multipathd* formatted output commands now offer `raw` format mode, which removes the headers and additional padding between fields. Support for additional format wildcards has been added as well. Raw format mode makes it easier to collect and parse information about multipath devices, particularly for use in scripting.
Clone Of: 1145442
(edit)
Last Closed: 2016-11-04 08:16:49 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2536 normal SHIPPED_LIVE device-mapper-multipath bug fix and enhancement update 2016-11-03 14:18:10 UTC

Comment 1 Ben Marzinski 2016-02-26 22:54:26 UTC
Added

multipathd show paths raw format <fmt>

and

multipathd show maps raw format <fmt>

commands to remove headers and padding from the command output.

Comment 2 Lin Li 2016-04-22 14:49:09 UTC
Verified on device-mapper-multipath-0.4.9-89.el7
1).
[root@storageqe-84 ~]#  multipathd show paths format "%w %i %d %t %o %T"
uuid                              hcil    dev dm_st  dev_st  chk_st
360fff19abdd9552f8a36e5355226ba27 3:0:0:0 sdb active running ready 
360fff19abdd9552f8a36e5355226ba27 4:0:0:0 sdc active running ready 
3600508b1001c1eff28d1c3b503a59df1 0:0:0:0 sda undef  running ready 

[root@storageqe-84 ~]# multipathd show paths raw format "%w %i %d %t %o %T"
360fff19abdd9552f8a36e5355226ba27 3:0:0:0 sdb active running ready
360fff19abdd9552f8a36e5355226ba27 4:0:0:0 sdc active running ready
3600508b1001c1eff28d1c3b503a59df1 0:0:0:0 sda undef running ready


2).
[root@storageqe-84 ~]# multipathd show maps format "%n %w %d %s"
name   uuid                              sysfs vend/prod/rev            
mpatha 360fff19abdd9552f8a36e5355226ba27 dm-0  EQLOGIC ,100E-00         

[root@storageqe-84 ~]# multipathd show maps raw format "%n %w %d %s"
mpatha 360fff19abdd9552f8a36e5355226ba27 dm-0 EQLOGIC ,100E-00 

test result: From step 1  and step 2, # multipathd show paths raw format $FMT
and
# multipathd show maps raw format $FMT
work the same as the non-raw versions, but without headers and extra padding being added to the output.

3).
[root@storageqe-84 ~]# multipathd show paths format "%z %m %N %n %R %r %a"
serial                           multipath host WWNN target WWNN                                                     host WWPN target WWPN host adapter
60FFF19ABDD9552F8A36E5355226BA27 mpatha    [undef]   iqn.2001-05.com.equallogic:0-af1ff6-2f55d9bd9-27ba265235e5368a- [undef]   [undef]     10.34.80.26 
60FFF19ABDD9552F8A36E5355226BA27 mpatha    [undef]   iqn.2001-05.com.equallogic:0-af1ff6-2f55d9bd9-27ba265235e5368a- [undef]   [undef]     10.34.80.27 
0014380305DFE90                  [orphan]  [undef]   [undef]                                                         [undef]   [undef]     [undef]     

[root@storageqe-84 ~]# multipathd show paths raw format "%z %m %N %n %R %r %a"
60FFF19ABDD9552F8A36E5355226BA27 mpatha [undef] iqn.2001-05.com.equallogic:0-af1ff6-2f55d9bd9-27ba265235e5368a- [undef] [undef] 10.34.80.26
60FFF19ABDD9552F8A36E5355226BA27 mpatha [undef] iqn.2001-05.com.equallogic:0-af1ff6-2f55d9bd9-27ba265235e5368a- [undef] [undef] 10.34.80.27
0014380305DFE90  [orphan] [undef] [undef] [undef] [undef] [undef]

4).
[root@storageqe-84 ~]# multipathd show paths raw format %z
60FFF19ABDD9552F8A36E5355226BA27
60FFF19ABDD9552F8A36E5355226BA27
0014380305DFE90 
[root@storageqe-84 ~]# multipathd show paths raw format %m
mpatha
mpatha
[orphan]
[root@storageqe-84 ~]# multipathd show paths raw format %N
[undef]
[undef]
[undef]
[root@storageqe-84 ~]# multipathd show paths raw format %n
iqn.2001-05.com.equallogic:0-af1ff6-2f55d9bd9-27ba265235e5368a-
iqn.2001-05.com.equallogic:0-af1ff6-2f55d9bd9-27ba265235e5368a-
[undef]
[root@storageqe-84 ~]#  multipathd show paths raw format %R
[undef]
[undef]
[undef]
[root@storageqe-84 ~]# multipathd show paths raw format %r
[undef]
[undef]
[undef]
[root@storageqe-84 ~]# multipathd show paths raw format %a
10.34.80.26
10.34.80.27
[undef]

test result: From step 3 and step 4, the %z, %m, %N, %n, %R, %r, and %a path format wildcards work as expected.

Comment 5 errata-xmlrpc 2016-11-04 08:16:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2536.html


Note You need to log in before you can comment on or make changes to this bug.