{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/6121","repository_url":"https://api.github.com/repos/zfsonlinux/zfs","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/6121/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/6121/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/6121/events","html_url":"https://github.com/zfsonlinux/zfs/pull/6121","id":228100993,"number":6121,"title":"zpool iostat/status -c improvements","user":{"login":"dinatale2","id":13680976,"avatar_url":"https://avatars1.githubusercontent.com/u/13680976?v=3","gravatar_id":"","url":"https://api.github.com/users/dinatale2","html_url":"https://github.com/dinatale2","followers_url":"https://api.github.com/users/dinatale2/followers","following_url":"https://api.github.com/users/dinatale2/following{/other_user}","gists_url":"https://api.github.com/users/dinatale2/gists{/gist_id}","starred_url":"https://api.github.com/users/dinatale2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinatale2/subscriptions","organizations_url":"https://api.github.com/users/dinatale2/orgs","repos_url":"https://api.github.com/users/dinatale2/repos","events_url":"https://api.github.com/users/dinatale2/events{/privacy}","received_events_url":"https://api.github.com/users/dinatale2/received_events","type":"User","site_admin":false},"labels":[{"id":453022836,"url":"https://api.github.com/repos/zfsonlinux/zfs/labels/Work%20in%20Progress","name":"Work in Progress","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-05-11T19:47:30Z","updated_at":"2017-05-22T23:47:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zfsonlinux/zfs/pulls/6121","html_url":"https://github.com/zfsonlinux/zfs/pull/6121","diff_url":"https://github.com/zfsonlinux/zfs/pull/6121.diff","patch_url":"https://github.com/zfsonlinux/zfs/pull/6121.patch"},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n### Description\r\n<!--- Describe your changes in detail -->\r\nUsers can now provide their own scripts to be\r\nrun with zpool iostat/status -c. User scripts\r\nshould be placed in ~/.zfs/zpool to be included\r\nin zpool's search path.\r\n\r\nProvide a script which can be used with\r\nzpool iostat|status -c that will return\r\nthe type of device (hdd, sdd, file).\r\n\r\nProvide a script to get various values\r\nfrom smartctl when using zpool iostat/status -c.\r\n\r\n### How Has This Been Tested?\r\nLocally on a RHEL 6 based VM.\r\n\r\n### Other Comments\r\n@inkdot7 Would you mind taking a look at the `media` script? It should get you most of what you want in regards to reporting VDEV types.\r\n\r\nFor the `smartctl` script, I am currently parsing what `smartctl` prints from the SMART Attributes Data Structure. I'm noticing that `smartctl` output varies widely. I'm hoping that at least the data structure is printed consistently. Worst case, a user has to provided a custom `smartctl` script which will parse their version of the tools output. I'm also looking for opinions on which values would be most important.\r\n\r\nI likely broke some of the `zpool iostat/status -c` test cases. I'll fix those as they crop up. I also hope to add test cases for the `<home>/.zfs/zpool` user script changes.\r\n\r\n### Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Performance enhancement (non-breaking change which improves efficiency)\r\n- [ ] Code cleanup (non-breaking change which makes code smaller or more readable)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n### Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the ZFS on Linux code style requirements.\r\n- [x] I have updated the documentation accordingly.\r\n- [x] I have read the **CONTRIBUTING** document.\r\n- [x] I have added tests to cover my changes.\r\n- [ ] All new and existing tests passed.\r\n- [x] All commit messages are properly formatted and contain `Signed-off-by`.\r\n- [ ] Change has been approved by a ZFS on Linux member.\r\n"},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/303250182","html_url":"https://github.com/zfsonlinux/zfs/pull/6121#issuecomment-303250182","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/6121","id":303250182,"user":{"login":"tonyhutter","id":11469457,"avatar_url":"https://avatars3.githubusercontent.com/u/11469457?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyhutter","html_url":"https://github.com/tonyhutter","followers_url":"https://api.github.com/users/tonyhutter/followers","following_url":"https://api.github.com/users/tonyhutter/following{/other_user}","gists_url":"https://api.github.com/users/tonyhutter/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyhutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyhutter/subscriptions","organizations_url":"https://api.github.com/users/tonyhutter/orgs","repos_url":"https://api.github.com/users/tonyhutter/repos","events_url":"https://api.github.com/users/tonyhutter/events{/privacy}","received_events_url":"https://api.github.com/users/tonyhutter/received_events","type":"User","site_admin":false},"created_at":"2017-05-22T23:47:27Z","updated_at":"2017-05-22T23:47:27Z","body":"1. I would use ```/root/.zpool.d``` instead of ```/root/zpool.d```.\r\n2.\r\n```\r\n# ./cmd/zpool/zpool status -c\r\nCurrent scripts in /root/zpool.d:\r\nCurrent scripts in /usr/local/etc/zfs/zpool.d:\r\n```\r\nOmit printing \"Current scripts in /root/.zpool.d\" if the directory doesn't exist.  Most users won't have that directory.\r\n\r\n3. I see you've added ```ZPOOL_SCRIPTS_PATH``` in the \"ENVIRONMENT VARIABLES\" section of the zpool man page.  You may also want to add a quick reference to it in the ```zpool iostat|status -c``` section as well.\r\n\r\n\r\n4.\r\n ```./cmd/zpool/zpool status -c\r\n  ...\r\n  nonmed          Show SMART non-medium errors (SAS).\r\n  media           media: Show whether a vdev is a file, hdd, or ssd.\r\n  media           media=\r\n  hours_on        Show number of hours drive powered on (all drives).\r\n```\r\nThe script name already gets printed by zpool, so you don't need to print it in the help line.  Also, you should exit after printing the help line to avoid the \"media=\" line.\r\n"}}
{"actor":{"display_login":"tonyhutter"}}