[LU-17205] Prefix each lctl get_param output line with -H Created: 17/Oct/23  Updated: 17/Nov/23  Resolved: 10/Nov/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Improvement Priority: Minor
Reporter: Aurelien Degremont Assignee: Aurelien Degremont
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Add a new '-H' option to 'lctl get_param' that will prefix each output line with the parameter name instead of only the first line by default.
    
That makes grepping lctl get_param with wildcards much easier as you can now easily now which parameter returns which value:

$ lctl get_param -H osc.*.state | grep current
osc.lustre-OST0000-osc-ff1148c0.state=current_state: FULL
osc.lustre-OST0001-osc-ff1248c0.state=current_state: DISCONN
osc.lustre-OST0002-osc-ff1348c0.state=current_state: FULL
osc.lustre-OST0003-osc-ff1448c0.state=current_state: FULL
osc.lustre-OST0004-osc-ff1548c0.state=current_state: FULL

It could be combined with clubak from ClusterShell by example, to compare connection tunings, ie:

# lctl get_param -H osc.*.srpc_info | grep -v id: | clubak -bS=
---------------
osc.lustre-OST[0002-0009]-osc-ff1348a7.srpc_info (8)
---------------
rpc flavor:     krb5n
bulk flavor:    krb5n
flags:          rootonly,bulk,
refcount:       3
nctx:   1
gc internal     3600
gc next 3459
---------------
osc.lustre-OST[0000-0001]-osc-ff1348a7.srpc_info (2)
---------------
rpc flavor:     null
bulk flavor:    null
flags:          -,
refcount:       416
nctx:   1
gc internal     0
gc next 0

 

  • It could also be useful even with 1 line of output as it does not force a line feed if the value is larger than 80 chars.
  • It also prints an output line even for empty values. That also makes life easier for admins.

Open to use another option name if you prefer.

 



 Comments   
Comment by Gerrit Updater [ 17/Oct/23 ]

"Aurelien Degremont <adegremont@nvidia.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/52730
Subject: LU-17205 utils: add lctl get_param -H option
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 8cb8c8efeddc072b85d4ea8052381275f4104b03

Comment by Gerrit Updater [ 08/Nov/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52730/
Subject: LU-17205 utils: add lctl get_param -H option
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: a12c352a3dd8d424b1da09efc6884530c60d105b

Comment by Peter Jones [ 10/Nov/23 ]

Landed for 2.16

Generated at Sat Feb 10 03:33:30 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.