{"id":20541207,"url":"https://github.com/netways/check_disk_btrfs","last_synced_at":"2025-04-14T08:40:20.461Z","repository":{"id":65273534,"uuid":"92949524","full_name":"NETWAYS/check_disk_btrfs","owner":"NETWAYS","description":"Icinga Plugin checking the status of Btrfs volumes","archived":false,"fork":false,"pushed_at":"2024-02-09T16:16:02.000Z","size":56,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-27T22:11:54.732Z","etag":null,"topics":["btrfs","filesystems","icinga","monitoring","plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NETWAYS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-05-31T13:38:52.000Z","updated_at":"2023-12-06T08:42:41.000Z","dependencies_parsed_at":"2024-02-09T08:31:25.787Z","dependency_job_id":"dc24cdda-e8e8-4d17-9b18-0d6702d68a7b","html_url":"https://github.com/NETWAYS/check_disk_btrfs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NETWAYS%2Fcheck_disk_btrfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NETWAYS%2Fcheck_disk_btrfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NETWAYS%2Fcheck_disk_btrfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NETWAYS%2Fcheck_disk_btrfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NETWAYS","download_url":"https://codeload.github.com/NETWAYS/check_disk_btrfs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248848494,"owners_count":21171387,"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":["btrfs","filesystems","icinga","monitoring","plugin"],"created_at":"2024-11-16T01:20:19.752Z","updated_at":"2025-04-14T08:40:20.417Z","avatar_url":"https://github.com/NETWAYS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"check_disk_brtfs\n================\n\nCheck BTRFS formatted filesystems and its special attributes.\n\n## Requirements\n\nCurrently, the plugin requires at least Python 3 (version v2.1.1 is the last `check_disk_btrfs` version running on Python 2).\n\nRequires the `btrfs-progs` packages to be installed. This package name may change depending on the distribution:\n\n* Debian: btrfs-progs\n* RHEL: btrfs-progs\n\nRequires sudo permissions for the `icinga/nagios` user executing btrfs command. Example:\n\n```\nicinga ALL=(ALL) NOPASSWD: /usr/sbin/btrfs filesystem usage *\n```\n\nIf you are running the plugin with  permissions already, set `--no-sudo` as command line parameter.\n\n## Usage\n\n```bash\nusage: check_disk_btrfs [-h] [--sudo] [--no-sudo] [-t TIMEOUT] [-U] [-w THRESHOLD_WARNING]\n                        [-c THRESHOLD_CRITICAL] [-V VOLUME] [-v] [--btrfs-path BTRFS_PATH]\n                        [--sudo-path SUDO_PATH] [-m] [-e]\n\ncheck_disk_btrfs (Version: 3.1.0)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -S, --sudo            Use sudo (default True)\n  --no-sudo             Disable sudo use\n  -t TIMEOUT, --timeout TIMEOUT\n                        Timeout in seconds for the CheckPlugin (default 30)\n  -U, --unallocated     Consider unallocated blocks by using overall size as total (Default True)\n  --no-unallocated      Do not consider unallocated blocks\n  -w THRESHOLD_WARNING, --threshold-warning THRESHOLD_WARNING\n                        Warning threshold in percent\n  -c THRESHOLD_CRITICAL, --threshold-critical THRESHOLD_CRITICAL\n                        Critical threshold in percent\n  -V VOLUME, --volume VOLUME\n                        Path to the Btrfs volume\n  -v, --verbose         Increase verbosity\n  --btrfs-path BTRFS_PATH\n                        Specify the btrfs path to the executable\n  --sudo-path SUDO_PATH\n                        Specify the sudo path to the executable\n  -m, --missing         Check for missing devices in RAID array\n  -e, --error           Check for scrub errors in device\n```\n\nPath to the `sudo` and `btrfs` binaries can be also adjusted using Environment Variables:\n\n```\nSUDO=/usr/bin/sudo\nBTRFS=/usr/sbin/btrfs\n```\n\nExample:\n\n```\ncheck_disk_btrfs -V / -w 30 -c 40\n\nCRITICAL: 'Data, single': 47.59051% used (0.0GB/2.0GB) OK: 'System, single': 0.39063% used (0.0MB/4.0MB),\n'GlobalReserve, single': 0.0% used (0.0MB/16.0MB), 'Metadata, single': 16.41809% used (43.0MB/264.0MB)\n| data_single_used=1025990656;30;40;; data_single_total=2155872256;30;40;; system_single_used=16384;30;40;;\nsystem_single_total=4194304;30;40;; globalreserve_single_used=0;30;40;; globalreserve_single_total=16777216;30;40;;\nmetadata_single_used=45449216;30;40;; metadata_single_total=276824064;30;40;;\n```\n\n## Icinga 2 Integration\n\nExample CheckCommand, Host and Service objects:\n\n```\nobject CheckCommand \"disk_btrfs\" {\n        import \"plugin-check-command\"\n\n        command = [ PluginDir + \"/check_disk_btrfs\" ]\n\n        arguments = {\n                \"-V\" = \"$disk_btrfs_volume$\"\n                \"-w\" = \"$disk_btrfs_warn$\"\n                \"-c\" = \"$disk_btrfs_crit$\"\n                \"-U\" = \"$disk_btrfs_unallocated$\"\n                \"-s\" = \"$disk_btrfs_sudo$\"\n                \"-m\" = \"$disk_btrfs_missing$\"\n                \"-e\" = \"$disk_btrfs_errors$\"\n        }\n}\n\nobject Host \"btrfs-host\" {\n        address = \"127.0.0.1\"\n        check_command = \"hostalive\"\n}\n\napply Service \"disk /\" {\n        check_command = \"disk_btrfs\"\n        vars.disk_btrfs_volume = \"/\"\n        vars.disk_btrfs_warn = 30\n        vars.disk_btrfs_crit = 40\n\n        assign where match(\"btrfs*\", host.name)\n}\n```\n\n## License\n\nCopyright (C) 2015 [NETWAYS GmbH](mailto:info@netways.de)\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetways%2Fcheck_disk_btrfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetways%2Fcheck_disk_btrfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetways%2Fcheck_disk_btrfs/lists"}