{"id":25903085,"url":"https://github.com/rare-magma/storagebox-exporter","last_synced_at":"2026-04-04T06:13:36.082Z","repository":{"id":280341314,"uuid":"941621161","full_name":"rare-magma/storagebox-exporter","owner":"rare-magma","description":"CLI tool that uploads the Hetzner API storage box statistics to InfluxDB on a daily basis ","archived":false,"fork":false,"pushed_at":"2026-02-01T12:49:24.000Z","size":261,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T22:29:36.562Z","etag":null,"topics":["grafana","grafana-dashboard","hetzner","hetzner-robot-api","influxdb","storagebox"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rare-magma.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-02T18:05:06.000Z","updated_at":"2026-02-01T12:49:20.000Z","dependencies_parsed_at":"2025-06-01T13:36:40.148Z","dependency_job_id":"c3056863-430f-416f-abaa-a0f4c646028e","html_url":"https://github.com/rare-magma/storagebox-exporter","commit_stats":null,"previous_names":["rare-magma/storagebox-exporter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rare-magma/storagebox-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Fstoragebox-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Fstoragebox-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Fstoragebox-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Fstoragebox-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rare-magma","download_url":"https://codeload.github.com/rare-magma/storagebox-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rare-magma%2Fstoragebox-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31389583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["grafana","grafana-dashboard","hetzner","hetzner-robot-api","influxdb","storagebox"],"created_at":"2025-03-03T03:18:27.503Z","updated_at":"2026-04-04T06:13:36.066Z","avatar_url":"https://github.com/rare-magma.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# storagebox-exporter\n\nCLI tool that uploads the Hetzner Storage Box usage data from the Hetzner API to influxdb on a daily basis\n\n## Dependencies\n\n- [go](https://go.dev/)\n- [influxdb v2+](https://docs.influxdata.com/influxdb/v2.6/)\n- Optional:\n  - [make](https://www.gnu.org/software/make/) - for automatic installation support\n  - [docker](https://docs.docker.com/)\n  - [podman](https://docs.podman.io)\n  - [systemd](https://systemd.io/)\n\n## Relevant documentation\n\n- [Hetzner API](https://robot.hetzner.com/doc/webservice/en.html#get-storagebox)\n- [InfluxDB API](https://docs.influxdata.com/influxdb/v2.6/write-data/developer-tools/api/)\n- [Systemd Timers](https://www.freedesktop.org/software/systemd/man/systemd.timer.html)\n- [compose-scheduler](https://github.com/reddec/compose-scheduler)\n\n## Installation\n\n### With Podman Quadlets and systemd timer\n\n1. Configure `storagebox_exporter.json` (see the configuration section below).\n1. Copy `storagebox-exporter.container` to `$HOME/.config/containers/systemd/storagebox-exporter.container`\n1. Copy `storagebox-exporter.timer` to `$HOME/.config/systemd/user/storagebox-exporter.timer`\n1. Reload the user's systemd daemon\n\n   ```bash\n    systemctl --user daemon-reload\n   ```\n\n1. Run it.\n\n   ```bash\n    systemctl --user start storagebox-exporter.timer\n   ```\n\n### With Docker\n\n#### docker-compose\n\n1. Configure `storagebox_exporter.json` (see the configuration section below).\n1. Run it.\n\n   ```bash\n   docker compose up --detach\n   ```\n\n#### docker build \u0026 run\n\n1. Build the docker image.\n\n   ```bash\n   docker build . --tag storagebox-exporter\n   ```\n\n1. Configure `storagebox_exporter.json` (see the configuration section below).\n1. Run it.\n\n    ```bash\n    docker run --rm --init --tty --interactive --read-only --cap-drop ALL --security-opt no-new-privileges:true --cpus 2 -m 64m --pids-limit 16 --volume ./storagebox_exporter.json:/app/storagebox_exporter.json:ro ghcr.io/rare-magma/storagebox-exporter:latest\n    ```\n\n### With the Makefile\n\nFor convenience, you can install this exporter with the following command or follow the manual process described in the next paragraph.\n\n```bash\nmake build\nmake install\n$EDITOR $HOME/.config/storagebox_exporter.json\n```\n\n### Manually\n\n1. Build `storagebox_exporter` with:\n\n    ```bash\n    go build -ldflags=\"-s -w\" -o storagebox_exporter main.go\n    ```\n\n2. Copy `storagebox_exporter` to `$HOME/.local/bin/` and make it executable.\n\n3. Copy `storagebox_exporter.json` to `$HOME/.config/`, configure it (see the configuration section below) and make it read only.\n\n4. Copy the systemd unit and timer to `$HOME/.config/systemd/user/`:\n\n    ```bash\n    cp storagebox-exporter.* $HOME/.config/systemd/user/\n    ```\n\n5. and run the following command to activate the timer:\n\n    ```bash\n    systemctl --user enable --now storagebox-exporter.timer\n    ```\n\nIt's possible to trigger the execution by running manually:\n\n```bash\nsystemctl --user start storagebox-exporter.service\n```\n\n### Config file\n\nThe config file has a few options:\n\n```json\n{\n \"InfluxDBHost\": \"influxdb.example.com\",\n \"InfluxDBApiToken\": \"ZXhhbXBsZXRva2VuZXhhcXdzZGFzZGptcW9kcXdvZGptcXdvZHF3b2RqbXF3ZHFhc2RhCg==\",\n \"Org\": \"home\",\n \"Bucket\": \"storagebox\",\n \"ApiToken\": \"ZXhhbXBsZXRva2VuZXhhcXdzZGFzZGptcW9kcXdvZGptcXdvZHF3b2RqbXF3ZHFhc\"\n}\n```\n\n- `InfluxDBHost` should be the FQDN of the influxdb server.\n- `Org` should be the name of the influxdb organization that contains the energy consumption data bucket defined below.\n- `Bucket` should be the name of the influxdb bucket that will hold the energy consumption data.\n- `InfluxDBApiToken` should be the influxdb API token value.\n  - This token should have write access to the `BUCKET` defined above.\n- `ApiToken` should be the token used to access the hetzner api.\n  - This can be configured in the Hetzner Console. Log in, choose a Project, go to Security → API Tokens and create a new read only token.\n\n## Troubleshooting\n\nCheck the systemd service logs and timer info with:\n\n```bash\njournalctl --user --unit storagebox-exporter.service\nsystemctl --user list-timers\n```\n\n## Exported metrics\n\n- size: Total space in bytes\n- used: Used space in bytes\n- used_data: Used space by data in bytes\n- used_snapshot: Used space by snapshots in bytes\n\n## Exported metrics example\n\n```\nstoragebox_stats,id=XXXX,name=box,type=bxxx,status=active,location=fsn1,samba=false,ssh=true,external_reachability=true,server=username.your-storagebox.de,host=FSN1-BXXXX,webdav=false,zfs=true size=5497558138880,used=3644984393728,used_data=2802055118848,used_snapshot=842929274880 1751132140\n```\n\n## Example grafana dashboard\n\nIn `storagebox-dashboard.json` there is an example of the kind of dashboard that can be built with `storagebox-exporter` data:\n\n\u003cimg src=\"dashboard-screenshot.png\" title=\"Example grafana dashboard\" width=\"100%\"\u003e\n\nImport it by doing the following:\n\n1. Create a dashboard\n2. Click the dashboard's settings button on the top right.\n3. Go to JSON Model and then paste there the content of the `storagebox-dashboard.json` file.\n\n## Uninstallation\n\n### With the Makefile\n\nFor convenience, you can uninstall this exporter with the following command or follow the process described in the next paragraph.\n\n```bash\nmake uninstall\n```\n\n### Manually\n\nRun the following command to deactivate the timer:\n\n```bash\nsystemctl --user disable --now storagebox-exporter.timer\n```\n\nDelete the following files:\n\n```bash\n~/.local/bin/storagebox_exporter\n~/.config/storagebox_exporter.json\n~/.config/systemd/user/storagebox-exporter.timer\n~/.config/systemd/user/storagebox-exporter.service\n```\n\n## Credits\n\n- [podman quadlets](https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html)\n- [reddec/compose-scheduler](https://github.com/reddec/compose-scheduler)\n\nThis project takes inspiration from the following:\n\n- [fleaz/prometheus-storagebox-exporter](https://github.com/fleaz/prometheus-storagebox-exporter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frare-magma%2Fstoragebox-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frare-magma%2Fstoragebox-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frare-magma%2Fstoragebox-exporter/lists"}