{"id":13581377,"url":"https://github.com/natrontech/pbs-exporter","last_synced_at":"2025-08-13T19:06:04.942Z","repository":{"id":189971706,"uuid":"681229414","full_name":"natrontech/pbs-exporter","owner":"natrontech","description":"A prometheus exporter for Proxmox Backup Server","archived":false,"fork":false,"pushed_at":"2025-07-14T13:52:16.000Z","size":214,"stargazers_count":29,"open_issues_count":5,"forks_count":11,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-14T17:33:47.818Z","etag":null,"topics":["golang","prometheus-exporter","proxmox-backup-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/natrontech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY-INSIGHTS.yml","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-21T14:52:18.000Z","updated_at":"2025-07-14T13:48:20.000Z","dependencies_parsed_at":"2023-08-22T18:29:39.350Z","dependency_job_id":"839bca74-115e-44ab-90e8-7a3ddecec4dd","html_url":"https://github.com/natrontech/pbs-exporter","commit_stats":null,"previous_names":["natrontech/pbs_exporter"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/natrontech/pbs-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fpbs-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fpbs-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fpbs-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fpbs-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natrontech","download_url":"https://codeload.github.com/natrontech/pbs-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fpbs-exporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270295733,"owners_count":24560349,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"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":["golang","prometheus-exporter","proxmox-backup-server"],"created_at":"2024-08-01T15:02:00.955Z","updated_at":"2025-08-13T19:06:04.894Z","avatar_url":"https://github.com/natrontech.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Proxmox Backup Server Exporter\n\n[![license](https://img.shields.io/github/license/natrontech/pbs-exporter)](https://github.com/natrontech/pbs-exporter/blob/main/LICENSE)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/natrontech/pbs-exporter/badge)](https://securityscorecards.dev/viewer/?uri=github.com/natrontech/pbs-exporter)\n[![release](https://img.shields.io/github/v/release/natrontech/pbs-exporter)](https://github.com/natrontech/pbs-exporter/releases)\n[![go-version](https://img.shields.io/github/go-mod/go-version/natrontech/pbs-exporter)](https://github.com/natrontech/pbs-exporter/blob/main/go.mod)\n[![Go Report Card](https://goreportcard.com/badge/github.com/natrontech/pbs-exporter)](https://goreportcard.com/report/github.com/natrontech/pbs-exporter)\n[![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev)\n\n---\n\nExport [Proxmox Backup Server](https://www.proxmox.com/en/proxmox-backup-server/overview) statistics to [Prometheus](https://prometheus.io/).\n\nMetrics are retrieved using the [Proxmox Backup Server API](https://pbs.proxmox.com/docs/api-viewer/index.html).\n\n## Exported Metrics\n\n| Metric                         | Meaning                                                 | Labels                                       |\n| ------------------------------ | ------------------------------------------------------- | -------------------------------------------- |\n| pbs_up                         | Was the last query of Proxmox Backup Server successful? |                                              |\n| pbs_version                    | Version of Proxmox Backup Server                        | `version`, `repoid`, `release`               |\n| pbs_available                  | The available bytes of the underlying storage.          | `datastore`                                  |\n| pbs_size                       | The size of the underlying storage in bytes.            | `datastore`                                  |\n| pbs_used                       | The used bytes of the underlying storage.               | `datastore`                                  |\n| pbs_snapshot_count             | The total number of backups.                            | `datastore`, `namespace`                     |\n| pbs_snapshot_vm_count          | The total number of backups per VM.                     | `datastore`, `namespace`, `vm_id`, `vm_name` |\n| pbs_snapshot_vm_last_timestamp | The timestamp of the last backup of a VM.               | `datastore`, `namespace`, `vm_id`, `vm_name` |\n| pbs_snapshot_vm_last_verify    | The verify status of the last backup of a VM.           | `datastore`, `namespace`, `vm_id`, `vm_name` |\n| pbs_host_cpu_usage             | The CPU usage of the host.                              |                                              |\n| pbs_host_memory_free           | The free memory of the host.                            |                                              |\n| pbs_host_memory_total          | The total memory of the host.                           |                                              |\n| pbs_host_memory_used           | The used memory of the host.                            |                                              |\n| pbs_host_swap_free             | The free swap of the host.                              |                                              |\n| pbs_host_swap_total            | The total swap of the host.                             |                                              |\n| pbs_host_swap_used             | The used swap of the host.                              |                                              |\n| pbs_host_disk_available        | The available disk of the local root disk in bytes.     |                                              |\n| pbs_host_disk_total            | The total disk of the local root disk in bytes.         |                                              |\n| pbs_host_disk_used             | The used disk of the local root disk in bytes.          |                                              |\n| pbs_host_uptime                | The uptime of the host.                                 |                                              |\n| pbs_host_io_wait               | The io wait of the host.                                |                                              |\n| pbs_host_load1                 | The load for 1 minute of the host.                      |                                              |\n| pbs_host_load5                 | The load for 5 minutes of the host.                     |                                              |\n| pbs_host_load15                | The load 15 minutes of the host.                        |                                              |\n\n## Flags / Environment Variables\n\n```bash\n$ ./pbs-exporter -help\n```\n\nYou can use the following flags to configure the exporter. All flags can also be set using environment variables. Environment variables take precedence over flags.\n\n| Flag                 | Environment Variable | Description                                          | Default                                                |\n| -------------------- | -------------------- | ---------------------------------------------------- | ------------------------------------------------------ |\n| `pbs.loglevel`       | `PBS_LOGLEVEL`       | Log level (debug, info)                              | `info`                                                 |\n| `pbs.api.token`      | `PBS_API_TOKEN`      | API token to use for authentication                  |                                                        |\n| `pbs.api.token.name` | `PBS_API_TOKEN_NAME` | Name of the API token to use for authentication      | `pbs-exporter`                                         |\n| `pbs.endpoint`       | `PBS_ENDPOINT`       | Address of the Proxmox Backup Server                 | `http://localhost:8007` (if no parameter `target` set) |\n| `pbs.username`       | `PBS_USERNAME`       | Username to use for authentication                   | `root@pam`                                             |\n| `pbs.timeout`        | `PBS_TIMEOUT`        | Timeout for requests to Proxmox Backup Server        | `5s`                                                   |\n| `pbs.insecure`       | `PBS_INSECURE`       | Disable TLS certificate verification                 | `false`                                                |\n| `pbs.metrics-path`   | `PBS_METRICS_PATH`   | Path under which to expose metrics                   | `/metrics`                                             |\n| `pbs.listen-address` | `PBS_LISTEN_ADDRESS` | Address to listen on for web interface and telemetry | `:10019`                                               |\n\n### Running on PBS (systemd)\nThe Prometheus-pbs-exporter can also simply be installed on a Proxmox Backup Server instead of spawning an additional Docker container.\n\n```\n# Download prometheus-pbs-exporter\nmkdir /opt/pbs-exporter\ncd /opt/pbs-exporter\nwget https://github.com/natrontech/pbs-exporter/releases/download/v0.6.4/pbs-exporter_v0.6.4_linux_amd64.tar.gz\ntar xfvz pbs-exporter_v0.6.4_linux_amd64.tar.gz\ncp pbs-exporter-linux-amd64 /bin/\n\n# Create a dedicated user for running the prometheus-pbs-exporter\nuseradd -m pbs-exporter -s /sbin/nologin\n\n# Download systemd unit file\ncd /etc/systemd/system\nwget https://raw.githubusercontent.com/natrontech/pbs-exporter/refs/heads/main/systemd/prometheus-pbs-exporter.service\nsystemd daemon-reload\n\n# Create prometheus-pbs-exporter environment file (req. minimum the token)\nvi /etc/pbs-exporter.env\n# Add the token content and other options if required:\nTOKEN=beef-1337-cafe-beef-cafe-1337\n\n# Enable and start the service\nsystemctl enable prometheus-pbs-exporter.service\nsystemctl start prometheus-pbs-exporter.service\n```\n\n### Docker secrets\n\nIf you are using [Docker secrets](https://docs.docker.com/engine/swarm/secrets/), you can use the following environment variables to set the path to the secrets:\n\n| Environment Variable      | Description                     |\n| ------------------------- | ------------------------------- |\n| `PBS_API_TOKEN_FILE`      | Path to the API token file      |\n| `PBS_API_TOKEN_NAME_FILE` | Path to the API token name file |\n| `PBS_USERNAME_FILE`       | Path to the username file       |\n\nSee an example of how to use Docker secrets with Docker Compose in the [docker-compose-secrets.yaml](docker-compose-secrets.yaml) file.\n\nThe variables `PBS_API_TOKEN`, `PBS_API_TOKEN_NAME`, and `PBS_USERNAME` take precedence over the secret files.\n\n## Multiple Proxmox Backup Servers\n\nIf you want to monitor multiple Proxmox Backup Servers, you can use the `targets` parameter in the query string. Instead of setting the `pbs.endpoint` flag (or `PBS_ENDPOINT` env), you can use the `target` parameter in the query string to specify the Proxmox Backup Server to monitor. You would then use following URL to scrape metrics: `http://localhost:10019/metrics?target=http://10.10.10.10:8007`.\n\nThis is useful if you are using Prometheus and want to monitor multiple Proxmox Backup Servers with one \"pbs-exporter\" instance.\nYou find examples for Prometheus static configuration in the [prometheus/static-config](prometheus/static-config) directory.\n\n:warning: **Important**: if `pbs.endpoint` or `PBS_ENDPOINT` is set, the `target` parameter is ignored.\n\n## Node metrics\n\nAccording to the [api documentation](https://pbs.proxmox.com/docs/api-viewer/index.html#/nodes/{node}), we have to provide a node name (won't work with the node ip), but it seems to work with any name, so we just use \"localhost\" for the request. This setup is tested with one proxmox backup server host.\n\n## Supported versions\n\nWe have tested the exporter with Proxmox Backup Server version **3.X** (see [Proxmox Backup Server Roadmap](https://pbs.proxmox.com/wiki/index.php/Roadmap)). If you have already tested the exporter with a newer version, or have encountered problems, please let us know.\n\n## Release\n\nEach release of the application includes Go-binary archives, checksums file, SBOMs and container images. \n\nThe release workflow creates provenance for its builds using the [SLSA standard](https://slsa.dev), which conforms to the [Level 3 specification](https://slsa.dev/spec/v1.0/levels#build-l3). Each artifact can be verified using the `slsa-verifier` or `cosign` tool (see [Release verification](SECURITY.md#release-verification)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatrontech%2Fpbs-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatrontech%2Fpbs-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatrontech%2Fpbs-exporter/lists"}