{"action":"created","issue":{"url":"https://api.github.com/repos/librenms/librenms-agent/issues/212","repository_url":"https://api.github.com/repos/librenms/librenms-agent","labels_url":"https://api.github.com/repos/librenms/librenms-agent/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/librenms/librenms-agent/issues/212/comments","events_url":"https://api.github.com/repos/librenms/librenms-agent/issues/212/events","html_url":"https://github.com/librenms/librenms-agent/pull/212","id":385099485,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0MTQ2NDA5","number":212,"title":"Added Ubuntu 14.04 zfs support","user":{"login":"Kovrinic","id":5501883,"node_id":"MDQ6VXNlcjU1MDE4ODM=","avatar_url":"https://avatars1.githubusercontent.com/u/5501883?v=4","gravatar_id":"","url":"https://api.github.com/users/Kovrinic","html_url":"https://github.com/Kovrinic","followers_url":"https://api.github.com/users/Kovrinic/followers","following_url":"https://api.github.com/users/Kovrinic/following{/other_user}","gists_url":"https://api.github.com/users/Kovrinic/gists{/gist_id}","starred_url":"https://api.github.com/users/Kovrinic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kovrinic/subscriptions","organizations_url":"https://api.github.com/users/Kovrinic/orgs","repos_url":"https://api.github.com/users/Kovrinic/repos","events_url":"https://api.github.com/users/Kovrinic/events{/privacy}","received_events_url":"https://api.github.com/users/Kovrinic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-28T04:42:40Z","updated_at":"2018-11-28T04:42:47Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/librenms/librenms-agent/pulls/212","html_url":"https://github.com/librenms/librenms-agent/pull/212","diff_url":"https://github.com/librenms/librenms-agent/pull/212.diff","patch_url":"https://github.com/librenms/librenms-agent/pull/212.patch"},"body":"\r\n## Overview\r\nFor Ubuntu 14.04, [ZoL](https://zfsonlinux.org/) page gives the [zfs-native](https://launchpad.net/~zfs-native/+archive/ubuntu/stable) PPA.  It's currently using [zfs-06.5.11](https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.6.5.11) revision.  This poses a few issues with the current [zfs-linux](https://github.com/librenms/librenms-agent/blob/d49fe954dfdeffbeee091051f1f0c515d020f281/snmp/zfs-linux) script:\r\n1. Run Permissions:\r\n    - [zfs-0.7.0](https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.0) changed permissions so non-privileged users can run `zpool list`\r\n2. Parsable list flag:\r\n    - [zfs-0.7.0-rc1](https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.7.0-rc1) added the `-p` in https://github.com/zfsonlinux/zfs/commit/2a8b84b747cb27a175aa3a45b8cdb293cde31886\r\n3. Ubuntu 14.04 supports [Python 3.4.0](https://packages.ubuntu.com/trusty/python3) as `python3`:\r\n    - `subprocess.run()` command works with Python 3.5 and above.\r\n\r\n### Fix 1\r\nAdded `snmp` to the **sudoers** file via `visudo`,\r\n```bash\r\nsnmp  ALL=(root) NOPASSWD: /sbin/zpool\r\n```\r\nand added [sudo](https://github.com/Kovrinic/librenms-agent/blob/5a82bf2240105f1f786a873c263c287e5f1d7678/snmp/zfs-ubuntu-trusty#L123) to the run commands.  Even though `snmp` is ran as root, it still needs the extra permissions in the sudoers file.\r\n\r\n### Fix 2\r\nCatch `-p` error within the [list](https://github.com/Kovrinic/librenms-agent/blob/5a82bf2240105f1f786a873c263c287e5f1d7678/snmp/zfs-ubuntu-trusty#L127:L132) command, and instead get the parsable values from the [get](https://github.com/Kovrinic/librenms-agent/blob/5a82bf2240105f1f786a873c263c287e5f1d7678/snmp/zfs-ubuntu-trusty#L145:L152) command.\r\n\r\n### Fix 3\r\nThe user will need to either manually install `python3.5` _(or higher)_ as the system wide `python3` interpreter.  If they wish to preserve the system `python3` interpreter, then can install from source with `make altinstall` and then add full python3.# path to this script's [shebang](https://github.com/Kovrinic/librenms-agent/blob/5a82bf2240105f1f786a873c263c287e5f1d7678/snmp/zfs-ubuntu-trusty#L1).\r\n\r\nExample: my system has `python3.7` installed via `make altinstall`.\r\n```bash\r\n$ which python3.7\r\n/usr/local/bin/python3.7\r\n```\r\nChange [shebang](https://github.com/Kovrinic/librenms-agent/blob/5a82bf2240105f1f786a873c263c287e5f1d7678/snmp/zfs-ubuntu-trusty#L1) path to\r\n```py\r\n#!/usr/local/bin/python3.7\r\n```\r\n\r\nThis is excessive detail for installing and using alternative version of Python, but wanted to outline the basics for posterity."},"comment":{"url":"https://api.github.com/repos/librenms/librenms-agent/issues/comments/442317823","html_url":"https://github.com/librenms/librenms-agent/pull/212#issuecomment-442317823","issue_url":"https://api.github.com/repos/librenms/librenms-agent/issues/212","id":442317823,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjMxNzgyMw==","user":{"login":"CLAassistant","id":11571300,"node_id":"MDQ6VXNlcjExNTcxMzAw","avatar_url":"https://avatars1.githubusercontent.com/u/11571300?v=4","gravatar_id":"","url":"https://api.github.com/users/CLAassistant","html_url":"https://github.com/CLAassistant","followers_url":"https://api.github.com/users/CLAassistant/followers","following_url":"https://api.github.com/users/CLAassistant/following{/other_user}","gists_url":"https://api.github.com/users/CLAassistant/gists{/gist_id}","starred_url":"https://api.github.com/users/CLAassistant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CLAassistant/subscriptions","organizations_url":"https://api.github.com/users/CLAassistant/orgs","repos_url":"https://api.github.com/users/CLAassistant/repos","events_url":"https://api.github.com/users/CLAassistant/events{/privacy}","received_events_url":"https://api.github.com/users/CLAassistant/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T04:42:47Z","updated_at":"2018-11-28T04:42:47Z","author_association":"NONE","body":"[![CLA assistant check](https://cla-assistant.io/pull/badge/not_signed)](https://cla-assistant.io/librenms/librenms-agent?pullRequest=212) <br/>Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our [Contributor License Agreement](https://cla-assistant.io/librenms/librenms-agent?pullRequest=212) before we can accept your contribution.<br/><sub>You have signed the CLA already but the status is still pending? Let us [recheck](https://cla-assistant.io/check/librenms/librenms-agent?pullRequest=212) it.</sub>"}}
{"actor":{"display_login":"CLAassistant"}}