Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
None
-
3
-
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.