{"id":34509999,"url":"https://github.com/pedropombeiro/qnapexporter","last_synced_at":"2026-06-09T23:00:38.998Z","repository":{"id":65808387,"uuid":"600346975","full_name":"pedropombeiro/qnapexporter","owner":"pedropombeiro","description":"Prometheus metrics exporter, Grafana dashboards, and QNAP notification sink for QNAP NAS devices.","archived":false,"fork":false,"pushed_at":"2026-06-01T20:33:40.000Z","size":6413,"stargazers_count":71,"open_issues_count":1,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-06-01T22:21:03.494Z","etag":null,"topics":["grafana","prometheus-exporter","qnap","ups"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedropombeiro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"pedropombeiro","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2023-02-11T07:46:56.000Z","updated_at":"2026-06-01T20:33:43.000Z","dependencies_parsed_at":"2024-06-21T16:49:31.202Z","dependency_job_id":"2fd5a37a-3aef-40f8-90ce-6de244172927","html_url":"https://github.com/pedropombeiro/qnapexporter","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/pedropombeiro/qnapexporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropombeiro%2Fqnapexporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropombeiro%2Fqnapexporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropombeiro%2Fqnapexporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropombeiro%2Fqnapexporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedropombeiro","download_url":"https://codeload.github.com/pedropombeiro/qnapexporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropombeiro%2Fqnapexporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34129072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","prometheus-exporter","qnap","ups"],"created_at":"2025-12-24T03:51:49.630Z","updated_at":"2026-06-09T23:00:38.991Z","avatar_url":"https://github.com/pedropombeiro.png","language":"Go","funding_links":["https://github.com/sponsors/pedropombeiro"],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/pedropombeiro/qnapexporter/actions/workflows/main.yml/badge.svg)](https://github.com/pedropombeiro/qnapexporter/actions/workflows/main.yml)\n\n# qnapexporter\n\n`qnapexporter` is a simple Go program meant to be run in the background on a QNAP NAS in order to export\nrelevant metrics to Prometheus. It exposes an HTTP `/metrics` endpoint which generates a standard Prometheus metrics file, and a `/notifications` endpoint which can simulate an SMSC endpoint for QNAP notifications.\n\nThe data produced by this exporter can be used to create Grafana dashboards such as the following:\n\n![Grafana dashboard sample](assets/grafana.png \"Grafana dashboard sample\")\n\n![UPS Grafana dashboard sample](assets/ups.png \"UPS Grafana dashboard sample\")\n\nThe Grafana dashboard sources are in the `/dashboards` directory.\n\n## Installation (from binaries)\n\n1. Download the latest qnapexporter executable from the [Releases page](https://github.com/pedropombeiro/qnapexporter/releases)\n1. Run `qnapexporter`\n\n   ```shell\n   ./qnapexporter\n   ```\n\n   Normally it should be run as a background task. Unfortunately this is not easy on a QNAP NAS.\n   See for example [this forum post](https://forum.qnap.com/viewtopic.php?t=44743#p198192) for ideas on how to achieve it.\n\n## Installation (alternative, from qpkg)\n\n1. Download the latest qnapexporter qpkg package from the [Releases page](https://github.com/pedropombeiro/qnapexporter/releases)\n1. Via web ui in QNAP, use manual installation in App Center. Please note that the installation will issue a warning because the QPKG package is not signed. When the binary is installed via QPKG, it will automatically start as background task and can be also stopped/started via App Center.\n\n## Building from source\n\n### Prerequisites\n\n- [Go](https://golang.org/) 1.25+\n- [mise](https://mise.jdx.dev/) (version management \u0026 task automation)\n- [pre-commit](https://pre-commit.com/) (optional, for development)\n- [golangci-lint](https://golangci-lint.run/) (optional, for linting)\n\n### Setup\n\nInstall dependencies:\n\n```bash\nmise run install\n```\n\nThis will run `mise install` to set up Go and project dependencies.\n\n### Development Commands\n\n- `mise run build` - Build the binary (output: `./bin/qnapexporter`)\n- `mise run test` - Run all tests\n- `mise run test -- -v -cover` - Run tests with verbose output and coverage\n- `mise run lint` - Run golangci-lint checks\n- `mise run fix` - Run formatters and auto-fixable linters\n- `mise run mocks` - Generate test mocks\n- `mise run vendor` - Update vendored dependencies\n- `mise run clean` - Remove build artifacts\n- `mise run info` - Display build metadata\n- `mise tasks` - List all available commands\n\n### Pre-commit Hooks\n\nInstall pre-commit hooks:\n\n```bash\npre-commit install\n```\n\nHooks will run automatically on `git commit`, or manually with `mise run fix`.\n\n## Prometheus configuration\n\nAdd target to `scrape_configs` section of `prometheus.ini`\n\n```yaml\n- job_name: \"qnap\"\n  scrape_interval: 10s\n  honor_labels: true\n  static_configs:\n    - targets: [\"localhost:9094\"]\n```\n\n## Customization\n\nqnapexporter supports the following command line flags:\n\n| Flag                   | Default value | Description                                                                                                |\n| ---------------------- | ------------- | ---------------------------------------------------------------------------------------------------------- |\n| `--port`               | `:9094`       | Address/port where to serve the metrics                                                                    |\n| `--ping-target`        | `1.1.1.1`     | Host to periodically ping                                                                                  |\n| `--healthcheck`        | N/A           | Healthcheck service to ping every 5 minutes (currently supported: `healthchecks.io:\u003ccheck-id\u003e`)            |\n| `--grafana-url`        | N/A           | Grafana host (e.g.: https://grafana.example.com), also settable through `GRAFANA_URL` environment variable |\n| `--grafana-auth-token` | N/A           | Grafana API token for annotations, also settable through `GRAFANA_AUTH_TOKEN` environment variable         |\n| `--grafana-tags`       | `nas`         | List of Grafana tags for annotations, also settable through `GRAFANA_TAGS` environment variable            |\n| `--log`                | N/A           | Path to log file (defaults to standard output), also settable through `LOG_FILE` environment variable     |\n\n### Configuring support for QNAP events as Grafana annotations\n\nqnapexporter can expose QNAP events as Grafana annotations, to make it easy to understand what is happening on the NAS. To configure the support:\n\n1. Log in to the NAS web interface\n2. Open `Notification Center`, then `Service Account and Device Pairing`\n3. In the `SMS` tab, click the `Add SMSC Service` button\n   1. In `SMS service provider`, select `custom`\n   2. Set `Alias` to `qnapexporter`\n   3. Set `URL template text` to `http://localhost:9094/notification?phone_number=@@PhoneNumber@@\u0026text=@@Text@@`. Customize the port to match whatever is passed to `--port`.\n   4. Confirm the settings.\n4. In the Grafana web UI, go to `Configuration`, `API Keys`\n   1. Press `Add API key`\n   2. Set `Key name` to `qnapexporter`\n   3. Set `Role` to `Editor`\n   4. Press `Add`\n   5. Take note of the created token (this will be passed to qnapexporter with `--grafana-auth-token`)\n\n## Tips\n\nThe root endpoint exposes information about the current status of the program (useful for debugging):\n\n![Status page](assets/status.jpeg \"Status page\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedropombeiro%2Fqnapexporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedropombeiro%2Fqnapexporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedropombeiro%2Fqnapexporter/lists"}