RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1299651 - Add machine-readable/parseable output option to multipath command
Summary: Add machine-readable/parseable output option to multipath command
Keywords:
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:
Depends On: 1145442 1303770 1310185 1376206
Blocks: 1295577 1313485
TreeView+ depends on / blocked
 
Reported: 2016-01-18 21:55 UTC by Ben Marzinski
Modified: 2021-09-03 11:58 UTC (History)
13 users (show)

Fixed In Version: device-mapper-multipath-0.4.9-87.el7
Doc Type: Release Note
Doc Text:
*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
Environment:
Last Closed: 2016-11-04 08:16:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2536 0 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.