{"id":13587049,"url":"https://github.com/HON95/prometheus-nut-exporter","last_synced_at":"2025-04-07T19:30:34.121Z","repository":{"id":41900569,"uuid":"265536600","full_name":"HON95/prometheus-nut-exporter","owner":"HON95","description":"A Prometheus exporter for Network UPS Tools (NUT)","archived":false,"fork":false,"pushed_at":"2022-08-03T07:44:09.000Z","size":115,"stargazers_count":70,"open_issues_count":6,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-02-13T21:45:00.026Z","etag":null,"topics":["network-ups-tools","prometheus-exporter"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/HON95.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-20T10:55:40.000Z","updated_at":"2023-12-31T02:39:40.000Z","dependencies_parsed_at":"2022-08-22T19:20:32.076Z","dependency_job_id":null,"html_url":"https://github.com/HON95/prometheus-nut-exporter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HON95%2Fprometheus-nut-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HON95%2Fprometheus-nut-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HON95%2Fprometheus-nut-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HON95%2Fprometheus-nut-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HON95","download_url":"https://codeload.github.com/HON95/prometheus-nut-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247716040,"owners_count":20984159,"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":["network-ups-tools","prometheus-exporter"],"created_at":"2024-08-01T15:05:59.329Z","updated_at":"2025-04-07T19:30:34.114Z","avatar_url":"https://github.com/HON95.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Prometheus NUT Exporter\n\n[![GitHub release](https://img.shields.io/github/v/release/HON95/prometheus-nut-exporter?label=Version)](https://github.com/HON95/prometheus-nut-exporter/releases)\n[![CI](https://github.com/HON95/prometheus-nut-exporter/workflows/CI/badge.svg?branch=master)](https://github.com/HON95/prometheus-nut-exporter/actions?query=workflow%3ACI)\n[![FOSSA status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FHON95%2Fprometheus-nut-exporter.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FHON95%2Fprometheus-nut-exporter?ref=badge_shield)\n[![Docker pulls](https://img.shields.io/docker/pulls/hon95/prometheus-nut-exporter?label=Docker%20Hub)](https://hub.docker.com/r/hon95/prometheus-nut-exporter)\n\n![Dashboard](https://grafana.com/api/dashboards/14371/images/10335/image)\n\nA Prometheus/OpenMetrics exporter for uninterruptable power supplies (UPSes) using Network UPS Tools (NUT).\n\n## Usage\n\n### NUT\n\nSet up NUT in server mode and make sure the TCP port (3493 by default) is accessible (without authentication).\n\nIf you want to test that it's working, run `telnet \u003cnut-server\u003e 3493` and then `VER`, `LIST UPS` and `LIST VAR \u003cups\u003e`.\n\n### Docker\n\nExample `docker-compose.yml`:\n\n```yaml\nversion: \"3.7\"\n\nservices:\n  nut-exporter:\n    # Stable v1\n    image: hon95/prometheus-nut-exporter:1\n    environment:\n      - TZ=Europe/Oslo\n      - HTTP_PATH=/metrics\n      # Defaults\n      #- RUST_LOG=info\n      #- HTTP_PORT=9995\n      #- HTTP_PATH=/nut\n      #- LOG_REQUESTS_CONSOLE=false\n      #- PRINT_METRICS_AND_EXIT=false\n    ports:\n      - \"9995:9995/tcp\"\n```\n\n### Prometheus\n\nExample `prometheus.yml`:\n\n```yaml\nglobal:\n    scrape_interval: 15s\n    scrape_timeout: 10s\n\nscrape_configs:\n  - job_name: \"nut\"\n    static_configs:\n      # Insert NUT server address here\n      - targets: [\"nut-server:3493\"]\n    relabel_configs:\n      - source_labels: [__address__]\n        target_label: __param_target\n      - source_labels: [__param_target]\n        target_label: instance\n      - target_label: __address__\n        # Insert NUT exporter address here\n        replacement: nut-exporter:9995\n```\n\nIn the above example, `nut-exporter:9995` is the address and port of the NUT _exporter_ while `nut-server:3493` is the address and port of the NUT _server_ to query through the exporter.\n\n### Kubernetes Resource Usage\n\nExample container resources requests and limits.\nThis was done by scraping one NUT server with two UPSes.\nResource usage was observed across 7 days period.\nThis can be lowered even more but should be sufficient as a starting point.\n\n```yaml\nresources:\n  limits:\n    cpu: \"10m\"\n    memory: \"16Mi\"\n  requests:\n    cpu: \"1m\"\n    memory: \"8Mi\"\n```\n\n### Grafana\n\n[Example dashboard](https://grafana.com/grafana/dashboards/14371)\n\n## Configuration\n\n### Docker Image Versions\n\nUse e.g. `1` for stable v1.y.z releases and `latest` for bleeding/dev/unstable releases.\n\n### Environment Variables\n\n- `RUST_LOG` (defaults to `info`): The log level used by the console/STDOUT. Set to `debug` so show HTTP requests and `trace` to show extensive debugging info.\n- `HTTP_ADDRESS` (defaults to `::`): The HTTP server will listen on this IP. Set to `127.0.0.1` or `::1` to only allow local access.\n- `HTTP_PORT` (defaults to `9995`): The HTTP server port.\n- `HTTP_PATH` (defaults to `nut`): The HTTP server metrics path. You may want to set it to `/metrics` on new setups to avoid extra Prometheus configuration (not changed here due to compatibility).\n- `PRINT_METRICS_AND_EXIT` (defaults to `false`): Print a Markdown-formatted table consisting of all metrics and then immediately exit. Used mainly for generating documentation.\n\n## Metrics\n\nSee [metrics](metrics.md).\n\n## License\n\nGNU General Public License version 3 (GPLv3).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHON95%2Fprometheus-nut-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHON95%2Fprometheus-nut-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHON95%2Fprometheus-nut-exporter/lists"}