{"id":19277666,"url":"https://github.com/observiq/disk-usage","last_synced_at":"2025-04-22T00:31:02.713Z","repository":{"id":54388208,"uuid":"137427232","full_name":"observIQ/disk-usage","owner":"observIQ","description":"Trigger slack alerts when disk usage is too high","archived":false,"fork":false,"pushed_at":"2024-02-19T15:33:29.000Z","size":112,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-19T23:15:02.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/observIQ.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-15T01:37:38.000Z","updated_at":"2024-06-19T23:15:12.703Z","dependencies_parsed_at":"2024-06-19T23:15:09.145Z","dependency_job_id":"9a2cf765-9a89-4bd8-b3b8-4da9efb4a890","html_url":"https://github.com/observIQ/disk-usage","commit_stats":null,"previous_names":["observiq/disk-usage","bluemedorapublic/disk-usage"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/observIQ%2Fdisk-usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/observIQ%2Fdisk-usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/observIQ%2Fdisk-usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/observIQ%2Fdisk-usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/observIQ","download_url":"https://codeload.github.com/observIQ/disk-usage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223881912,"owners_count":17219269,"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":"2024-11-09T21:06:35.453Z","updated_at":"2024-11-09T21:06:36.119Z","avatar_url":"https://github.com/observIQ.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# disk-usage\nAlerts based on disk usage - run with cron or windows tasks\n\n[![Build Status](https://travis-ci.com/observIQ/disk-usage.svg?branch=master)](https://travis-ci.com/observIQ/disk-usage)\n[![Go Report Card](https://goreportcard.com/badge/github.com/observIQ/disk-usage)](https://goreportcard.com/report/github.com/observIQ/disk-usage)\n\n## Usage\nPass `--help`\n```\nUsage of ./disk-usage:\n  -alert-type string\n    \tAlert type to use. Defaults to slack for backwards compatibility, falls back on Stdout if slack params are not set (default \"slack\")\n  -c string\n    \tSlack channel\n  -dryrun\n    \tRun without sending alerts\n  -hostname string\n    \tSet the hostname\n  -log-level string\n    \tSet log level (error, warning, info, trace) (default \"info\")\n  -slack-url string\n    \tSlack webhook url\n  -t int\n    \tDisk usage percentage that should trigger an alert (default 85)\n  -version\n    \tPrint version\n```\n\nExample: Use slack:\n```\n./disk-usage.bin \\\n    -t 80 \\\n    -c \"#my-channel\" \\\n    -slack-url https://hooks.slack.com/services/mycookhere\n```\n\nExample message:\n```\n{\n    \"host\": {\n        \"name\": \"test\",\n        \"address\": \"10.99.1.10\",\n        \"devices\": [\n            {\n                \"name\": \"/dev/dm-1\",\n                \"mountpoint\": \"/\",\n                \"type\": \"ext4\",\n                \"usage_percent\": 87\n            },\n            {\n                \"name\": \"/dev/sdc2\",\n                \"mountpoint\": \"/boot\",\n                \"type\": \"ext4\",\n                \"usage_percent\": 29\n            },\n            {\n                \"name\": \"/dev/dm-3\",\n                \"mountpoint\": \"/home\",\n                \"type\": \"ext4\",\n                \"usage_percent\": 63\n            },\n            {\n                \"name\": \"/dev/sda1\",\n                \"mountpoint\": \"/mnt\",\n                \"type\": \"ext4\",\n                \"usage_percent\": 21\n            }\n        ]\n    },\n    \"message\": \"devices have high usage: [/dev/dm-1 /dev/sdc2 /dev/dm-3 /dev/sda1]\",\n    \"severity\": \"fatal\"\n}\n```\n\n## Building\nA `Makefile` is provided, and relies on Docker to be available\n```\nmake\n```\n\nIf you wish to avoid Make and Docker, you can build with\nGo 1.16 on your machine\n```\ngo install github.com/mitchellh/gox\n\nenv CGO_ENABLED=0 \\\n$GOPATH/bin/gox \\\n    -os='!netbsd !openbsd !darwin'  \\\n    -output \"artifacts/disk-usage-{{.OS}}-{{.Arch}}\" \\\n    ./...\n```\n\nBoth build options will output binaries in `artifacts/`\n\n# Community\n\ndisk-usage is an open source project. If you'd like to contribute, take a look at our [contribution guidelines](/docs/CONTRIBUTING.md). We look forward to building with you.\n\n## Code of Conduct\n\ndisk-usage follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). Please report violations of the Code of Conduct to any or all [maintainers](/docs/MAINTAINERS.md).\n\n# Other questions?\n\nSend us an [email](mailto:support@observiq.com), or open an issue with your question. We'd love to hear from you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobserviq%2Fdisk-usage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobserviq%2Fdisk-usage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobserviq%2Fdisk-usage/lists"}