zfs/cmd/zpool
Tony Hutter d6418de057 Prebaked scripts for zpool status/iostat -c
This patch updates the "zpool status/iostat -c" commands to only run
"pre-baked" scripts from the /etc/zfs/zpool.d directory (or wherever
you install to).  The scripts can only be run from -c as an unprivileged
user (unless the ZPOOL_SCRIPTS_AS_ROOT environment var is
set by root).  This was done to encourage scripts to be written is such
a way that normal users can use them, and to be cautious.  If your
script needs to run a privileged command, consider adding the
appropriate line in /etc/sudoers.  See zpool(8) for an example of how
to do this.

The patch also allows the scripts to output custom column names.  If
the script outputs a line like:

name=value

then "name" is used for the column name, and "value" is its value.
Multiple columns can be specified by outputting multiple lines.  Column
names and values can have spaces.  If the value is empty, a dash (-) is
printed instead.

After all the "name=value" lines are read (if any), zpool will take the
next the next line of output (if any) and print it without a column
header.  After that, no more lines will be processed. This can be
useful for printing errors.

Lastly, this patch also disables the -c option with the latency and
request size histograms, since it produced awkward output and made the
code harder to maintain.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #5852
2017-04-21 09:27:04 -07:00
..
zpool.d Prebaked scripts for zpool status/iostat -c 2017-04-21 09:27:04 -07:00
.gitignore Add .gitignore files to exclude build products 2010-01-08 11:35:17 -08:00
Makefile.am Prebaked scripts for zpool status/iostat -c 2017-04-21 09:27:04 -07:00
zpool_iter.c Prebaked scripts for zpool status/iostat -c 2017-04-21 09:27:04 -07:00
zpool_main.c Prebaked scripts for zpool status/iostat -c 2017-04-21 09:27:04 -07:00
zpool_util.c codebase style improvements for OpenZFS 6459 port 2017-01-22 13:25:40 -08:00
zpool_util.h Prebaked scripts for zpool status/iostat -c 2017-04-21 09:27:04 -07:00
zpool_vdev.c OpenZFS 6865 - want zfs-tests cases for zpool labelclear command 2017-04-11 09:54:39 -07:00