{"id":18268516,"url":"https://github.com/viral32111/apc-ups-exporter","last_synced_at":"2026-04-01T21:02:14.830Z","repository":{"id":133671718,"uuid":"543326601","full_name":"viral32111/apc-ups-exporter","owner":"viral32111","description":"Prometheus exporter for APC UPS status data.","archived":false,"fork":false,"pushed_at":"2026-03-14T09:02:12.000Z","size":118,"stargazers_count":16,"open_issues_count":6,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-28T00:36:32.747Z","etag":null,"topics":["exporter","metrics","prometheus","ups"],"latest_commit_sha":null,"homepage":"http://www.apcupsd.org/manual","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/viral32111.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2022-09-29T21:31:48.000Z","updated_at":"2026-03-07T09:04:16.000Z","dependencies_parsed_at":"2026-03-19T02:01:43.912Z","dependency_job_id":null,"html_url":"https://github.com/viral32111/apc-ups-exporter","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/viral32111/apc-ups-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fapc-ups-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fapc-ups-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fapc-ups-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fapc-ups-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viral32111","download_url":"https://codeload.github.com/viral32111/apc-ups-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viral32111%2Fapc-ups-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":["exporter","metrics","prometheus","ups"],"created_at":"2024-11-05T11:32:00.540Z","updated_at":"2026-04-01T21:02:14.803Z","avatar_url":"https://github.com/viral32111.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APC UPS Exporter\n\n[![CI](https://github.com/viral32111/apc-ups-exporter/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/viral32111/apc-ups-exporter/actions/workflows/ci.yml)\n[![CodeQL](https://github.com/viral32111/apc-ups-exporter/actions/workflows/codeql.yml/badge.svg)](https://github.com/viral32111/apc-ups-exporter/actions/workflows/codeql.yml)\n![GitHub tag (with filter)](https://img.shields.io/github/v/tag/viral32111/apc-ups-exporter?label=Latest)\n![GitHub repository size](https://img.shields.io/github/repo-size/viral32111/apc-ups-exporter?label=Size)\n![GitHub release downloads](https://img.shields.io/github/downloads/viral32111/apc-ups-exporter/total?label=Downloads)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/viral32111/apc-ups-exporter?label=Commits)\n\nThis is a [Prometheus exporter](https://prometheus.io/docs/instrumenting/exporters/) for the status data reported by [APC's Uninterruptible Power Supplies](https://www.apc.com/uk/en/).\n\nThe status data is fetched from [apcupsd](http://www.apcupsd.org/)'s *Network Information Server* (NIS), so [ensure it is enabled in your `apcupsd.conf` configuration file](http://www.apcupsd.org/manual/manual.html#configuration-directives-used-by-the-network-information-server).\n\nI test this against my [APC Back-UPS 850VA (BE850G2-UK)](https://www.apc.com/shop/uk/en/products/APC-Back-UPS-850VA-230V-USB-Type-C-and-A-charging-ports-8-BS-1363-outlets-2-surge-/P-BE850G2-UK).\n\n## 📥 Usage\n\nDownload the [latest release](https://github.com/viral32111/apc-ups-exporter/releases/latest) for your platform. There are builds available for Linux and Windows, on 32-bit and 64-bit architectures of x86 and ARM. There are extra Linux builds to accommodate glibc and musl libraries.\n\nThe utility does not expect any command-line arguments. There are sensible defaults in place, so it *should* run without any configuration. However, functionality can be changed using the optional command-line flags below.\n\n* `--nis-address \u003cstring\u003e`: The Network Information Server's IPv4 address. Defaults to `127.0.0.1`.\n* `--nis-port \u003cnumber\u003e`: The Network Information Server's TCP port number. Defaults to `3551`.\n* `--metrics-address \u003cstring\u003e`: The listening IPv4 address for the Prometheus HTTP metrics server. Defaults to `127.0.0.1`.\n* `--metrics-port \u003cnumber\u003e`: The listening TCP port number for the Prometheus HTTP metrics server. Defaults to `5000`.\n* `--metrics-path \u003cstring\u003e`: The HTTP path to the metrics page. Defaults to `/metrics`.\n* `--metrics-interval \u003cstring\u003e`: The number of seconds to wait between collecting metrics. Defaults to `15`.\n\nThese flags can be prefixed with either a single (`-`) or double (`--`) hyphen.\n\nUse the `--help` (`-h`) flag for more information.\n\n### 🐳 Docker\n\nAlternatively, there is a [Docker image](https://github.com/users/viral32111/packages/container/package/apc-ups-exporter) available for Linux.\n\nThe image is based on [Ubuntu](https://ubuntu.com) (`ghcr.io/viral32111/apc-ups-exporter:latest-ubuntu`) weighing in at roughly 130 MiB. However, there is a variant based on [Alpine Linux](https://alpinelinux.org) (`ghcr.io/viral32111/apc-ups-exporter:latest-alpine`) which is much lighter at roughly 20 MiB.\n\nRun the command below to download the image and create a container. Replace the `:latest` tag with your desired variant (e.g., `:1.2.0-ubuntu`, `:main-alpine`, etc.).\n\n```bash\ndocker container run \\\n\t--name apc-ups-exporter \\\n\t--network host \\\n\t--detach \\\n\tghcr.io/viral32111/apc-ups-exporter:1\n```\n\nThe host's networking stack is often required to connect to the daemon's Network Information Server.\n\n## 🖼️ Examples\n\nServe metrics at `/metrics` the default loopback port `5000` using data fetched every 15 seconds from the Network Information Server at `192.168.0.5` on the default port `3551`:\n\n```\n$ apc-ups-exporter --nis-address 192.168.0.5\nThe configured Network Information Server is: 192.168.0.5:3551.\n\nResetting all metrics...\nStarting background metrics collection...\nServing metrics page at http://127.0.0.1:5000/metrics...\n\nConnected to the Network Information Server.\n Fetched status from the Network Information Server.\n\tUpdated the status metric.\n\tUpdated the temperature metric.\n\tUpdated the power metrics.\n\tUpdated the battery metrics.\n\tUpdated the daemon metrics.\n Disconnected from the Network Information Server.\n Waiting 15 seconds for next collection..\n```\n\n## 📰 Metrics\n\nThe following Prometheus metrics are exported:\n\n### Status\n\n* `ups_status`\n\n### Temperature\n\n* `ups_temperature_celsius`\n\n### Power\n\n* `ups_power_input_expect_voltage`\n* `ups_power_output_maximum_wattage`\n* `ups_power_line_voltage`\n* `ups_power_line_maximum_voltage`\n* `ups_power_line_minimum_voltage`\n* `ups_power_line_frequency_hertz`\n* `ups_power_output_voltage`\n* `ups_power_load_percent`\n\n### Battery\n\n* `ups_battery_output_actual_voltage`\n* `ups_battery_time_spent_latest_seconds`\n* `ups_battery_time_spent_total_seconds`\n* `ups_battery_remaining_charge_percent`\n* `ups_battery_remaining_time_minutes`\n* `ups_battery_low_threshold_minutes`\n* `ups_battery_count`\n\n### Daemon\n\n* `ups_daemon_remaining_charge_percent`\n* `ups_daemon_remaining_time_minutes`\n* `ups_daemon_timeout_minutes`\n* `ups_daemon_transfer_count`\n* `ups_daemon_start_timestamp`\n\n## ⚖️ License\n\nCopyright (C) 2022 [viral32111](https://viral32111.com).\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (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 Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program. If not, see https://www.gnu.org/licenses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviral32111%2Fapc-ups-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviral32111%2Fapc-ups-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviral32111%2Fapc-ups-exporter/lists"}