{"id":19922517,"url":"https://github.com/sa7mon/ups-telegraf","last_synced_at":"2025-05-03T07:30:43.856Z","repository":{"id":45096526,"uuid":"163694483","full_name":"sa7mon/ups-telegraf","owner":"sa7mon","description":"Get data from USB-connected UPS with Telegraf","archived":false,"fork":false,"pushed_at":"2022-10-20T03:35:56.000Z","size":25,"stargazers_count":23,"open_issues_count":4,"forks_count":23,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T03:51:53.069Z","etag":null,"topics":["cyberpower","influxdb","monitoring","telegraf","ups"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/sa7mon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-31T20:00:56.000Z","updated_at":"2025-01-11T21:12:29.000Z","dependencies_parsed_at":"2023-01-20T05:20:39.786Z","dependency_job_id":null,"html_url":"https://github.com/sa7mon/ups-telegraf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sa7mon%2Fups-telegraf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sa7mon%2Fups-telegraf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sa7mon%2Fups-telegraf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sa7mon%2Fups-telegraf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sa7mon","download_url":"https://codeload.github.com/sa7mon/ups-telegraf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252156743,"owners_count":21703344,"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":["cyberpower","influxdb","monitoring","telegraf","ups"],"created_at":"2024-11-12T22:11:12.703Z","updated_at":"2025-05-03T07:30:43.624Z","avatar_url":"https://github.com/sa7mon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\nGet data from USB-connected UPS into InfluxDB using Telegraf\n\nTransforms `upsc` output like this:\n```\nbattery.charge: 100\nbattery.charge.low: 10\nbattery.charge.warning: 20\nbattery.mfr.date: CPS\nbattery.runtime: 3133\nbattery.runtime.low: 300\nbattery.type: PbAcid\nbattery.voltage: 13.1\nbattery.voltage.nominal: 12\n```\ninto InfluxDB Line Protocol like this: \n```\nups battery.charge=100,battery.charge.low=10,battery.charge.warning=20,battery.mfr.date=\"CPS\",battery.runtime=2970,battery.runtime.low=300,battery.type=\"PbAcid\",battery.voltage=13.1,battery.voltage.nominal=12\n```\n\n## Usage\n\nEdit the script `string_measurements` variable to reflect your setup. Specifically, add any additional measurement names that your UPS provides to the `string_measurements` array (in sorted order) so they will be included in the output.\n\nTo see all the measurements your UPS provides, run this:\n\n```\nupsc YOUR_UPS_NAME_HERE 2\u003e/dev/null | awk -F':' 'BEGIN {print \"string_measurements=[\"} {print \"\\\"\" $1 \"\\\", \"} END {print \"]\"}' |tr -d '\\n'\n```\n\nCall the script from `telegraf.conf` like this\n```\n[[inputs.exec]]\n\n   commands = [\"python /path/to/getUpsData.py \u003cYOUR_UPS_NAME_HERE\u003e\"]\n   timeout = \"5s\"\n   data_format = \"influx\"\n```\n\n## Compatibility\nTested on:\n* Cyberpower CP1000AVRLCDa\n* CyberPower SL700U (`CyberPowerSL700U.py`)\n* Dell UPS 1000T/1920T/1920R HV (`DellBadge-Eaton5PX.py`)\n* MGE Pulsar 2200\n\n\nIf you're using this with a different UPS, please let me know so I can add it to the list\n\n## Contributors\n\nThanks to the following for helping improve this repo.\n\n* @openincident\n* @mattster98\n* @Graffics\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsa7mon%2Fups-telegraf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsa7mon%2Fups-telegraf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsa7mon%2Fups-telegraf/lists"}