{"id":25932752,"url":"https://github.com/cosium/zabbix_zfs-on-linux","last_synced_at":"2025-07-25T19:42:11.522Z","repository":{"id":45363568,"uuid":"189610861","full_name":"Cosium/zabbix_zfs-on-linux","owner":"Cosium","description":"zabbix template and user parameters to monitor zfs on linux","archived":false,"fork":false,"pushed_at":"2024-06-26T05:35:33.000Z","size":480,"stargazers_count":81,"open_issues_count":21,"forks_count":53,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-02-25T20:41:21.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cosium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-31T14:49:16.000Z","updated_at":"2025-01-18T10:04:30.000Z","dependencies_parsed_at":"2024-10-31T13:31:35.184Z","dependency_job_id":"1a4614a1-c265-4f30-b20b-e5353fb1ed20","html_url":"https://github.com/Cosium/zabbix_zfs-on-linux","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosium%2Fzabbix_zfs-on-linux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosium%2Fzabbix_zfs-on-linux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosium%2Fzabbix_zfs-on-linux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosium%2Fzabbix_zfs-on-linux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cosium","download_url":"https://codeload.github.com/Cosium/zabbix_zfs-on-linux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241763759,"owners_count":20016161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-04T00:39:03.361Z","updated_at":"2025-03-04T00:39:05.004Z","avatar_url":"https://github.com/Cosium.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monitor ZFS on Linux on Zabbix\n\nThis template is a modified version of the original work done by pbergdolt and posted on the zabbix forum a while ago here: https://www.zabbix.com/forum/zabbix-cookbook/35336-zabbix-zfs-discovery-monitoring?t=43347 . Also the original home of this variant was on https://share.zabbix.com/zfs-on-linux .\n\nI have maintained and modified this template over the years and the different versions of ZoL on a large number of servers so I'm pretty confident that it works ;)\n\nThanks to external contributors, this template was extended and is now more complete than ever. However, if you find a metric that you need and is missing, don't hesitate to open a ticket or even better, to create a PR!\n\nTested Zabbix server version include 4.0, 4.4, 5.0 and 5.2 . The template shipped here is in 4.0 format to allow import to all those versions.\n\nThis template will give you screens and graphs for memory usage, zpool usage and performance, dataset usage, etc. It includes triggers for low disk space (customizable via Zabbix own macros), disks errors, etc.\n\nExample of graphs:\n- Arc memory usage and hit rate:\n![arc1](images/example_arc_1.png)\n- Complete breakdown of META and DATA usage:\n![arc2](images/example_arc_2.png)\n- Dataset usage, with available space, and breakdown of used space with directly used space, space used by snapshots and space used by children:\n![dataset](images/example_dataset_usage_1.png)\n- Zpool IO throughput:\n![throughput](images/example_zfs_throughput.png)\n\n# Supported OS and ZoL version\nAny Linux variant should work, tested version by myself include:\n- Debian 8, 9, 10\n- Ubuntu 16.04, 18.04 and 20.04\n- CentOS 6 and 7\n\nAbout the ZoL version, this template is intended to be used by ZoL version 0.7.0 or superior but still works on the 0.6.x branch.\n\n# Installation on Zabbix server\n\nTo use this template, follow those steps:\n\n## Create the Value mapping \"ZFS zpool scrub status\"\nGo to:\n- Administration\n- General\n- Value mapping\n\nThen create a new value map named `ZFS zpool scrub status` with the following mappings:\n\n| Value | Mapped to |\n| ----- | --------- |\n| 0 | Scrub in progress |\n| 1 | No scrub in progress |\n\n![value_map](images/value_map_1.png)\n\n## Import the template\nImport the template that is in the \"template\" directory of this repository or download it directly with this link: ![template](template/zol_template.xml)\n\n# Installation on the server you want to monitor\n## Prerequisites\nThe server needs to have some very basic tools to run the user parameters:\n- awk\n- cat\n- grep\n- sed\n- tail\n\nUsually, they are already installed and you don't have to install them.\n## Add the userparameters file on the servers you want to monitor\n\nThere are 2 different userparameters files in the \"userparameters\" directory of this repository.\n\nOne uses sudo to run and thus you must give zabbix the correct rights and the other doesn't use sudo.\n\nOn recent ZFS on Linux versions (eg version 0.7.0+), you don't need sudo to run `zpool list` or `zfs list` so just install the file ![ZoL_without_sudo.conf](userparameters/ZoL_without_sudo.conf) and you are done.\n\nFor older ZFS on Linux versions (eg version 0.6.x), you will need to add some sudo rights with the file ![ZoL_with_sudo.conf](userparameters/ZoL_with_sudo.conf). On some distribution, ZoL already includes a file with all the necessary rights at `/etc/sudoers.d/zfs` but its content is commented, just remove the comments and any user will be able to list zfs datasets and pools. For convenience, here is the content of the file commented out:\n```\n## Allow read-only ZoL commands to be called through sudo\n## without a password. Remove the first '#' column to enable.\n##\n## CAUTION: Any syntax error introduced here will break sudo.\n##\n## Cmnd alias specification\nCmnd_Alias C_ZFS = \\\n  /sbin/zfs \"\", /sbin/zfs help *, \\\n  /sbin/zfs get, /sbin/zfs get *, \\\n  /sbin/zfs list, /sbin/zfs list *, \\\n  /sbin/zpool \"\", /sbin/zpool help *, \\\n  /sbin/zpool iostat, /sbin/zpool iostat *, \\\n  /sbin/zpool list, /sbin/zpool list *, \\\n  /sbin/zpool status, /sbin/zpool status *, \\\n  /sbin/zpool upgrade, /sbin/zpool upgrade -v\n\n## allow any user to use basic read-only ZFS commands\nALL ALL = (root) NOPASSWD: C_ZFS\n```\nIf you don't know where your \"userparameters\" directory is, this is usually the `/etc/zabbix/zabbix_agentd.d` folder. If in doubt, just look at your `zabbix_agentd.conf` file for the line begining by `Include=`, it will show where it is.\n\n## Restart zabbix agent\nOnce you have added the template, restart zabbix-agent so that it will load the new userparameters.\n\n# Customization of alert level by server\nThis template includes macros to define when the \"low disk spaces\" type triggers will fire.\n\nBy default, you will find them on the macro page of this template:\n![macros](images/macros.png)\n\nIf you change them here, they will apply to every hosts linked to this template, which may not be such a good idea. Prefer to change the macros on specific servers if needed.\n\nYou can see how the macros are used by looking at the discovery rules, then \"Trigger prototypes\":\n![macros](images/trigger_prototypes_zpool.png)\n\n# Important note about Zabbix active items\n\nThis template uses Zabbix items of type `Zabbix agent (active)` (= active items). By default, most template uses `Zabbix agent` items (= passive items).\n\nIf you want, you can convert all the items to `Zabbix agent` and everything will work, but you should really uses active items because those are way more scalable. The official documentation doesn't really make this point clear (https://www.zabbix.com/documentation/4.0/manual/appendix/items/activepassive) but active items are optimized: the agent asks the server for the list of items that the server wants, then send them by batch periodically.\n\nOn the other hand, for passive items, the zabbix server must establish a connection for each items and ask for them, then wait for the anwser: this results in more CPU, memory and network consumption used by both the server and the agent.\n\nTo make an active item work, you must ensure that you have a `ServerActive=your_zabbix_server_fqdn_or_ip` line in your agent config file (usually `/etc/zabbix/zabbix_agentd.conf`).\n\nYou also need to configure the \"Host Name\" on the zabbix UI to be the same as the server output of the `hostname` command (you can always adjust the \"Visible name\" in the Zabbix UI to anything you want if needed) because the zabbix agent sends this information to the zabbix server. It basically tells the server \"Hello, I am $(hostname), which items do you need from me?\" so if there is a mismatch here, the server will most likely answer \"I don't know you!\" ;-)\n\nBeyond a certain point, depending on your hardware, you *will have to use active items*.\n\nAn old but still relevant blog about high performance zabbix is available on https://blog.zabbix.com/scalable-zabbix-lessons-on-hitting-9400-nvps/2615/ .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosium%2Fzabbix_zfs-on-linux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosium%2Fzabbix_zfs-on-linux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosium%2Fzabbix_zfs-on-linux/lists"}