Created attachment 224956 [details]
patch to allow zfs-stats to make use of ssh-agent
zfs-stats is a Perl script, and is invoked using /usr/bin/env; it also clears the environment in the process, which is generally a Good Thing.
However, it also clears the SSH_AUTH_SOCK environment variable in the process, which causes each invocation that is intended to use ssh to also request authentication... which rather defeats a lot of the purpose of using (e.g.) public key authentication.
The attached patch causes the script to clear all but the SSH_AUTH_SOCK environment variable; the resulting script thus Just works when told to use ssh.
If there's another (better) way to do this, I'm fine with that. Having set things up so I only need to enter my authentication information when I login to my laptop, and can then ssh to other machines freely, it seemed a bit ... undesirable ... to suddenly get requests to re-enter the information for each query.
While I was here, I also inserted a "-x" flag in the ssh invocation: zfs-stats certainly has no need to forward X11 for its statistics-gathering.
After the update of sysutils/zfs-stats from zfs-stats-1.3.0_2 to zfs-stats-1.3.1, I no longer see the reported issue.