{"id":20432919,"url":"https://github.com/cdzombak/nut_influx_connector","last_synced_at":"2025-04-12T20:53:04.902Z","repository":{"id":66912906,"uuid":"343877355","full_name":"cdzombak/nut_influx_connector","owner":"cdzombak","description":"Ship energy usage data and other UPS stats from Network-UPS-Tools to InfluxDB","archived":false,"fork":false,"pushed_at":"2025-03-13T01:48:07.000Z","size":71,"stargazers_count":10,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T20:52:59.204Z","etag":null,"topics":["energy-data","influxdb","network-ups-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdzombak.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-02T18:44:45.000Z","updated_at":"2025-01-20T00:37:48.000Z","dependencies_parsed_at":"2023-12-27T16:32:06.000Z","dependency_job_id":"75ef4471-6e71-41ae-8697-971ecc0e332d","html_url":"https://github.com/cdzombak/nut_influx_connector","commit_stats":{"total_commits":20,"total_committers":3,"mean_commits":6.666666666666667,"dds":0.09999999999999998,"last_synced_commit":"3332b645a0fe1c06fc6ff81c5c35b30c51bbe0be"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdzombak%2Fnut_influx_connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdzombak%2Fnut_influx_connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdzombak%2Fnut_influx_connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdzombak%2Fnut_influx_connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdzombak","download_url":"https://codeload.github.com/cdzombak/nut_influx_connector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631725,"owners_count":21136560,"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":["energy-data","influxdb","network-ups-tools"],"created_at":"2024-11-15T08:17:11.266Z","updated_at":"2025-04-12T20:53:04.882Z","avatar_url":"https://github.com/cdzombak.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nut_influx_connector\n\nShip energy usage data and other UPS stats from Network-UPS-Tools to InfluxDB.\n\nThe following fields are written to an InfluxDB measurement on a periodic basis:\n\n- `battery_charge_low_percent`: \"Low\" battery charge percentage.\n- `battery_charge_percent`: Battery charge percentage.\n- `battery_runtime_s`: Battery runtime, in seconds.\n- `battery_voltage`: Battery voltage.\n- `battery_voltage_nominal`: Nominal battery voltage.\n- `input_voltage`: Input voltage.\n- `input_voltage_nominal`: Nominal input voltage.\n- `load_percent`: Load percentage of the UPS.\n- `power`: Current power output in watts.\n- `power_nominal`: Nominal (maximum) power output in watts.\n- `watts`: Current power output in watts (duplicates the value written to `power`, for backward compatibility).\n\nThe following fields _may_ be written, if NUT supports them for your UPS:\n\n- `battery_charge_warning_percent`: \"Warning\" battery charge percentage.\n- `battery_temperature_c`: Battery temperature, in Celsius.\n- `battery_temperature_f`: Battery temperature, in Fahrenheit.\n- `input_frequency`: Input frequency.\n- `output_current`: Output current.\n- `output_frequency`: Output frequency.\n- `output_frequency_nominal`: Nominal output frequency.\n- `output_voltage`: Output voltage.\n- `output_voltage_nominal`: Nominal output voltage.\n\n## Usage\n\nThe following syntax will run `openweather-influxdb-connector`, and the program will keep running until it's killed.\n\n```text\nnut_influx_connector \\\n    -influx-bucket \"nut/autogen\" \\\n    -influx-server http://192.168.1.4:8086 \\\n    -ups deskups \\\n    -ups-nametag \"work_desk\" \\\n    [OPTIONS ...]\n```\n\n## Options\n\n* `-heartbeat-url string`: URL to GET every 60s, URL to GET every 60s, if and only if the program has successfully sent NUT statistics to Influx in the past 120s.\n- `-influx-bucket string`: InfluxDB bucket. Supply a string in the form `database/retention-policy`. For the default retention policy, pass just a database name (without the slash character). Required.\n- `-influx-password string`: InfluxDB password.\n- `-influx-server string`: InfluxDB server, including protocol and port, e.g. `http://192.168.1.4:8086`. Required.\n- `-influx-timeout int`: Timeout for writing to InfluxDB, in seconds. (default `3`)\n- `-influx-username string`: InfluxDB username.\n- `-measurement-name string`: InfluxDB measurement name. (default `ups_stats`)\n- `-poll-interval int`: Polling interval, in seconds. (default `30`)\n- `-print-usage`: Log energy usage (in watts) to standard error.\n- `-ups string`: UPS to read status from, format `upsname[@hostname[:port]]`. Required.\n- `-ups-nametag string`: Value for the `ups_name` tag in InfluxDB. Required.\n- `-help`: Print help and exit.\n- `-version`: Print version and exit.\n\n## Installation\n\n### Debian via Apt repository\n\nInstall my Debian repository if you haven't already:\n\n```shell\nsudo apt install ca-certificates curl gnupg\nsudo install -m 0755 -d /etc/apt/keyrings\ncurl -fsSL https://dist.cdzombak.net/deb.key | sudo gpg --dearmor -o /etc/apt/keyrings/dist-cdzombak-net.gpg\nsudo chmod 0644 /etc/apt/keyrings/dist-cdzombak-net.gpg\necho -e \"deb [signed-by=/etc/apt/keyrings/dist-cdzombak-net.gpg] https://dist.cdzombak.net/deb/oss any oss\\n\" | sudo tee -a /etc/apt/sources.list.d/dist-cdzombak-net.list \u003e /dev/null\nsudo apt update\n```\n\nThen install `nut-influx-connector` via `apt`:\n\n```shell\nsudo apt install nut-influx-connector\n```\n\n### macOS via Homebrew\n\n```shell\nbrew install cdzombak/oss/nut_influx_connector\n```\n\n### Manual installation from build artifacts\n\nPre-built binaries for Linux and macOS on various architectures are downloadable from each [GitHub Release](https://github.com/cdzombak/nut_influx_connector/releases). Debian packages for each release are available as well.\n\n### Build and install locally\n\n```shell\ngit clone https://github.com/cdzombak/nut_influx_connector.git\ncd nut_influx_connector\nmake build\n\ncp out/nut_influx_connector $INSTALL_DIR\n```\n\n## Running on Linux with Systemd\n\nAfter installing the binary, you can run it as a systemd service.\n\n- Optionally, create a user for the service to run as: `sudo useradd -r -s /usr/sbin/nologin nut-influx-connector`\n- Install the systemd service `nut-influx-connector.service` and customize that file as desired (e.g. with the correct CLI options for your deployment):\n```shell\ncurl -sSL https://raw.githubusercontent.com/cdzombak/nut_influx_connector/main/nut-influx-connector.service | sudo tee /etc/systemd/system/nut-influx-connector.service\nsudo nano /etc/systemd/system/nut-influx-connector.service\n```\n- Enable and start the service:\n```shell\nsudo systemctl daemon-reload\nsudo systemctl enable nut-influx-connector\nsudo systemctl start nut-influx-connector\n```\n- Verify its operation:\n```shell\nsudo systemctl status nut-influx-connector\nsudo journalctl -f -u nut-influx-connector.service\n```\n\n## Running on macOS with Launchd\n\nAfter installing the binary via Homebrew, you can run it as a launchd service.\n- Install the launchd plist `com.dzombak.nut-influx-connector.plist` and customize that file as desired (e.g. with the correct CLI options for your deployment):\n```shell\nmkdir -p \"$HOME\"/Library/LaunchAgents\ncurl -sSL https://raw.githubusercontent.com/cdzombak/nut_influx_connector/main/com.dzombak.nut-influx-connector.plist \u003e \"$HOME\"/Library/LaunchAgents/com.dzombak.nut-influx-connector.plist\nnano \"$HOME\"/Library/LaunchAgents/com.dzombak.nut-influx-connector.plist\n```\n\n## See Also\n\n- [macos-ups-influx-connector](https://github.com/cdzombak/macos-ups-influx-connector)\n\n## License\n\nMIT; see `LICENSE` in this repository.\n\n## Author\n\n[Chris Dzombak](https://www.dzombak.com) (GitHub [@cdzombak](https://github.com/cdzombak)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdzombak%2Fnut_influx_connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdzombak%2Fnut_influx_connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdzombak%2Fnut_influx_connector/lists"}