With the Solaris 11.3 beta release Oracle added a beautiful zpool command. Zpool monitor! And who would have figured, it does exactly that. It helps you to keep track of send, receive, scrub and/or resilver actions.
Let’s say you run zpool scrub rpool and you are interested in the status/progress. So far zpool status was the command of choice to do so. Usually used somehow like while :; do zpool status …|grep …; done. Works but not really convenient. And just imagine have a few send and/or receives running.
Well it is all taking care of. zfs monitor will the job for you. A long needed zfs feature. Thanks a lot Solaris engineering. Very nice improvement.
So how does zpool monitor work. Let’s take a look:
root@wacken:~# zpool help monitor usage: monitor -t provider [-T d|u] [[-p] -o field[,...] [pool] ... [interval [count]] Valid values for 'provider' are send, receive, scrub, and resilver Valid values for 'field' are done, other, pctdone, pool, provider, speed, starttime, tag, timeleft, timestmp, total
This is what the default looks like for monitoring scrub:
root@wacken:~# zpool monitor -t scrub 1 pool provider pctdone total speed timeleft rpool scrub 0.0 64.8G 1.66M 11h08m rpool scrub 0.0 64.8G 1.69M 10h55m rpool scrub 0.0 64.8G 1.71M 10h45m rpool scrub 0.0 64.8G 1.74M 10h36m rpool scrub 0.0 64.8G 1.79M 10h19m rpool scrub 0.0 64.8G 1.80M 10h15m ... rpool scrub 0.8 64.8G 27.3M 40m09s rpool scrub 0.8 64.8G 26.5M 41m23s rpool scrub 1.0 64.8G 31.9M 34m23s rpool scrub 1.1 64.8G 33.6M 32m34s rpool scrub 1.1 64.8G 32.2M 33m58s rpool scrub 1.1 64.8G 30.9M 35m22s rpool scrub 1.1 64.8G 29.8M 36m44s
Let’s add a few more fields to it.
root@wacken:~# zpool monitor -t scrub -o pool,provider,pctdone,total,speed,timeleft,tag,starttime,done 1 pool provider pctdone total speed timeleft tag starttime done rpool scrub 3.5 64.8G 18.8M 56m51s scrub-267 14:22:58 0 rpool scrub 3.5 64.8G 18.7M 57m05s scrub-267 14:22:58 0 rpool scrub 3.5 64.8G 18.6M 57m29s scrub-267 14:22:58 0 rpool scrub 3.5 64.8G 18.5M 57m52s scrub-267 14:22:58 0
Ain’t this nice. If you have an environment that includes automated zfs snapshots together with send/receive this will really make your day.
This command will definately get an alias in my zshrc ;-)